Skip to content

Commit ab83d0f

Browse files
committed
Merge discvr-25.3 to develop
2 parents b51fb88 + 15d613c commit ab83d0f

File tree

11 files changed

+75
-33
lines changed

11 files changed

+75
-33
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/LiftoverBcfToolsWrapper.java renamed to SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/run/LiftoverBcfToolsWrapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
package org.labkey.sequenceanalysis.run.util;
1+
package org.labkey.api.sequenceanalysis.run;
22

33
import org.apache.logging.log4j.Logger;
44
import org.jetbrains.annotations.Nullable;
55
import org.labkey.api.pipeline.PipelineJobException;
66
import org.labkey.api.sequenceanalysis.SequenceAnalysisService;
77
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
8-
import org.labkey.api.sequenceanalysis.run.PicardWrapper;
98

109
import java.io.File;
1110
import java.io.IOException;

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/AbstractCombineGeneCountsHandler.java

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,16 @@ private static List<ToolParameterDescriptor> getParams(boolean allowInferStrande
8181

8282
if (allowInferStranded)
8383
{
84-
ret.add(ToolParameterDescriptor.create(STRANDED, "Strand 1", "Choose whether to treat these data as stranded, unstranded, or to have the script infer the strandedness", "ldk-simplecombo", new JSONObject()
84+
ret.add(ToolParameterDescriptor.create(STRANDED, "Strandedness", "Choose whether to treat these data as stranded, unstranded, or to have the script infer the strandedness", "ldk-simplecombo", new JSONObject()
8585
{{
8686
put("storeValues", STRAND1 + ";" + STRAND2 + ";" + UNSTRANDED + ";" + INFER);
8787
put("value", INFER);
8888
}}, INFER));
89+
ret.add(ToolParameterDescriptor.create("strandedThreshold", "Strandedness Threshold", "If infer is selected, Choose whether to treat these data as stranded, unstranded, or to have the script infer the strandedness", "ldk-simplecombo", new JSONObject(){{
90+
put("minValue", 0);
91+
put("maxValue", 1);
92+
put("decimalPrecision", 2);
93+
}}, 0.9));
8994
}
9095

9196
return ret;
@@ -305,29 +310,20 @@ public void prepareFiles(JobContext ctx, List<SequenceOutputFile> inputFiles, St
305310
header.add(hp.getHeader(ctx, outputFileMap.get(rowId)));
306311
}
307312

308-
writer.writeNext(header.toArray(new String[header.size()]));
313+
writer.writeNext(header.toArray(new String[0]));
309314

310315
Set<String> genesWithoutData = new TreeSet<>();
311316
for (String geneId : results.distinctGenes)
312317
{
313318
List<String> row = new ArrayList<>(inputFiles.size() + 3);
314319
if (translator.getGeneMap().containsKey(geneId))
315320
{
316-
if (translator.getGeneMap().containsKey(geneId))
317-
{
318-
row.add(geneId);
319-
row.add(translator.getGeneMap().get(geneId).get("gene_name"));
320-
row.add(translator.getGeneMap().get(geneId).get("gene_description"));
321-
}
322-
else
323-
{
324-
row.add(geneId);
325-
row.add("");
326-
row.add("");
327-
}
321+
row.add(geneId);
322+
row.add(translator.getGeneMap().get(geneId).get("gene_name"));
323+
row.add(translator.getGeneMap().get(geneId).get("gene_description"));
328324

329325
List<String> toAdd = new ArrayList<>();
330-
Integer totalWithData = 0;
326+
int totalWithData = 0;
331327
for (Integer rowId : outputFileMap.keySet())
332328
{
333329
Double count = results.counts.get(rowId).get(geneId);
@@ -341,9 +337,9 @@ public void prepareFiles(JobContext ctx, List<SequenceOutputFile> inputFiles, St
341337

342338
if (totalWithData > 0 || !doSkipGenesWithoutData)
343339
{
344-
row.add(totalWithData.toString());
340+
row.add(String.valueOf(totalWithData));
345341
row.addAll(toAdd);
346-
writer.writeNext(row.toArray(new String[row.size()]));
342+
writer.writeNext(row.toArray(new String[0]));
347343
}
348344

349345
if (totalWithData == 0 && !OTHER_IDS.contains(geneId))

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/CombineStarGeneCountsHandler.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public CombineStarGeneCountsHandler()
3131
@Override
3232
protected void processOutputFiles(CountResults results, List<SequenceOutputFile> inputFiles, JSONObject params, GeneToNameTranslator translator, PipelineJob job, RecordedAction action) throws PipelineJobException
3333
{
34-
3534
String strandedSelection = params.optString(STRANDED, INFER);
3635

3736
//next iterate all read count TSVs to guess strandedness
@@ -69,12 +68,12 @@ protected void processOutputFiles(CountResults results, List<SequenceOutputFile>
6968
continue;
7069
}
7170

72-
Long unstranded = Long.parseLong(cells[1]);
73-
Long strand1 = Long.parseLong(cells[2]);
71+
long unstranded = Long.parseLong(cells[1]);
72+
long strand1 = Long.parseLong(cells[2]);
7473
totalStrand1 += strand1;
75-
Long strand2 = Long.parseLong(cells[3]);
74+
long strand2 = Long.parseLong(cells[3]);
7675
totalStrand2 += strand2;
77-
Long strandMax = Math.max(strand1, strand2);
76+
long strandMax = Math.max(strand1, strand2);
7877

7978
results.distinctGenes.add(geneId);
8079

@@ -103,9 +102,9 @@ protected void processOutputFiles(CountResults results, List<SequenceOutputFile>
103102
strand2Map = new HashMap<>(Math.max(results.distinctGenes.size() + 500, 5000));
104103
}
105104

106-
unstrandedMap.put(geneId, unstranded.doubleValue());
107-
strand1Map.put(geneId, strand1.doubleValue());
108-
strand2Map.put(geneId, strand2.doubleValue());
105+
unstrandedMap.put(geneId, (double)unstranded);
106+
strand1Map.put(geneId, (double)strand1);
107+
strand2Map.put(geneId, (double)strand2);
109108

110109
unstrandedCounts.put(so.getRowid(), unstrandedMap);
111110
strand1Counts.put(so.getRowid(), strand1Map);
@@ -125,8 +124,9 @@ protected void processOutputFiles(CountResults results, List<SequenceOutputFile>
125124

126125
//finally build output
127126
double avgStrandRatio = sumStrandRatio / countStrandRatio;
127+
double threshold = params.optDouble("strandedThreshold", 0.9);
128128
job.getLogger().info("the average stranded/unstranded ratio for all samples was: " + avgStrandRatio);
129-
double threshold = 0.9;
129+
130130
String inferredStrandedness;
131131
job.getLogger().info("Attempting to infer strandedness");
132132
if (avgStrandRatio > threshold)

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/LiftoverHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.labkey.api.writer.PrintWriters;
3838
import org.labkey.sequenceanalysis.SequenceAnalysisModule;
3939
import org.labkey.sequenceanalysis.pipeline.ProcessVariantsHandler;
40-
import org.labkey.sequenceanalysis.run.util.LiftoverBcfToolsWrapper;
40+
import org.labkey.api.sequenceanalysis.run.LiftoverBcfToolsWrapper;
4141
import org.labkey.sequenceanalysis.run.util.LiftoverVcfWrapper;
4242
import org.labkey.sequenceanalysis.util.SequenceUtil;
4343

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant/VariantAnnotatorStep.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public Provider()
5555
ToolParameterDescriptor.create("excessHet", "ExcessHet", "If selected, the ExcessHet annotation will run.", "checkbox", new JSONObject(){{
5656
put("checked", false);
5757
}}, null),
58+
ToolParameterDescriptor.create("svtype", "SVType", "If selected, the SVType annotation will run.", "checkbox", new JSONObject(){{
59+
put("checked", false);
60+
}}, null),
5861
new PedigreeToolParameterDescriptor()
5962
), PageFlowUtil.set(PedigreeToolParameterDescriptor.getClientDependencyPath()), "");
6063
}
@@ -119,6 +122,12 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
119122
options.add("ExcessHet");
120123
}
121124

125+
if (getProvider().getParameterByName("svtype").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false))
126+
{
127+
options.add("-A");
128+
options.add("SVType");
129+
}
130+
122131
if (intervals != null)
123132
{
124133
intervals.forEach(interval -> {

singlecell/resources/web/singlecell/panel/PoolImportPanel.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ Ext4.define('SingleCell.panel.PoolImportPanel', {
182182
val = val.replace(/ PBMC/, '');
183183
}
184184

185+
if (val.indexOf('=') > -1) {
186+
const split = val.split('=')
187+
if (split.length === 2) {
188+
val = split[1]
189+
}
190+
}
191+
185192
return val;
186193
},
187194

singlecell/src/org/labkey/singlecell/pipeline/singlecell/CalculateGeneComponentScores.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Provider()
2525
super("CalculateGeneComponentScores", "Calculate Gene Module Scores", "RIRA", "This will generate UCell scores for a set of pre-defined gene modules", Collections.singletonList(
2626
SeuratToolParameter.create("savedComponent", "Saved Component(s)", "This is the name of the saved component (from RIRA) to apply", "ldk-simplecombo", new JSONObject()
2727
{{
28-
put("storeValues", "Tcell_NaiveToEffector;Tcell_EffectorDifferentiation");
28+
put("storeValues", "Tcell_EffectorDifferentiation;TCR_EarlyStimulationComponent;TCR_StimulationComponent1");
2929
put("multiSelect", true);
3030
put("allowBlank", false);
3131
put("joinReturnValue", true);

singlecell/src/org/labkey/singlecell/pipeline/singlecell/UpdateSeuratPrototype.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ public Output execute(SequenceOutputHandler.JobContext ctx, List<SeuratObjectWra
140140
toReplace.delete();
141141
}
142142

143-
FileUtils.moveFile(wrapper.getFile(), toReplace);
143+
FileUtils.copyFile(wrapper.getFile(), toReplace);
144+
ctx.getFileManager().addIntermediateFile(wrapper.getFile());
144145

145146
// Also metadata:
146147
File meta = CellHashingServiceImpl.get().getMetaTableFromSeurat(wrapper.getFile());
@@ -149,7 +150,8 @@ public Output execute(SequenceOutputHandler.JobContext ctx, List<SeuratObjectWra
149150
{
150151
metaOrig.delete();
151152
}
152-
FileUtils.moveFile(meta, metaOrig);
153+
FileUtils.copyFile(meta, metaOrig);
154+
ctx.getFileManager().addIntermediateFile(meta);
153155

154156
// Also cellbarcodes:
155157
File cellbarcodes = CellHashingServiceImpl.get().getCellBarcodesFromSeurat(wrapper.getFile());
@@ -158,7 +160,8 @@ public Output execute(SequenceOutputHandler.JobContext ctx, List<SeuratObjectWra
158160
{
159161
cellbarcodesOrig.delete();
160162
}
161-
FileUtils.moveFile(cellbarcodes, cellbarcodesOrig);
163+
FileUtils.copyFile(cellbarcodes, cellbarcodesOrig);
164+
ctx.getFileManager().addIntermediateFile(cellbarcodes);
162165
}
163166
catch (IOException e)
164167
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public AlignmentOutput performAlignment(Readset rs, List<File> inputFastqs1, @Nu
8787
}
8888
}
8989

90+
NimbleHelper.write10xBarcodes(localBam, getWrapper().getLogger(), rs, referenceGenome, output);
91+
9092
// Now run nimble itself:
9193
NimbleHelper helper = new NimbleHelper(getPipelineCtx(), getProvider(), getStepIdx());
9294
helper.doNimbleAlign(localBam, output, rs, basename);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
5858
NimbleHelper helper = new NimbleHelper(getPipelineCtx(), getProvider(), getStepIdx());
5959
helper.doNimbleAlign(inputBam, output, rs, FileUtil.getBaseName(inputBam));
6060

61+
NimbleHelper.write10xBarcodes(inputBam, getPipelineCtx().getLogger(), rs, referenceGenome, output);
62+
6163
return output;
6264
}
6365

0 commit comments

Comments
 (0)