Skip to content

Commit 66af918

Browse files
committed
Bugfix to SubsetSeurat when a downstream filter returns zero cells
1 parent 9f12dcc commit 66af918

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

jbrowse/src/org/labkey/jbrowse/JBrowseMaintenanceTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private void processContainer(Container c, Logger log) throws IOException
179179
User u = LDKService.get().getBackgroundAdminUser();
180180
if (u == null)
181181
{
182-
log.error("In order to ensure genomes are prepared for JBrowse, the LDK module property BackgroundAdminUser must be set");
182+
log.warn("In order to ensure genomes are prepared for JBrowse, the LDK module property BackgroundAdminUser must be set");
183183
}
184184
else
185185
{

singlecell/resources/chunks/SubsetSeurat.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ for (datasetId in names(seuratObjects)) {
77
seuratObj$HTO.Classification <- seuratObj$consensuscall.global
88
}
99

10+
print(paste0('Initial cells for dataset: ', datasetId, ' ', ncol(seuratObj)))
1011
<SUBSET_CODE>
1112

13+
if (!is.null(seuratObj)) {
14+
newSeuratObjects[[datasetId]] <- seuratObj
15+
}
16+
1217
# Cleanup
1318
rm(seuratObj)
1419
gc()

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected List<String> loadChunkFromFile() throws PipelineJobException
8181
String subsetEscaped = subset.replace("'", "\\\'");
8282

8383
ret.add("\tif (!is.null(seuratObj)) {");
84+
ret.add("\tprint(paste0('Subsetting dataset: ', datasetId, ' with the expression: '" + subsetEscaped + "'))");
8485
ret.add("\t\tcells <- c()");
8586
ret.add("\t\ttryCatch({");
8687
ret.add("\t\t\tcells <- WhichCells(seuratObj, expression = " + subset + ")");
@@ -96,9 +97,9 @@ protected List<String> loadChunkFromFile() throws PipelineJobException
9697
ret.add("\t\t} else {");
9798
ret.add("\t\t\tseuratObj <- subset(seuratObj, cells = cells)");
9899
ret.add("\t\t\tprint(paste0('Cells after subset: ', ncol(seuratObj)))");
99-
ret.add("\t\t\tnewSeuratObjects[[datasetId]] <- seuratObj");
100100
ret.add("\t\t}");
101-
ret.add("}");
101+
ret.add("\t}");
102+
ret.add("");
102103
}
103104
}
104105
else

0 commit comments

Comments
 (0)