Skip to content

Commit 68f6af8

Browse files
committed
Support minAllowableDoubletRateFilter
1 parent 6545d95 commit 68f6af8

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,15 @@ public static class CellHashingParameters
103103
public boolean skipNormalizationQc = false;
104104
public Integer minCountPerCell = 5;
105105
public Double majorityConsensusThreshold = null;
106+
public Double minAllowableDoubletRateFilter = null;
106107
public Double callerDisagreementThreshold = null;
107108
public List<CALLING_METHOD> methods = CALLING_METHOD.getDefaultConsensusMethods(); //Default to just executing the set used for default consensus calls, rather than additional ones
108109
public List<CALLING_METHOD> consensusMethods = null;
109110
public String basename = null;
110111
public Integer cells = 0;
111112
public boolean keepMarkdown = false;
112113
public File h5File = null;
113-
public boolean doTSNE = true;
114+
public boolean doTSNE = false;
114115

115116
private CellHashingParameters()
116117
{
@@ -124,6 +125,7 @@ public static CellHashingService.CellHashingParameters createFromStep(SequenceOu
124125
ret.skipNormalizationQc = step.getProvider().getParameterByName("skipNormalizationQc").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
125126
ret.minCountPerCell = step.getProvider().getParameterByName("minCountPerCell").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Integer.class, 3);
126127
ret.majorityConsensusThreshold = step.getProvider().getParameterByName("majorityConsensusThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
128+
ret.minAllowableDoubletRateFilter = step.getProvider().getParameterByName("minAllowableDoubletRateFilter").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
127129
ret.callerDisagreementThreshold = step.getProvider().getParameterByName("callerDisagreementThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
128130
ret.doTSNE = step.getProvider().getParameterByName("doTSNE").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, null);
129131
ret.retainRawCountFile = step.getProvider().getParameterByName("retainRawCountFile").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, true);
@@ -166,6 +168,7 @@ public static CellHashingParameters createFromJson(BARCODE_TYPE type, File webse
166168
ret.skipNormalizationQc = params.optBoolean("skipNormalizationQc", false);
167169
ret.minCountPerCell = params.optInt("minCountPerCell", 3);
168170
ret.majorityConsensusThreshold = params.get("majorityConsensusThreshold") == null ? null : params.getDouble("majorityConsensusThreshold");
171+
ret.minAllowableDoubletRateFilter = params.get("minAllowableDoubletRateFilter") == null ? null : params.getDouble("minAllowableDoubletRateFilter");
169172
ret.callerDisagreementThreshold = params.get("callerDisagreementThreshold") == null ? null : params.getDouble("callerDisagreementThreshold");
170173
ret.doTSNE = params.get("doTSNE") == null || params.getBoolean("doTSNE");
171174
ret.retainRawCountFile = params.optBoolean("retainRawCountFile", true);

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,13 @@ public List<ToolParameterDescriptor> getHashingCallingParams(boolean allowMethod
964964
put("maxValue", 1);
965965
put("decimalPrecision", 2);
966966
}}, 0.2),
967+
ToolParameterDescriptor.create("minAllowableDoubletRateFilter", "Min Allowable Doublet Rate Filter", "This applies to filtering algorithms based on their doublet rate. Typically, any algorithm with a high doublet rate (based on the theoretical rate) is discarded. This sets a minimum to the threshold used for triaging an algorithm", "ldk-numberfield", new JSONObject(){{
968+
put("minValue", 0);
969+
put("maxValue", 1);
970+
put("decimalPrecision", 2);
971+
}}, 0.2),
967972
ToolParameterDescriptor.create("skipNormalizationQc", "Skip Normalization QC", null, "checkbox", null, true),
968-
ToolParameterDescriptor.create("doTSNE", "Do tSNE", "If true, tSNE will be performed as part of QC", "checkbox", null, true),
973+
ToolParameterDescriptor.create("doTSNE", "Do tSNE", "If true, tSNE will be performed as part of QC", "checkbox", null, false),
969974
ToolParameterDescriptor.create("retainRawCountFile", "Retain Raw Counts File", null, "checkbox", null, false),
970975
ToolParameterDescriptor.create("failIfUnexpectedHtosFound", "Fail If Unexpected HTOs Found", "If checked and if there are any HTOs (testing all known HTOs) with counts above the HTOs expected in this experiment, then an error will be thrown", "checkbox", new JSONObject(){{
971976
put("checked", true);
@@ -1263,7 +1268,21 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
12631268
String doTSNE = parameters.doTSNE ? "TRUE" : "FALSE";
12641269
String h5String = h5 == null ? "" : ", rawFeatureMatrixH5 = '/work/" + h5.getName() + "'";
12651270
String consensusMethodString = consensusMethodNames.isEmpty() ? "" : ", methodsForConsensus = c('" + StringUtils.join(consensusMethodNames, "','") + "')";
1266-
writer.println("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir.getName() + "'" + h5String + ", molInfoFile = '/work/" + molInfo.getName() + "', reportFile = '/work/" + htmlFile.getName() + "', callFile = '/work/" + callsFile.getName() + "', metricsFile = '/work/" + metricsFile.getName() + "', rawCountsExport = '/work/" + countFile.getName() + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters.getReportTitle() + "', skipNormalizationQc = " + skipNormalizationQcString + ", methods = c('" + StringUtils.join(methodNames, "','") + "')" + consensusMethodString + ", keepMarkdown = " + keepMarkdown + ", minCountPerCell = " + (parameters.minCountPerCell == null ? "NULL" : parameters.minCountPerCell) + ", majorityConsensusThreshold = " + (parameters.majorityConsensusThreshold == null ? "NULL" : parameters.majorityConsensusThreshold) + ", callerDisagreementThreshold = " + (parameters.callerDisagreementThreshold == null ? "NULL" : parameters.callerDisagreementThreshold) + ", doTSNE = " + doTSNE + ")");
1271+
writer.println("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir.getName() + "'" + h5String + ", molInfoFile = '/work/" + molInfo.getName() +
1272+
"', reportFile = '/work/" + htmlFile.getName() +
1273+
"', callFile = '/work/" + callsFile.getName() +
1274+
"', metricsFile = '/work/" + metricsFile.getName() +
1275+
"', rawCountsExport = '/work/" + countFile.getName() +
1276+
"', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam +
1277+
", title = '" + parameters.getReportTitle() +
1278+
"', skipNormalizationQc = " + skipNormalizationQcString +
1279+
", methods = c('" + StringUtils.join(methodNames, "','") + "')" + consensusMethodString +
1280+
", keepMarkdown = " + keepMarkdown +
1281+
", minCountPerCell = " + (parameters.minCountPerCell == null ? "NULL" : parameters.minCountPerCell) +
1282+
", majorityConsensusThreshold = " + (parameters.majorityConsensusThreshold == null ? "NULL" : parameters.majorityConsensusThreshold) +
1283+
", callerDisagreementThreshold = " + (parameters.callerDisagreementThreshold == null ? "NULL" : parameters.callerDisagreementThreshold) +
1284+
(parameters.minAllowableDoubletRateFilter == null ? "" : "', minAllowableDoubletRateFilter = " + parameters.minAllowableDoubletRateFilter) +
1285+
", doTSNE = " + doTSNE + ")");
12671286
writer.println("print('Rmarkdown complete')");
12681287

12691288
}

0 commit comments

Comments
 (0)