Skip to content

Commit 4c2cb65

Browse files
committed
Further separate CITE-seq dist vs. PCA methods
1 parent 13ea5d6 commit 4c2cb65

File tree

9 files changed

+115
-72
lines changed

9 files changed

+115
-72
lines changed

singlecell/resources/chunks/CiteSeqDimRedux.R renamed to singlecell/resources/chunks/CiteSeqDimReduxDist.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ for (datasetId in names(seuratObjects)) {
66
print('ADT assay not present, skipping')
77
} else {
88
tryCatch({
9-
seuratObj <- bindArgs(CellMembrane::CiteSeqDimRedux, seuratObj)()
9+
seuratObj <- bindArgs(CellMembrane::CiteSeqDimRedux.Dist, seuratObj)()
1010
}, error = function(e){
1111
conditionMessage(e)
12-
print(paste0('Error running CiteSeqDimRedux'))
12+
print(paste0('Error running CiteSeqDimRedux.Dist'))
1313
print(conditionMessage(e))
1414
traceback()
1515
})

singlecell/resources/chunks/CiteSeqPca.R renamed to singlecell/resources/chunks/CiteSeqDimReduxPca.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ for (datasetId in names(seuratObjects)) {
55
if (!('ADT' %in% names(seuratObj@assays))) {
66
print('ADT assay not present, skipping')
77
} else {
8-
seuratObj <- bindArgs(CellMembrane::RunAdtPca, seuratObj)()
8+
seuratObj <- bindArgs(CellMembrane::CiteSeqDimRedux.PCA, seuratObj)()
99
}
1010

1111
newSeuratObjects[[datasetId]] <- seuratObj
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
for (datasetId in names(seuratObjects)) {
2+
seuratObj <- seuratObjects[[datasetId]]
3+
seuratObjects[[datasetId]] <- NULL
4+
5+
if (!('ADT' %in% names(seuratObj@assays))) {
6+
print('ADT assay not present, skipping')
7+
} else {
8+
for (adt in rownames(seuratObj[['ADT']])) {
9+
CellMembrane::FeaturePlotAcrossReductions(seuratObj, features = c(adt))
10+
}
11+
}
12+
13+
newSeuratObjects[[datasetId]] <- seuratObj
14+
15+
# Cleanup
16+
rm(seuratObj)
17+
gc()
18+
}

singlecell/src/org/labkey/singlecell/SingleCellModule.java

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,7 @@
3535
import org.labkey.singlecell.analysis.ProcessSeuratObjectHandler;
3636
import org.labkey.singlecell.analysis.ProcessSingleCellHandler;
3737
import org.labkey.singlecell.button.FeatureBarcodeButton;
38-
import org.labkey.singlecell.pipeline.singlecell.AppendCiteSeq;
39-
import org.labkey.singlecell.pipeline.singlecell.AvgExpression;
40-
import org.labkey.singlecell.pipeline.singlecell.CiteSeqDimRedux;
41-
import org.labkey.singlecell.pipeline.singlecell.CiteSeqPca;
42-
import org.labkey.singlecell.pipeline.singlecell.CiteSeqWnn;
43-
import org.labkey.singlecell.pipeline.singlecell.DimPlots;
44-
import org.labkey.singlecell.pipeline.singlecell.DoubletFinder;
45-
import org.labkey.singlecell.pipeline.singlecell.Downsample;
46-
import org.labkey.singlecell.pipeline.singlecell.FilterRawCounts;
47-
import org.labkey.singlecell.pipeline.singlecell.FindClustersAndDimRedux;
48-
import org.labkey.singlecell.pipeline.singlecell.FindMarkers;
49-
import org.labkey.singlecell.pipeline.singlecell.MergeSeurat;
50-
import org.labkey.singlecell.pipeline.singlecell.NormalizeAndScale;
51-
import org.labkey.singlecell.pipeline.singlecell.RemoveCellCycle;
52-
import org.labkey.singlecell.pipeline.singlecell.RunCellHashing;
53-
import org.labkey.singlecell.pipeline.singlecell.RunPCA;
54-
import org.labkey.singlecell.pipeline.singlecell.RunSingleR;
55-
import org.labkey.singlecell.pipeline.singlecell.SplitSeurat;
56-
import org.labkey.singlecell.pipeline.singlecell.SubsetSeurat;
38+
import org.labkey.singlecell.pipeline.singlecell.*;
5739
import org.labkey.singlecell.run.CellRangerFeatureBarcodeHandler;
5840
import org.labkey.singlecell.run.CellRangerGexCountStep;
5941
import org.labkey.singlecell.run.CellRangerVDJWrapper;
@@ -130,6 +112,7 @@ protected void doStartupAfterSpringConfig(ModuleContext moduleContext)
130112
LaboratoryService.get().registerTableCustomizer(this, SingleCellTableCustomizer.class, SingleCellSchema.NAME, SingleCellSchema.TABLE_SAMPLES);
131113
LaboratoryService.get().registerTableCustomizer(this, SingleCellTableCustomizer.class, SingleCellSchema.NAME, SingleCellSchema.TABLE_SORTS);
132114
LaboratoryService.get().registerTableCustomizer(this, SingleCellTableCustomizer.class, SingleCellSchema.NAME, SingleCellSchema.TABLE_CDNAS);
115+
LaboratoryService.get().registerTableCustomizer(this, SingleCellTableCustomizer.class, SingleCellSchema.SEQUENCE_SCHEMA_NAME, SingleCellSchema.TABLE_READSETS);
133116

134117
LDKService.get().registerQueryButton(new ShowBulkEditButton(this, SingleCellSchema.NAME, SingleCellSchema.TABLE_CDNAS), SingleCellSchema.NAME, SingleCellSchema.TABLE_CDNAS);
135118
LDKService.get().registerQueryButton(new ShowBulkEditButton(this, SingleCellSchema.NAME, SingleCellSchema.TABLE_SORTS), SingleCellSchema.NAME, SingleCellSchema.TABLE_SORTS);
@@ -168,11 +151,12 @@ public static void registerPipelineSteps()
168151
SequencePipelineService.get().registerPipelineStep(new FindClustersAndDimRedux.Provider());
169152
SequencePipelineService.get().registerPipelineStep(new SplitSeurat.Provider());
170153
SequencePipelineService.get().registerPipelineStep(new SubsetSeurat.Provider());
171-
SequencePipelineService.get().registerPipelineStep(new CiteSeqDimRedux.Provider());
154+
SequencePipelineService.get().registerPipelineStep(new CiteSeqDimReduxDist.Provider());
172155
SequencePipelineService.get().registerPipelineStep(new CiteSeqWnn.Provider());
173156
SequencePipelineService.get().registerPipelineStep(new AvgExpression.Provider());
174157
SequencePipelineService.get().registerPipelineStep(new DimPlots.Provider());
175-
SequencePipelineService.get().registerPipelineStep(new CiteSeqPca.Provider());
158+
SequencePipelineService.get().registerPipelineStep(new CiteSeqDimReduxPca.Provider());
159+
SequencePipelineService.get().registerPipelineStep(new CiteSeqPlots.Provider());
176160
}
177161

178162
@Override

singlecell/src/org/labkey/singlecell/pipeline/singlecell/CiteSeqDimRedux.java renamed to singlecell/src/org/labkey/singlecell/pipeline/singlecell/CiteSeqDimReduxDist.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import java.util.Arrays;
1010

11-
public class CiteSeqDimRedux extends AbstractCellMembraneStep
11+
public class CiteSeqDimReduxDist extends AbstractCellMembraneStep
1212
{
13-
public CiteSeqDimRedux(PipelineContext ctx, CiteSeqDimRedux.Provider provider)
13+
public CiteSeqDimReduxDist(PipelineContext ctx, CiteSeqDimReduxDist.Provider provider)
1414
{
1515
super(provider, ctx);
1616
}
@@ -19,23 +19,23 @@ public static class Provider extends AbstractPipelineStepProvider<SingleCellStep
1919
{
2020
public Provider()
2121
{
22-
super("CiteSeqDimRedux", "CiteSeq DimRedux (distance)", "CellMembrane/Seurat", "This will run DimRedux steps on the ADT data.", Arrays.asList(
22+
super("CiteSeqDimReduxDist", "CiteSeq DimRedux (distance)", "CellMembrane/Seurat", "This will run DimRedux steps on the ADT data, based on euclidian distance.", Arrays.asList(
2323
SeuratToolParameter.create("performClrNormalization", "Perform CLR Normalization", "If true, Seurat CLR normalization will be performed. Otherwise any pre-existing normalization is used.", "checkbox", new JSONObject(){{
2424
put("checked", true);
2525
}}, true, "performClrNormalization", true)
2626
), null, null);
2727
}
2828

2929
@Override
30-
public CiteSeqDimRedux create(PipelineContext ctx)
30+
public CiteSeqDimReduxDist create(PipelineContext ctx)
3131
{
32-
return new CiteSeqDimRedux(ctx, this);
32+
return new CiteSeqDimReduxDist(ctx, this);
3333
}
3434
}
3535

3636
@Override
3737
public String getFileSuffix()
3838
{
39-
return "cite-dr";
39+
return "cite-dist";
4040
}
4141
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.json.JSONObject;
4+
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
5+
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
6+
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
7+
import org.labkey.api.singlecell.pipeline.SingleCellStep;
8+
9+
import java.util.Arrays;
10+
11+
public class CiteSeqDimReduxPca extends AbstractCellMembraneStep
12+
{
13+
public CiteSeqDimReduxPca(PipelineContext ctx, CiteSeqDimReduxPca.Provider provider)
14+
{
15+
super(provider, ctx);
16+
}
17+
18+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
19+
{
20+
public Provider()
21+
{
22+
super("CiteSeqDimReduxPca", "CiteSeq DimRedux (PCA)", "CellMembrane/Seurat", "This will run DimRedux steps on the ADT data, based on PCA.", Arrays.asList(
23+
SeuratToolParameter.create("performClrNormalization", "Perform CLR Normalization", "If true, Seurat CLR normalization will be performed. Otherwise any pre-existing normalization is used.", "checkbox", new JSONObject(){{
24+
put("checked", true);
25+
}}, true, "performClrNormalization", true),
26+
SeuratToolParameter.create("adtWhitelist", "ADT Whitelist", "If provided, these ADTs will be scaled and used for PCA. If empty, all ADTs will be used.", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
27+
put("height", 150);
28+
put("delimiter", ",");
29+
}}, null),
30+
SeuratToolParameter.create("adtBlacklist", "ADT Blacklist", "If provided, these ADTs will be excluded from scaling/PCA", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
31+
put("height", 150);
32+
put("delimiter", ",");
33+
}}, null)
34+
), null, null);
35+
}
36+
37+
@Override
38+
public CiteSeqDimReduxPca create(PipelineContext ctx)
39+
{
40+
return new CiteSeqDimReduxPca(ctx, this);
41+
}
42+
}
43+
44+
@Override
45+
public String getFileSuffix()
46+
{
47+
return "cite-pca";
48+
}
49+
}

singlecell/src/org/labkey/singlecell/pipeline/singlecell/CiteSeqPca.java

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
4+
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
5+
import org.labkey.api.singlecell.pipeline.SingleCellStep;
6+
7+
public class CiteSeqPlots extends AbstractCellMembraneStep
8+
{
9+
public CiteSeqPlots(PipelineContext ctx, CiteSeqPlots.Provider provider)
10+
{
11+
super(provider, ctx);
12+
}
13+
14+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
15+
{
16+
public Provider()
17+
{
18+
super("CiteSeqPlots", "CiteSeq/ADT Plots", "CellMembrane/Seurat", "This will create FeaturePlots for all features in the ADT assay.", null, null, null);
19+
}
20+
21+
@Override
22+
public CiteSeqPlots create(PipelineContext ctx)
23+
{
24+
return new CiteSeqPlots(ctx, this);
25+
}
26+
}
27+
28+
@Override
29+
public String getFileSuffix()
30+
{
31+
return "cite-plots";
32+
}
33+
}

singlecell/src/org/labkey/singlecell/pipeline/singlecell/NormalizeAndScale.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Provider()
2525
put("initialValues", "vst");
2626
put("allowBlank", false);
2727
}}, "vst"),
28-
SeuratToolParameter.create("variableGenesWhitelist", "Genes to Add to VariableFeatures", "These genes, entered comma-separated or one/line, will be adding to the default Seurat::VariableFeatures gene set when running PCA", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
28+
SeuratToolParameter.create("variableGenesWhitelist", "Genes to Add to VariableFeatures", "These genes, entered comma-separated or one/line, will be added to the default Seurat::VariableFeatures gene set when running PCA", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
2929
put("height", 150);
3030
put("delimiter", ",");
3131
}}, null),

0 commit comments

Comments
 (0)