Skip to content

Commit

Permalink
Support minAllowableSingletRate in cell hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Jan 18, 2025
1 parent 806a1fb commit 569af02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public static class CellHashingParameters
public Integer minCountPerCell = 5;
public Double majorityConsensusThreshold = null;
public Double minAllowableDoubletRateFilter = null;
public Double minAllowableSingletRate = null;
public Double callerDisagreementThreshold = null;
public List<CALLING_METHOD> methods = CALLING_METHOD.getDefaultConsensusMethods(); //Default to just executing the set used for default consensus calls, rather than additional ones
public List<CALLING_METHOD> consensusMethods = null;
Expand All @@ -127,6 +128,7 @@ public static CellHashingService.CellHashingParameters createFromStep(SequenceOu
ret.minCountPerCell = step.getProvider().getParameterByName("minCountPerCell").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Integer.class, 3);
ret.majorityConsensusThreshold = step.getProvider().getParameterByName("majorityConsensusThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
ret.minAllowableDoubletRateFilter = step.getProvider().getParameterByName("minAllowableDoubletRateFilter").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
ret.minAllowableSingletRate = step.getProvider().getParameterByName("minAllowableSingletRate").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
ret.callerDisagreementThreshold = step.getProvider().getParameterByName("callerDisagreementThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
ret.doTSNE = step.getProvider().getParameterByName("doTSNE").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
ret.doNotAllowResume = step.getProvider().getParameterByName("doNotAllowResume").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, false);
Expand Down Expand Up @@ -171,6 +173,7 @@ public static CellHashingParameters createFromJson(BARCODE_TYPE type, File webse
ret.minCountPerCell = params.optInt("minCountPerCell", 3);
ret.majorityConsensusThreshold = params.get("majorityConsensusThreshold") == null ? null : params.getDouble("majorityConsensusThreshold");
ret.minAllowableDoubletRateFilter = params.get("minAllowableDoubletRateFilter") == null ? null : params.getDouble("minAllowableDoubletRateFilter");
ret.minAllowableSingletRate = params.get("minAllowableSingletRate") == null ? null : params.getDouble("minAllowableSingletRate");
ret.callerDisagreementThreshold = params.get("callerDisagreementThreshold") == null ? null : params.getDouble("callerDisagreementThreshold");
ret.doTSNE = params.optBoolean("doTSNE", false);
ret.doNotAllowResume = params.optBoolean("doNotAllowResume", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,11 @@ public List<ToolParameterDescriptor> getHashingCallingParams(boolean allowMethod
put("maxValue", 1);
put("decimalPrecision", 2);
}}, 0.2),
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(){{
put("minValue", 0);
put("maxValue", 1);
put("decimalPrecision", 2);
}}, 0.05),
ToolParameterDescriptor.create("skipNormalizationQc", "Skip Normalization QC", null, "checkbox", null, true),
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),
ToolParameterDescriptor.create("doTSNE", "Do tSNE", "If true, tSNE will be performed as part of QC", "checkbox", null, false),
Expand Down Expand Up @@ -1275,6 +1280,7 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
", majorityConsensusThreshold = " + (parameters.majorityConsensusThreshold == null ? "NULL" : parameters.majorityConsensusThreshold) +
", callerDisagreementThreshold = " + (parameters.callerDisagreementThreshold == null ? "NULL" : parameters.callerDisagreementThreshold) +
(parameters.minAllowableDoubletRateFilter == null ? "" : ", minAllowableDoubletRateFilter = " + parameters.minAllowableDoubletRateFilter) +
(parameters.minAllowableSingletRate == null ? "" : ", minAllowableSingletRate = " + parameters.minAllowableSingletRate) +
", doTSNE = " + doTSNE + ")");
writer.println("print('Rmarkdown complete')");

Expand Down

0 comments on commit 569af02

Please sign in to comment.