Skip to content

Commit 83146b0

Browse files
committed
Add steps to annotate seurat objects using scGate or celltypist
1 parent c3bd72a commit 83146b0

File tree

8 files changed

+151
-0
lines changed

8 files changed

+151
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
for (datasetId in names(seuratObjects)) {
2+
seuratObj <- readRDS(seuratObjects[[datasetId]])
3+
4+
if ('ADT' %in% names(seuratObj@assays)) {
5+
seuratObj@assays$ADT <- NULL
6+
} else {
7+
print('ADT assay not found, skipping')
8+
}
9+
10+
saveData(seuratObj, datasetId)
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
for (datasetId in names(seuratObjects)) {
2+
seuratObj <- readRDS(seuratObjects[[datasetId]])
3+
4+
seuratObj <- RIRA::RunCellTypist(seuratObj)
5+
6+
saveData(seuratObj, datasetId)
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
for (datasetId in names(seuratObjects)) {
2+
seuratObj <- readRDS(seuratObjects[[datasetId]])
3+
4+
seuratObj <- RIRA::RunScGateForModels(seuratObj, modelNames = c('Bcell', 'Tcell', 'NK', 'Myeloid'), labelRename = list(Tcell = 'T_NK', NK = 'T_NK'))
5+
6+
saveData(seuratObj, datasetId)
7+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ public static void registerPipelineSteps()
170170
SequencePipelineService.get().registerPipelineStep(new DietSeurat.Provider());
171171
SequencePipelineService.get().registerPipelineStep(new ClearCommands.Provider());
172172
SequencePipelineService.get().registerPipelineStep(new PlotAverageCiteSeqCounts.Provider());
173+
SequencePipelineService.get().registerPipelineStep(new DropCiteSeq.Provider());
174+
SequencePipelineService.get().registerPipelineStep(new RunScGate.Provider());
175+
SequencePipelineService.get().registerPipelineStep(new RunCelltypist.Provider());
173176

174177
SequenceAnalysisService.get().registerFileHandler(new NimbleAlignmentStep());
175178
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
4+
import org.labkey.api.sequenceanalysis.pipeline.PipelineStepProvider;
5+
import org.labkey.api.singlecell.pipeline.AbstractSingleCellPipelineStep;
6+
import org.labkey.api.util.PageFlowUtil;
7+
8+
import java.util.Collection;
9+
10+
abstract public class AbstractRiraStep extends AbstractSingleCellPipelineStep
11+
{
12+
public static String CONTAINER_NAME = "ghcr.io/bimberlabinternal/rira:latest";
13+
14+
public AbstractRiraStep(PipelineStepProvider<?> provider, PipelineContext ctx)
15+
{
16+
super(provider, ctx);
17+
}
18+
19+
@Override
20+
public Collection<String> getRLibraries()
21+
{
22+
return PageFlowUtil.set("RIRA");
23+
}
24+
25+
@Override
26+
public String getDockerContainerName()
27+
{
28+
return CONTAINER_NAME;
29+
}
30+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
import java.util.Arrays;
8+
9+
public class DropCiteSeq extends AbstractCellMembraneStep
10+
{
11+
public DropCiteSeq(PipelineContext ctx, DropCiteSeq.Provider provider)
12+
{
13+
super(provider, ctx);
14+
}
15+
16+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
17+
{
18+
public Provider()
19+
{
20+
super("DropCiteSeq", "Drop CiteSeq", "CellMembrane", "This will remove the CITE-seq (ADT) assay, if it exists.", Arrays.asList(
21+
22+
), null, null);
23+
}
24+
25+
@Override
26+
public DropCiteSeq create(PipelineContext ctx)
27+
{
28+
return new DropCiteSeq(ctx, this);
29+
}
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
import java.util.Arrays;
8+
9+
public class RunCelltypist extends AbstractRiraStep
10+
{
11+
public RunCelltypist(PipelineContext ctx, RunCelltypist.Provider provider)
12+
{
13+
super(provider, ctx);
14+
}
15+
16+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
17+
{
18+
public Provider()
19+
{
20+
super("RunCelltypist", "Run Celltypist", "Celltypist", "This will run Celltypist with the Immune_All_Low.pkl model.", Arrays.asList(
21+
22+
), null, null);
23+
}
24+
25+
@Override
26+
public RunCelltypist create(PipelineContext ctx)
27+
{
28+
return new RunCelltypist(ctx, this);
29+
}
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
import java.util.Arrays;
8+
9+
public class RunScGate extends AbstractRiraStep
10+
{
11+
public RunScGate(PipelineContext ctx, RunScGate.Provider provider)
12+
{
13+
super(provider, ctx);
14+
}
15+
16+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
17+
{
18+
public Provider()
19+
{
20+
super("RunScGate", "Run scGate", "scGate", "This will run scGate with the default built-in models and create a consensus call.", Arrays.asList(
21+
22+
), null, null);
23+
}
24+
25+
@Override
26+
public RunScGate create(PipelineContext ctx)
27+
{
28+
return new RunScGate(ctx, this);
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)