Skip to content

Commit b95dc65

Browse files
committed
Add support for PlotAverageAdtCounts
1 parent f491752 commit b95dc65

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
for (datasetId in names(seuratObjects)) {
2+
seuratObj <- readRDS(seuratObjects[[datasetId]])
3+
4+
if (!('ADT' %in% names(seuratObj@assays))) {
5+
print('ADT assay not present, skipping')
6+
} else {
7+
CellMembrane::PlotAverageAdtCounts(seuratObj, groupFields = fieldNames)
8+
}
9+
10+
# Cleanup
11+
rm(seuratObj)
12+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public static void registerPipelineSteps()
165165
SequencePipelineService.get().registerPipelineStep(new SeuratPrototype.Provider());
166166
SequencePipelineService.get().registerPipelineStep(new DietSeurat.Provider());
167167
SequencePipelineService.get().registerPipelineStep(new ClearCommands.Provider());
168+
SequencePipelineService.get().registerPipelineStep(new PlotAverageCiteSeqCounts.Provider());
168169

169170
SequenceAnalysisService.get().registerFileHandler(new NimbleAlignmentStep());
170171
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
import org.labkey.api.util.PageFlowUtil;
9+
10+
import java.util.Arrays;
11+
import java.util.Collection;
12+
13+
public class PlotAverageCiteSeqCounts extends AbstractCellMembraneStep
14+
{
15+
public PlotAverageCiteSeqCounts(PipelineContext ctx, PlotAverageCiteSeqCounts.Provider provider)
16+
{
17+
super(provider, ctx);
18+
}
19+
20+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
21+
{
22+
public Provider()
23+
{
24+
super("PlotAverageCiteSeqCounts", "PlotAverageCiteSeqCounts", "CellMembrane", "This will generate a heatmap with average ADT counts, grouped using the fields below.", Arrays.asList(
25+
SeuratToolParameter.create("fieldNames", "Fields To Plot", "Enter one field name per line", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
26+
put("allowBlank", false);
27+
put("height", 150);
28+
put("delimiter", ",");
29+
}}, "ClusterNames_0.2,ClusterNames_0.4,ClusterNames_0.6")
30+
), Arrays.asList("/sequenceanalysis/field/TrimmingTextArea.js"), null);
31+
}
32+
33+
@Override
34+
public PlotAverageCiteSeqCounts create(PipelineContext ctx)
35+
{
36+
return new PlotAverageCiteSeqCounts(ctx, this);
37+
}
38+
}
39+
40+
@Override
41+
public Collection<String> getRLibraries()
42+
{
43+
return PageFlowUtil.set("Seurat");
44+
}
45+
46+
@Override
47+
public boolean createsSeuratObjects()
48+
{
49+
return false;
50+
}
51+
52+
@Override
53+
public String getFileSuffix()
54+
{
55+
return "avgAdt";
56+
}
57+
}

0 commit comments

Comments
 (0)