Skip to content

Commit aa9547e

Browse files
committed
Allow celltypist training to run when the job has more than one input, provided they are eventually merged
1 parent 91e2284 commit aa9547e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
for (datasetId in names(seuratObjects)) {
2-
printName(datasetId)
3-
seuratObj <- readRDS(seuratObjects[[datasetId]])
1+
if (length(names(seuratObjects)) > 1) {
2+
stop('Training expects a single input. Either include a merge step upstream or run jobs on individual input files')
3+
}
44

5-
RIRA::TrainCellTypist(seuratObj, labelField = labelField, minCellsPerClass = minCellsPerClass, modelFile = modelFile, tempFileLocation = '/work')
6-
}
5+
datasetId <- names(seuratObjects)[[1]]
6+
printName(datasetId)
7+
seuratObj <- readRDS(seuratObjects[[datasetId]])
8+
9+
RIRA::TrainCellTypist(seuratObj, labelField = labelField, minCellsPerClass = minCellsPerClass, modelFile = modelFile, tempFileLocation = '/work')

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ public boolean createsSeuratObjects()
6565
return false;
6666
}
6767

68-
@Override
69-
public void init(SequenceOutputHandler.JobContext ctx, List<SequenceOutputFile> inputFiles) throws PipelineJobException
70-
{
71-
if (inputFiles.size() > 1)
72-
{
73-
throw new PipelineJobException("Celltypist train step expects this job to have a single input. Consider selecting the option to run jobs individually instead of merged");
74-
}
75-
}
68+
//@Override
69+
//public void init(SequenceOutputHandler.JobContext ctx, List<SequenceOutputFile> inputFiles) throws PipelineJobException
70+
//{
71+
// //NOTE: a valid use-case is to merge/filter many inputs, produce one object, and train, so dont perform this check.
72+
// if (inputFiles.size() > 1)
73+
// {
74+
// throw new PipelineJobException("Celltypist train step expects this job to have a single input. Consider selecting the option to run jobs individually instead of merged");
75+
// }
76+
//}
7677

7778
@Override
7879
public Output execute(SequenceOutputHandler.JobContext ctx, List<SeuratObjectWrapper> inputObjects, String outputPrefix) throws PipelineJobException

0 commit comments

Comments
 (0)