Skip to content

Commit 5fa44bf

Browse files
author
root
committed
Merge discvr-22.11 to develop
2 parents babfb74 + 01ae694 commit 5fa44bf

File tree

8 files changed

+73
-8
lines changed

8 files changed

+73
-8
lines changed

SequenceAnalysis/pipeline_code/sequence_tools_install.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -851,16 +851,23 @@ then
851851
rm -Rf $LKTOOLS_DIR/_preamble.py
852852
rm -Rf $LKTOOLS_DIR/cutadapt_pip
853853

854-
CUTADAPT_BRANCH=v4.0
855-
pip -V
856854
PIP_VERSION=`pip -V | cut -d '(' -f 2 | sed 's/python //' | cut -c 1 2>1`
857855

858856
if [[ $PIP_VERSION == '2' ]];then
859-
CUTADAPT_BRANCH='v1.3'
857+
wget https://pypi.python.org/packages/source/c/cutadapt/cutadapt-1.8.1.tar.gz
858+
gunzip cutadapt-1.8.1.tar.gz
859+
tar -xf cutadapt-1.8.1.tar
860+
gzip cutadapt-1.8.1.tar
861+
862+
#note: cutadapt expects to be installed using python's package manager; however, this should work
863+
install ./cutadapt-1.8.1/bin/cutadapt ${LKTOOLS_DIR}/cutadapt.py
864+
install ./cutadapt-1.8.1/bin/_preamble.py ${LKTOOLS_DIR}/_preamble.py
865+
cp -R ./cutadapt-1.8.1/cutadapt ${LKTOOLS_DIR}/cutadapt
866+
else
867+
CUTADAPT_BRANCH=v4.0
868+
pip install --target ${LKTOOLS_DIR}/cutadapt_pip git+https://github.com/marcelm/cutadapt.git@${CUTADAPT_BRANCH}
869+
ln -s ${LKTOOLS_DIR}/cutadapt_pip/bin/cutadapt ${LKTOOLS_DIR}/cutadapt
860870
fi
861-
862-
pip install --target ${LKTOOLS_DIR}/cutadapt_pip git+https://github.com/marcelm/cutadapt.git@${CUTADAPT_BRANCH}
863-
ln -s ${LKTOOLS_DIR}/cutadapt_pip/bin/cutadapt ${LKTOOLS_DIR}/cutadapt
864871
else
865872
echo "Already installed"
866873
fi

singlecell/resources/chunks/RunCelltypist.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ for (datasetId in names(seuratObjects)) {
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

55
for (mn in modelNames) {
6-
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = paste0(mn, '.pkl'), convertAmbiguousToNA = convertAmbiguousToNA, columnPrefix = paste0('celltypist.', mn, '.'), pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode, maxBatchSize = maxBatchSize)
6+
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = paste0(mn, '.pkl'), convertAmbiguousToNA = convertAmbiguousToNA, columnPrefix = paste0('celltypist.', mn, '.'), pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix)
77
}
88

99
saveData(seuratObj, datasetId)

singlecell/resources/chunks/RunCelltypistCustomModel.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ for (datasetId in names(seuratObjects)) {
22
printName(datasetId)
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

5-
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = modelFile, columnPrefix = columnPrefix, convertAmbiguousToNA = convertAmbiguousToNA, pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode, maxBatchSize = maxBatchSize)
5+
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = modelFile, columnPrefix = columnPrefix, convertAmbiguousToNA = convertAmbiguousToNA, pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix)
66

77
saveData(seuratObj, datasetId)
88
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
for (datasetId in names(seuratObjects)) {
2+
printName(datasetId)
3+
seuratObj <- readRDS(seuratObjects[[datasetId]])
4+
5+
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = 'RIRA_Immune_v1', maxBatchSize = maxBatchSize, columnPrefix = 'RIRA_Immune_v1.', retainProbabilityMatrix = retainProbabilityMatrix)
6+
seuratObj <- RIRA::Classify_TNK(seuratObj, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix)
7+
8+
saveData(seuratObj, datasetId)
9+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public static void registerPipelineSteps()
200200
SequencePipelineService.get().registerPipelineStep(new RunScGate.Provider());
201201
SequencePipelineService.get().registerPipelineStep(new RunCelltypist.Provider());
202202
SequencePipelineService.get().registerPipelineStep(new RunCelltypistCustomModel.Provider());
203+
SequencePipelineService.get().registerPipelineStep(new RunRiraClassification.Provider());
203204
SequencePipelineService.get().registerPipelineStep(new TrainCelltypist.Provider());
204205
SequencePipelineService.get().registerPipelineStep(new CheckExpectations.Provider());
205206
SequencePipelineService.get().registerPipelineStep(new CommonFilters.Provider());

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public Provider()
5151
{{
5252
put("checked", true);
5353
}}, true),
54+
SeuratToolParameter.create("retainProbabilityMatrix", "Retain Probability Matrix", "If true, the celltypist probability_matrix with per-class probabilities will be stored in meta.data", "checkbox", new JSONObject()
55+
{{
56+
put("checked", true);
57+
}}, true),
5458
SeuratToolParameter.create("pThreshold", "pThreshold", "This is passed to the --p-thres argument.", "ldk-numberfield", new JSONObject()
5559
{{
5660
put("minValue", 0);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public Provider()
5858
{{
5959
put("checked", true);
6060
}}, true),
61+
SeuratToolParameter.create("retainProbabilityMatrix", "Retain Probability Matrix", "If true, the celltypist probability_matrix with per-class probabilities will be stored in meta.data", "checkbox", new JSONObject()
62+
{{
63+
put("checked", true);
64+
}}, true),
6165
SeuratToolParameter.create("pThreshold", "pThreshold", "This is passed to the --p-thres argument.", "ldk-numberfield", new JSONObject()
6266
{{
6367
put("minValue", 0);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.json.old.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 RunRiraClassification extends AbstractRiraStep
12+
{
13+
public RunRiraClassification(PipelineContext ctx, RunRiraClassification.Provider provider)
14+
{
15+
super(provider, ctx);
16+
}
17+
18+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
19+
{
20+
public Provider()
21+
{
22+
super("RunRiraClassification", "Run RIRA Classification", "RIRA/Celltypist", "This will run RIRA's Celltypist-based models for course cell type and T/NK cells.", Arrays.asList(
23+
SeuratToolParameter.create("maxBatchSize", "Max Cells Per Batch", "If the object has more than this many cells, celltypist will be run in batches", "ldk-integerfield", new JSONObject()
24+
{{
25+
put("minValue", 0);
26+
}}, 500000),
27+
SeuratToolParameter.create("retainProbabilityMatrix", "Retain Probability Matrix", "If true, the celltypist probability_matrix with per-class probabilities will be stored in meta.data", "checkbox", new JSONObject()
28+
{{
29+
put("checked", true);
30+
}}, true)
31+
), null, null);
32+
}
33+
34+
@Override
35+
public RunRiraClassification create(PipelineContext ctx)
36+
{
37+
return new RunRiraClassification(ctx, this);
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)