Skip to content

Commit b21f423

Browse files
committed
Allow cellranger VDJ to finish when there are no a/b hits
1 parent 2a3df02 commit b21f423

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

singlecell/api-src/org/labkey/api/singlecell/CellHashingService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public static class CellHashingParameters
9393
public @Nullable Integer genomeId;
9494
public Integer editDistance = 2;
9595
public boolean scanEditDistances = false;
96+
public boolean skipNormalizationQc = false;
9697
public Integer minCountPerCell = 5;
9798
public List<CALLING_METHOD> methods = CALLING_METHOD.getDefaultMethods();
9899
public String basename = null;
@@ -108,6 +109,7 @@ public static CellHashingService.CellHashingParameters createFromStep(SequenceOu
108109
CellHashingService.CellHashingParameters ret = new CellHashingService.CellHashingParameters();
109110
ret.type = type;
110111
ret.scanEditDistances = step.getProvider().getParameterByName("scanEditDistances").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
112+
ret.skipNormalizationQc = step.getProvider().getParameterByName("skipNormalizationQc").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
111113
ret.editDistance = step.getProvider().getParameterByName("editDistance").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Integer.class, 2);
112114
ret.minCountPerCell = step.getProvider().getParameterByName("minCountPerCell").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Integer.class, 3);
113115
ret.htoOrCiteseqReadset = htoOrCiteseqReadset;
@@ -136,6 +138,7 @@ public static CellHashingParameters createFromJson(BARCODE_TYPE type, File webse
136138
CellHashingParameters ret = new CellHashingParameters();
137139
ret.type = type;
138140
ret.scanEditDistances = params.optBoolean("scanEditDistances", false);
141+
ret.skipNormalizationQc = params.optBoolean("skipNormalizationQc", false);
139142
ret.editDistance = params.optInt("editDistance", 2);
140143
ret.minCountPerCell = params.optInt("minCountPerCell", 3);
141144
ret.htoOrCiteseqReadset = htoOrCiteseqReadset;

singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,8 @@ public List<ToolParameterDescriptor> getDefaultHashingParams(boolean includeExcl
830830
put("checked", false);
831831
}}, false),
832832
ToolParameterDescriptor.create("editDistance", "Edit Distance", null, "ldk-integerfield", null, 2),
833-
ToolParameterDescriptor.create("minCountPerCell", "Min Reads/Cell", null, "ldk-integerfield", null, 5)
833+
ToolParameterDescriptor.create("minCountPerCell", "Min Reads/Cell", null, "ldk-integerfield", null, 5),
834+
ToolParameterDescriptor.create("skipNormalizationQc", "Skip Normalization QC", null, "checkbox", null, true)
834835
));
835836

836837
if (type == BARCODE_TYPE.hashing)
@@ -1238,7 +1239,8 @@ private File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, S
12381239
Set<String> allowableBarcodes = parameters.getAllowableBarcodeNames();
12391240
String allowableBarcodeParam = allowableBarcodes != null ? "c('" + StringUtils.join(allowableBarcodes, "','") + "')" : "NULL";
12401241

1241-
writer.println("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir.getName() + "', reportFile = '/work/" + htmlFile.getName() + "', callFile = '/work/" + callsFile.getName() + "', metricsFile = '/work/" + metricsFile.getName() + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters.getReportTitle() + "', methods = c('" + StringUtils.join(methodNames, "','") + "'))");
1242+
String skipNormalizationQcString = parameters.skipNormalizationQc ? "TRUE" : "FALSE";
1243+
writer.println("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir.getName() + "', reportFile = '/work/" + htmlFile.getName() + "', callFile = '/work/" + callsFile.getName() + "', metricsFile = '/work/" + metricsFile.getName() + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters.getReportTitle() + "', skipNormalizationQc = " + skipNormalizationQcString + ", methods = c('" + StringUtils.join(methodNames, "','") + "'))");
12421244
writer.println("print('Rmarkdown complete')");
12431245

12441246
}

singlecell/src/org/labkey/singlecell/run/CellRangerVDJWrapper.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,23 @@ public AlignmentStep.AlignmentOutput performAlignment(Readset rs, File inputFast
374374
File outputVloupe = new File(outdir, "vloupe.vloupe");
375375
if (!outputVloupe.exists())
376376
{
377-
throw new PipelineJobException("Unable to find file: " + outputVloupe.getPath());
377+
//NOTE: if there were no A/B hits, the vLoupe isnt created, but all other outputs exist
378+
File csv = new File(outdir, "all_contig_annotations.csv");
379+
if (!csv.exists())
380+
{
381+
throw new PipelineJobException("Unable to find file: " + outputVloupe.getPath());
382+
}
378383
}
379-
380-
File outputVloupeRename = new File(outdir, prefix + outputVloupe.getName());
381-
if (outputVloupeRename.exists())
384+
else
382385
{
383-
outputVloupeRename.delete();
386+
File outputVloupeRename = new File(outdir, prefix + outputVloupe.getName());
387+
if (outputVloupeRename.exists())
388+
{
389+
outputVloupeRename.delete();
390+
}
391+
FileUtils.moveFile(outputVloupe, outputVloupeRename);
392+
output.addSequenceOutput(outputVloupeRename, rs.getName() + " 10x VLoupe", "10x VLoupe", rs.getRowId(), null, referenceGenome.getGenomeId(), null);
384393
}
385-
FileUtils.moveFile(outputVloupe, outputVloupeRename);
386-
output.addSequenceOutput(outputVloupeRename, rs.getName() + " 10x VLoupe", "10x VLoupe", rs.getRowId(), null, referenceGenome.getGenomeId(), null);
387394
}
388395
catch (IOException e)
389396
{

0 commit comments

Comments
 (0)