Skip to content

Commit

Permalink
Add step to repeat cell cycle scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Feb 6, 2024
1 parent f0a2037 commit 929b11f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions singlecell/resources/chunks/ScoreCellCycle.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
for (datasetId in names(seuratObjects)) {
printName(datasetId)
seuratObj <- readSeuratRDS(seuratObjects[[datasetId]])

seuratObj <- CellMembrane::ScoreCellCycle(seuratObj, useAlternateG2M = useAlternateG2M)

saveData(seuratObj, datasetId)

# Cleanup
rm(seuratObj)
gc()
}
1 change: 1 addition & 0 deletions singlecell/src/org/labkey/singlecell/SingleCellModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public static void registerPipelineSteps()
SequencePipelineService.get().registerPipelineStep(new FilterDisallowedClasses.Provider());
SequencePipelineService.get().registerPipelineStep(new SummarizeTCellActivation.Provider());
SequencePipelineService.get().registerPipelineStep(new RunScMetabolism.Provider());
SequencePipelineService.get().registerPipelineStep(new ScoreCellCycle.Provider());

SequenceAnalysisService.get().registerReadsetListener(new SingleCellReadsetListener());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.labkey.singlecell.pipeline.singlecell;

import org.json.JSONObject;
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
import org.labkey.api.singlecell.pipeline.SingleCellStep;

import java.util.Arrays;

public class ScoreCellCycle extends AbstractCellMembraneStep
{
public ScoreCellCycle(PipelineContext ctx, ScoreCellCycle.Provider provider)
{
super(provider, ctx);
}

public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
{
public Provider()
{
super("ScoreCellCycle", "Score Cell Cycle", "CellMembrane/Seurat", "This will score cells by cell cycle phase.", Arrays.asList(
SeuratToolParameter.create("useAlternateG2M", "Use Alternate G2M Genes", "If checked, this will use a smaller set of G2M genes, defined from: https://raw.githubusercontent.com/hbc/tinyatlas/master/cell_cycle/Homo_sapiens.csv", "checkbox", new JSONObject(){{
put("checked", true);
}}, true)
), null, null);
}

@Override
public ScoreCellCycle create(PipelineContext ctx)
{
return new ScoreCellCycle(ctx, this);
}
}

@Override
public String getFileSuffix()
{
return "cc";
}
}

0 comments on commit 929b11f

Please sign in to comment.