Skip to content

Commit 4cf4f57

Browse files
authored
Merge pull request #283 from BimberLab/24.3_fb_merge
Merge discvr-23.11 to discvr-24.3
2 parents b32d6ea + 5683143 commit 4cf4f57

File tree

15 files changed

+462
-39
lines changed

15 files changed

+462
-39
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/run/AbstractCommandWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ protected boolean isThrowNonZeroExits()
289289
return _throwNonZeroExits;
290290
}
291291

292-
protected static File resolveFileInPath(String exe, @Nullable String packageName, boolean throwIfNotFound)
292+
public static File resolveFileInPath(String exe, @Nullable String packageName, boolean throwIfNotFound)
293293
{
294294
File fn;
295295
String path;

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/run/AbstractGatk4Wrapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public List<String> getBaseArgs(@Nullable String toolName)
9090
List<String> args = new ArrayList<>();
9191
args.add(SequencePipelineService.get().getJavaFilepath());
9292
args.addAll(SequencePipelineService.get().getJavaOpts(_maxRamOverride));
93+
args.add("-DGATK_STACKTRACE_ON_USER_EXCEPTION=true");
9394
args.add("-jar");
9495
args.add(getJAR().getPath());
9596

@@ -98,6 +99,8 @@ public List<String> getBaseArgs(@Nullable String toolName)
9899
args.add(toolName);
99100
}
100101

102+
103+
101104
return args;
102105
}
103106

SequenceAnalysis/pipeline_code/sequence_tools_install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ then
486486
rm -Rf bcftools*
487487
rm -Rf $LKTOOLS_DIR/bcftools
488488

489-
wget $WGET_OPTS https://github.com/samtools/bcftools/releases/download/1.18/bcftools-1.18.tar.bz2
490-
tar xjvf bcftools-1.18.tar.bz2
491-
chmod 755 bcftools-1.18
492-
cd bcftools-1.18
489+
wget $WGET_OPTS https://github.com/samtools/bcftools/releases/download/1.20/bcftools-1.20.tar.bz2
490+
tar xjvf bcftools-1.20.tar.bz2
491+
chmod 755 bcftools-1.20
492+
cd bcftools-1.20
493493
rm -f plugins/liftover.c
494494
wget $WGET_OPTS -P plugins https://raw.githubusercontent.com/freeseek/score/master/liftover.c
495495

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
2+
<columns>
3+
<!--<column name="rowid" />-->
4+
<column name="genomeId1" />
5+
<column name="genomeId2" />
6+
<column name="source" />
7+
<column name="version" />
8+
<column name="datedisabled" />
9+
<column name="chainFile" />
10+
</columns>
11+
<sorts>
12+
<sort column="genomeId1/name"/>
13+
<sort column="genomeId2/name"/>
14+
<sort column="version"/>
15+
</sorts>
16+
</customView>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
2+
<columns>
3+
<!--<column name="rowid" />-->
4+
<column name="genomeId1" />
5+
<column name="genomeId2" />
6+
<column name="source" />
7+
<column name="version" />
8+
<column name="dateDisabled" />
9+
<column name="chainFile" />
10+
<column name="chainFile/DataFileUrl" />
11+
</columns>
12+
<sorts>
13+
<sort column="genomeId1/name"/>
14+
<sort column="genomeId2/name"/>
15+
<sort column="version"/>
16+
</sorts>
17+
</customView>

SequenceAnalysis/resources/web/SequenceAnalysis/window/LiftoverWindow.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ Ext4.define('SequenceAnalysis.window.LiftoverWindow', {
117117
itemId: 'useBcfTools',
118118
checked: false,
119119
fieldLabel: 'Use bcftools'
120+
},{
121+
xtype: 'checkbox',
122+
itemId: 'doNotRetainUnmapped',
123+
checked: false,
124+
fieldLabel: 'Do Not Retain Unmapped'
120125
}].concat(SequenceAnalysis.window.OutputHandlerWindow.getCfgForToolParameters(this.toolParameters)),
121126
buttons: [{
122127
text: 'Submit',
@@ -157,6 +162,14 @@ Ext4.define('SequenceAnalysis.window.LiftoverWindow', {
157162
params.dropGenotypes = this.down('#dropGenotypes').getValue();
158163
}
159164

165+
if (this.down('#useBcfTools').getValue()){
166+
params.useBcfTools = this.down('#useBcfTools').getValue();
167+
}
168+
169+
if (this.down('#doNotRetainUnmapped').getValue()){
170+
params.doNotRetainUnmapped = this.down('#doNotRetainUnmapped').getValue();
171+
}
172+
160173
Ext4.Msg.wait('Saving...');
161174
LABKEY.Ajax.request({
162175
url: LABKEY.ActionURL.buildURL('sequenceanalysis', 'runSequenceHandler', this.containerPath),

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.labkey.sequenceanalysis.analysis.RnaSeqcHandler;
6060
import org.labkey.sequenceanalysis.analysis.SbtGeneCountHandler;
6161
import org.labkey.sequenceanalysis.analysis.UnmappedSequenceBasedGenotypeHandler;
62+
import org.labkey.sequenceanalysis.analysis.UpdateReadsetFilesHandler;
6263
import org.labkey.sequenceanalysis.button.AddSraRunButton;
6364
import org.labkey.sequenceanalysis.button.ArchiveReadsetsButton;
6465
import org.labkey.sequenceanalysis.button.ChangeReadsetStatusButton;
@@ -338,6 +339,7 @@ public static void registerPipelineSteps()
338339
SequenceAnalysisService.get().registerFileHandler(new DeepVariantHandler());
339340
SequenceAnalysisService.get().registerFileHandler(new GLNexusHandler());
340341
SequenceAnalysisService.get().registerFileHandler(new ParagraphStep());
342+
SequenceAnalysisService.get().registerFileHandler(new UpdateReadsetFilesHandler());
341343

342344
SequenceAnalysisService.get().registerReadsetHandler(new MultiQCHandler());
343345
SequenceAnalysisService.get().registerReadsetHandler(new RestoreSraDataHandler());

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.labkey.api.sequenceanalysis.pipeline.ReferenceGenome;
2929
import org.labkey.api.sequenceanalysis.pipeline.SequenceAnalysisJobSupport;
3030
import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputHandler;
31+
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
3132
import org.labkey.api.sequenceanalysis.pipeline.VariantProcessingStep;
3233
import org.labkey.api.sequenceanalysis.run.SelectVariantsWrapper;
3334
import org.labkey.api.util.FileType;
@@ -176,6 +177,7 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
176177

177178
boolean dropGenotypes = params.optBoolean("dropGenotypes", false);
178179
boolean useBcfTools = params.optBoolean("useBcfTools", false);
180+
boolean doNotRetainUnmapped = params.optBoolean("doNotRetainUnmapped", false);
179181

180182
int chainFileId = params.getInt("chainFileId");
181183
File chainFile = ctx.getSequenceSupport().getCachedData(chainFileId);
@@ -214,7 +216,7 @@ else if (_vcfFileType.isType(f.getFile()))
214216
}
215217

216218
File lifted = new File(outDir, baseName + ".lifted-" + targetGenomeId + ext);
217-
File unmappedOutput = new File(outDir, baseName + ".unmapped-" + targetGenomeId + ext);
219+
File unmappedOutput = doNotRetainUnmapped ? null : new File(outDir, baseName + ".unmapped-" + targetGenomeId + ext);
218220

219221
try
220222
{
@@ -260,7 +262,11 @@ else if (_vcfFileType.isType(f.getFile()))
260262
ctx.addSequenceOutput(so1);
261263
}
262264

263-
if (!unmappedOutput.exists())
265+
if (unmappedOutput == null)
266+
{
267+
// skip
268+
}
269+
else if (!unmappedOutput.exists())
264270
{
265271
job.getLogger().info("no unmapped intervals");
266272
}
@@ -328,6 +334,8 @@ public void liftOverVcf(JobContext ctx, ReferenceGenome targetGenome, ReferenceG
328334
{
329335
LiftoverBcfToolsWrapper wrapper = new LiftoverBcfToolsWrapper(job.getLogger());
330336
wrapper.doLiftover(currentVCF, chain, sourceGenome.getWorkingFastaFile(), targetGenome.getWorkingFastaFile(), unmappedOutput, output);
337+
338+
SequencePipelineService.get().sortVcf(output, null, targetGenome.getSequenceDictionary(), ctx.getLogger());
331339
}
332340
else
333341
{

0 commit comments

Comments
 (0)