Skip to content

Commit fb6ba5c

Browse files
committed
Support cellhashing parameter to skip tSNE
1 parent cf2774d commit fb6ba5c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
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
@@ -106,6 +106,7 @@ public static class CellHashingParameters
106106
public Integer cells = 0;
107107
public boolean keepMarkdown = false;
108108
public File h5File = null;
109+
public boolean doTSNE = true;
109110

110111
private CellHashingParameters()
111112
{
@@ -120,6 +121,7 @@ public static CellHashingService.CellHashingParameters createFromStep(SequenceOu
120121
ret.minCountPerCell = step.getProvider().getParameterByName("minCountPerCell").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Integer.class, 3);
121122
ret.majorityConsensusThreshold = step.getProvider().getParameterByName("majorityConsensusThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
122123
ret.callerDisagreementThreshold = step.getProvider().getParameterByName("callerDisagreementThreshold").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Double.class, null);
124+
ret.doTSNE = step.getProvider().getParameterByName("doTSNE").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, null);
123125
ret.retainRawCountFile = step.getProvider().getParameterByName("retainRawCountFile").extractValue(ctx.getJob(), step.getProvider(), step.getStepIdx(), Boolean.class, true);
124126
ret.htoReadset = htoReadset;
125127
ret.parentReadset = parentReadset;
@@ -160,6 +162,7 @@ public static CellHashingParameters createFromJson(BARCODE_TYPE type, File webse
160162
ret.minCountPerCell = params.optInt("minCountPerCell", 3);
161163
ret.majorityConsensusThreshold = params.get("majorityConsensusThreshold") == null ? null : params.getDouble("majorityConsensusThreshold");
162164
ret.callerDisagreementThreshold = params.get("callerDisagreementThreshold") == null ? null : params.getDouble("callerDisagreementThreshold");
165+
ret.doTSNE = params.get("doTSNE") == null ? true : params.getBoolean("doTSNE");
163166
ret.retainRawCountFile = params.optBoolean("retainRawCountFile", true);
164167
ret.htoReadset = htoReadset;
165168
ret.parentReadset = parentReadset;

singlecell/resources/views/singleCellDataManagement.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {schemaName: 'sequenceanalysis', queryName: 'sequence_readsets', 'query.totalForwardReads~isnonblank': null, 'query.isArchived~eq': 0})
6565
},{
6666
name: 'Analyses Using Old Readsets',
67-
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {schemaName: 'sequenceanalysis', queryName: 'sequence_analyses', 'query.readset/status~nonblank': null})
67+
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {schemaName: 'sequenceanalysis', queryName: 'sequence_analyses', 'query.readset/status~isnonblank': null})
6868
}]
6969
}]
7070
}]

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,11 @@ public List<ToolParameterDescriptor> getHashingCallingParams(boolean allowDemuxE
897897
put("decimalPrecision", 2);
898898
}}, 0.2),
899899
ToolParameterDescriptor.create("skipNormalizationQc", "Skip Normalization QC", null, "checkbox", null, true),
900+
ToolParameterDescriptor.create("doTSNE", "Do tSNE", "If true, tSNE will be performed as part of QC", "checkbox", null, true),
900901
ToolParameterDescriptor.create("retainRawCountFile", "Retain Raw Counts File", null, "checkbox", null, false)
901902
));
902903

903-
final List<String> allMethods = Arrays.stream(CALLING_METHOD.values()).filter(x -> allowDemuxEm || x != CALLING_METHOD.demuxem).map(Enum::name).collect(Collectors.toList());
904+
final List<String> allMethods = Arrays.stream(CALLING_METHOD.values()).filter(x -> allowDemuxEm || x != CALLING_METHOD.demuxem).map(Enum::name).toList();
904905
ret.add(ToolParameterDescriptor.create("methods", "Calling Methods", "The set of methods to use in calling.", "ldk-simplecombo", new JSONObject()
905906
{{
906907
put("multiSelect", true);
@@ -1188,9 +1189,10 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
11881189

11891190
String skipNormalizationQcString = parameters.skipNormalizationQc ? "TRUE" : "FALSE";
11901191
String keepMarkdown = parameters.keepMarkdown ? "TRUE" : "FALSE";
1192+
String doTSNE = parameters.doTSNE ? "TRUE" : "FALSE";
11911193
String h5String = h5 == null ? "" : ", h5File = '/work/" + h5.getName() + "'";
11921194
String consensusMethodString = consensusMethodNames.isEmpty() ? "" : ", methodsForConsensus = c('" + StringUtils.join(consensusMethodNames, "','") + "')";
1193-
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) + ")");
1195+
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 + ")");
11941196
writer.println("print('Rmarkdown complete')");
11951197

11961198
}

0 commit comments

Comments
 (0)