Skip to content

Commit 569af02

Browse files
committed
Support minAllowableSingletRate in cell hashing
1 parent 806a1fb commit 569af02

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
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
@@ -104,6 +104,7 @@ public static class CellHashingParameters
104104
public Integer minCountPerCell = 5;
105105
public Double majorityConsensusThreshold = null;
106106
public Double minAllowableDoubletRateFilter = null;
107+
public Double minAllowableSingletRate = null;
107108
public Double callerDisagreementThreshold = null;
108109
public List<CALLING_METHOD> methods = CALLING_METHOD.getDefaultConsensusMethods(); //Default to just executing the set used for default consensus calls, rather than additional ones
109110
public List<CALLING_METHOD> consensusMethods = null;
@@ -127,6 +128,7 @@ public static CellHashingService.CellHashingParameters createFromStep(SequenceOu
127128
ret.minCountPerCell = step.getProvider().getParameterByName("minCountPerCell").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Integer.class, 3);
128129
ret.majorityConsensusThreshold = step.getProvider().getParameterByName("majorityConsensusThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
129130
ret.minAllowableDoubletRateFilter = step.getProvider().getParameterByName("minAllowableDoubletRateFilter").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
131+
ret.minAllowableSingletRate = step.getProvider().getParameterByName("minAllowableSingletRate").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
130132
ret.callerDisagreementThreshold = step.getProvider().getParameterByName("callerDisagreementThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
131133
ret.doTSNE = step.getProvider().getParameterByName("doTSNE").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
132134
ret.doNotAllowResume = step.getProvider().getParameterByName("doNotAllowResume").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
@@ -171,6 +173,7 @@ public static CellHashingParameters createFromJson(BARCODE_TYPE type, File webse
171173
ret.minCountPerCell = params.optInt("minCountPerCell", 3);
172174
ret.majorityConsensusThreshold = params.get("majorityConsensusThreshold") == null ? null : params.getDouble("majorityConsensusThreshold");
173175
ret.minAllowableDoubletRateFilter = params.get("minAllowableDoubletRateFilter") == null ? null : params.getDouble("minAllowableDoubletRateFilter");
176+
ret.minAllowableSingletRate = params.get("minAllowableSingletRate") == null ? null : params.getDouble("minAllowableSingletRate");
174177
ret.callerDisagreementThreshold = params.get("callerDisagreementThreshold") == null ? null : params.getDouble("callerDisagreementThreshold");
175178
ret.doTSNE = params.optBoolean("doTSNE", false);
176179
ret.doNotAllowResume = params.optBoolean("doNotAllowResume", false);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,11 @@ public List<ToolParameterDescriptor> getHashingCallingParams(boolean allowMethod
979979
put("maxValue", 1);
980980
put("decimalPrecision", 2);
981981
}}, 0.2),
982+
ToolParameterDescriptor.create("minAllowableSingletRate", "Min Allowable Singlet Rate", "This is an optional threshold designed to automatically discard poorly performing callers. If a given algorithm returns a singlet rate below this level, it is discarded from the consensus.", "ldk-numberfield", new JSONObject(){{
983+
put("minValue", 0);
984+
put("maxValue", 1);
985+
put("decimalPrecision", 2);
986+
}}, 0.05),
982987
ToolParameterDescriptor.create("skipNormalizationQc", "Skip Normalization QC", null, "checkbox", null, true),
983988
ToolParameterDescriptor.create("doNotAllowResume", "Do Not Allow Resume", "If checked, on resume the job will repeat hashing scoring, rather than allowing resume from a saved state", "checkbox", null, false),
984989
ToolParameterDescriptor.create("doTSNE", "Do tSNE", "If true, tSNE will be performed as part of QC", "checkbox", null, false),
@@ -1275,6 +1280,7 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
12751280
", majorityConsensusThreshold = " + (parameters.majorityConsensusThreshold == null ? "NULL" : parameters.majorityConsensusThreshold) +
12761281
", callerDisagreementThreshold = " + (parameters.callerDisagreementThreshold == null ? "NULL" : parameters.callerDisagreementThreshold) +
12771282
(parameters.minAllowableDoubletRateFilter == null ? "" : ", minAllowableDoubletRateFilter = " + parameters.minAllowableDoubletRateFilter) +
1283+
(parameters.minAllowableSingletRate == null ? "" : ", minAllowableSingletRate = " + parameters.minAllowableSingletRate) +
12781284
", doTSNE = " + doTSNE + ")");
12791285
writer.println("print('Rmarkdown complete')");
12801286

0 commit comments

Comments
 (0)