Skip to content

Commit 1ba84f9

Browse files
committed
Merge discvr-24.3 to develop
2 parents 5799aee + 25c0ecd commit 1ba84f9

25 files changed

Lines changed: 532 additions & 109 deletions

File tree

SequenceAnalysis/resources/queries/sequenceanalysis/outputfiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function beforeInsert(row, errors){
1919
beforeUpsert(row, errors);
2020
}
2121

22-
function beforeUpdate(row, errors){
22+
function beforeUpdate(row, oldRow, errors){
2323
beforeUpsert(row, errors);
2424
}
2525

SequenceAnalysis/resources/web/SequenceAnalysis/panel/AlignmentImportPanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ Ext4.define('SequenceAnalysis.panel.AlignmentImportPanel', {
8686
helpPopup: 'Description for this run, such as detail about the source of the alignments (optional)',
8787
itemId: 'jobDescription',
8888
name: 'jobDescription',
89-
allowBlank: true
89+
allowBlank: true,
90+
value: LABKEY.ActionURL.getParameter('jobDescription')
9091
},{
9192
fieldLabel: 'Delete Intermediate Files',
9293
helpPopup: 'Check to delete the intermediate files created by this pipeline. In general these are not needed and it will save disk space. These files might be useful for debugging though.',

SequenceAnalysis/resources/web/SequenceAnalysis/panel/AnalysisSectionPanel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
570570
return [];
571571
},
572572

573-
applySavedValues: function(values){
573+
applySavedValues: function(values, allowUrlOverride){
574574
if (this.stepType){
575575
var tools = values[this.stepType] ? values[this.stepType].split(';') : [];
576576
this.setActiveTools(tools);
@@ -585,6 +585,10 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
585585
if (Ext4.isDefined(values[name])){
586586
p.setValue(values[name]);
587587
}
588+
589+
if (allowUrlOverride && LABKEY.ActionURL.getParameter(name)) {
590+
p.setValue(LABKEY.ActionURL.getParameter(name));
591+
}
588592
}, this);
589593
}
590594
},

SequenceAnalysis/resources/web/SequenceAnalysis/panel/BaseSequencePanel.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
269269
return;
270270
}
271271

272+
// If auto-loading, assume we want to read the URL
273+
thePanel.down('#readUrlParams').setValue(true);
274+
272275
var recIdx = store.find('name', LABKEY.ActionURL.getParameter('template'));
273276
if (recIdx > -1) {
274277
thePanel.down('labkey-combo').setValue(store.getAt(recIdx));
@@ -297,6 +300,12 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
297300
helpPopup: 'By default, the pipelines jobs and their outputs will be created in the workbook you selected. However, in certain cases, such as bulk submission of many jobs, it might be preferable to submit each job to the source folder/workbook for each input. Checking this box will enable this.',
298301
fieldLabel: 'Submit Jobs to Same Folder/Workbook as Readset',
299302
labelWidth: 200
303+
},{
304+
xtype: 'checkbox',
305+
itemId: 'readUrlParams',
306+
helpPopup: 'If true, any parameters provided on the URL with the same name as a parameter in the JSON will be read and override the template.',
307+
fieldLabel: 'Read Parameters From URL',
308+
labelWidth: 200
300309
}]
301310
}],
302311
buttons: [{
@@ -353,7 +362,8 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
353362
delete json.submitJobToReadsetContainer;
354363
}
355364

356-
win.sequencePanel.applySavedValues(json);
365+
var readUrlParams = win.down('#readUrlParams').getValue();
366+
win.sequencePanel.applySavedValues(json, readUrlParams);
357367

358368
var submitJobToReadsetContainer = win.sequencePanel.down('[name="submitJobToReadsetContainer"]');
359369
if (submitJobToReadsetContainer) {
@@ -386,7 +396,7 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
386396
}
387397
},
388398

389-
applySavedValues: function(values){
399+
applySavedValues: function(values, allowUrlOverride){
390400
//allows for subclasses to exclude this panel
391401
var alignPanel = this.down('sequenceanalysis-alignmentpanel');
392402
if (alignPanel) {
@@ -395,7 +405,7 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
395405

396406
var sections = this.query('sequenceanalysis-analysissectionpanel');
397407
Ext4.Array.forEach(sections, function(s){
398-
s.applySavedValues(values);
408+
s.applySavedValues(values, allowUrlOverride);
399409
}, this);
400410

401411
// For top-level properties:

SequenceAnalysis/resources/web/SequenceAnalysis/panel/SequenceAnalysisPanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ Ext4.define('SequenceAnalysis.panel.SequenceAnalysisPanel', {
300300
height: 100,
301301
helpPopup: 'Description for this analysis (optional)',
302302
name: 'jobDescription',
303-
allowBlank:true
303+
allowBlank: true,
304+
value: LABKEY.ActionURL.getParameter('jobDescription')
304305
},{
305306
fieldLabel: 'Delete Intermediate Files',
306307
helpPopup: 'Check to delete the intermediate files created by this pipeline. In general these are not needed and it will save disk space. These files might be useful for debugging though.',

SequenceAnalysis/resources/web/SequenceAnalysis/panel/VariantProcessingPanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Ext4.define('SequenceAnalysis.panel.VariantProcessingPanel', {
6161
height: 100,
6262
helpPopup: 'Description for this analysis (optional)',
6363
name: 'jobDescription',
64-
allowBlank:true
64+
allowBlank: true,
65+
value: LABKEY.ActionURL.getParameter('jobDescription')
6566
},{
6667
xtype: 'sequenceanalysis-variantscattergatherpanel',
6768
width: 620,

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
9797
action.addInput(so.getFile(), "Input BAM File");
9898

9999
File outputFile = new File(ctx.getOutputDir(), FileUtil.getBaseName(so.getFile()) + ".g.vcf.gz");
100+
File outputFileVcf = new File(ctx.getOutputDir(), FileUtil.getBaseName(so.getFile()) + ".vcf.gz");
100101

101102
DeepVariantAnalysis.DeepVariantWrapper wrapper = new DeepVariantAnalysis.DeepVariantWrapper(job.getLogger());
102103
wrapper.setOutputDir(ctx.getOutputDir());
@@ -123,7 +124,8 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
123124
throw new PipelineJobException("Missing binVersion");
124125
}
125126

126-
wrapper.execute(so.getFile(), referenceGenome.getWorkingFastaFile(), outputFile, ctx.getFileManager(), binVersion, args);
127+
boolean retainVcf = ctx.getParams().optBoolean("retainVcf", false);
128+
wrapper.execute(so.getFile(), referenceGenome.getWorkingFastaFile(), outputFile, retainVcf, ctx.getFileManager(), binVersion, args);
127129

128130
action.addOutput(outputFile, "gVCF File", false);
129131

@@ -137,6 +139,19 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
137139

138140
ctx.addSequenceOutput(o);
139141

142+
if (retainVcf)
143+
{
144+
SequenceOutputFile vcf = new SequenceOutputFile();
145+
vcf.setName(outputFileVcf.getName());
146+
vcf.setFile(outputFileVcf);
147+
vcf.setLibrary_id(so.getLibrary_id());
148+
vcf.setCategory("DeepVariant VCF File");
149+
vcf.setReadset(so.getReadset());
150+
vcf.setDescription("DeepVariant Version: " + binVersion);
151+
152+
ctx.addSequenceOutput(vcf);
153+
}
154+
140155
ctx.addActions(action);
141156
}
142157

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/ProcessVariantsHandler.java

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -369,15 +369,6 @@ public static List<Interval> getIntervals(JobContext ctx)
369369

370370
public static File processVCF(File input, Integer libraryId, JobContext ctx, Resumer resumer, boolean subsetToIntervals) throws PipelineJobException
371371
{
372-
try
373-
{
374-
SequenceAnalysisService.get().ensureVcfIndex(input, ctx.getLogger());
375-
}
376-
catch (IOException e)
377-
{
378-
throw new PipelineJobException(e);
379-
}
380-
381372
File currentVCF = input;
382373

383374
ctx.getJob().getLogger().info("***Starting processing of file: " + input.getName());
@@ -409,6 +400,15 @@ public static File processVCF(File input, Integer libraryId, JobContext ctx, Res
409400
}
410401
else
411402
{
403+
try
404+
{
405+
SequenceAnalysisService.get().ensureVcfIndex(input, ctx.getLogger());
406+
}
407+
catch (IOException e)
408+
{
409+
throw new PipelineJobException(e);
410+
}
411+
412412
OutputVariantsStartingInIntervalsStep.Wrapper wrapper = new OutputVariantsStartingInIntervalsStep.Wrapper(ctx.getLogger());
413413
wrapper.execute(input, outputFile, getIntervals(ctx));
414414
}
@@ -422,6 +422,7 @@ public static File processVCF(File input, Integer libraryId, JobContext ctx, Res
422422
for (PipelineStepCtx<VariantProcessingStep> stepCtx : providers)
423423
{
424424
ctx.getLogger().info("Starting to run: " + stepCtx.getProvider().getLabel());
425+
ctx.getLogger().debug("VCF: " + currentVCF);
425426
ctx.getJob().setStatus(PipelineJob.TaskStatus.running, "Running: " + stepCtx.getProvider().getLabel());
426427
stepIdx++;
427428

@@ -432,6 +433,15 @@ public static File processVCF(File input, Integer libraryId, JobContext ctx, Res
432433
continue;
433434
}
434435

436+
try
437+
{
438+
SequenceAnalysisService.get().ensureVcfIndex(currentVCF, ctx.getLogger());
439+
}
440+
catch (IOException e)
441+
{
442+
throw new PipelineJobException(e);
443+
}
444+
435445
RecordedAction action = new RecordedAction(stepCtx.getProvider().getLabel());
436446
Date start = new Date();
437447
action.setStartTime(start);
@@ -467,6 +477,7 @@ public static File processVCF(File input, Integer libraryId, JobContext ctx, Res
467477
{
468478
currentVCF = output.getVCF();
469479

480+
ctx.getJob().getLogger().info("output VCF: " + currentVCF.getPath());
470481
ctx.getJob().getLogger().info("total variants: " + getVCFLineCount(currentVCF, ctx.getJob().getLogger(), false, true));
471482
ctx.getJob().getLogger().info("passing variants: " + getVCFLineCount(currentVCF, ctx.getJob().getLogger(), true, false));
472483
ctx.getJob().getLogger().debug("index exists: " + (new File(currentVCF.getPath() + ".tbi")).exists());
@@ -767,6 +778,7 @@ protected String getJsonName()
767778

768779
public void setStepComplete(int stepIdx, String inputFilePath, RecordedAction action, File scatterOutput) throws PipelineJobException
769780
{
781+
getLogger().debug("Marking step complete with VCF: " + inputFilePath);
770782
_scatterOutputs.put(getKey(stepIdx, inputFilePath), scatterOutput);
771783
_recordedActions.add(action);
772784
saveState();

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/DeepVariantAnalysis.java

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public static List<ToolParameterDescriptor> getToolDescriptors()
7070
}}, "X,Y"),
7171
ToolParameterDescriptor.create("binVersion", "DeepVariant Version", "The version of DeepVariant to run, which is passed to their docker container", "textfield", new JSONObject(){{
7272
put("allowBlank", false);
73-
}}, "1.6.0")
73+
}}, "1.6.0"),
74+
ToolParameterDescriptor.create("retainVcf", "Retain VCF", "If selected, the VCF with called genotypes will be retained", "checkbox", null, false)
7475
);
7576
}
7677

@@ -153,9 +154,11 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
153154
throw new PipelineJobException("Missing binVersion");
154155
}
155156

157+
boolean retainVcf = getProvider().getParameterByName("retainVcf").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
158+
156159
getWrapper().setOutputDir(outputDir);
157160
getWrapper().setWorkingDir(outputDir);
158-
getWrapper().execute(inputBam, referenceGenome.getWorkingFastaFile(), outputFile, output, binVersion, args);
161+
getWrapper().execute(inputBam, referenceGenome.getWorkingFastaFile(), outputFile, retainVcf, output, binVersion, args);
159162

160163
output.addOutput(outputFile, "gVCF File");
161164
output.addSequenceOutput(outputFile, outputFile.getName(), "DeepVariant gVCF File", rs.getReadsetId(), null, referenceGenome.getGenomeId(), "DeepVariant Version: " + binVersion);
@@ -164,6 +167,17 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
164167
output.addOutput(idxFile, "VCF Index");
165168
}
166169

170+
if (retainVcf)
171+
{
172+
File outputFileVcf = new File(outputDir, FileUtil.getBaseName(inputBam) + ".vcf.gz");
173+
if (!outputFileVcf.exists())
174+
{
175+
throw new PipelineJobException("Missing expected file: " + outputFileVcf.getPath());
176+
}
177+
178+
output.addSequenceOutput(outputFile, outputFileVcf.getName(), "DeepVariant VCF File", rs.getReadsetId(), null, referenceGenome.getGenomeId(), "DeepVariant Version: " + binVersion);
179+
}
180+
167181
return output;
168182
}
169183

@@ -206,12 +220,15 @@ private File ensureLocalCopy(File input, File workingDirectory, PipelineOutputTr
206220
}
207221
}
208222

209-
public void execute(File inputBam, File refFasta, File outputGvcf, PipelineOutputTracker tracker, String binVersion, List<String> extraArgs) throws PipelineJobException
223+
public void execute(File inputBam, File refFasta, File outputGvcf, boolean retainVcf, PipelineOutputTracker tracker, String binVersion, List<String> extraArgs) throws PipelineJobException
210224
{
211225
File workDir = outputGvcf.getParentFile();
212226
File outputVcf = new File(outputGvcf.getPath().replaceAll(".g.vcf", ".vcf"));
213-
tracker.addIntermediateFile(outputVcf);
214-
tracker.addIntermediateFile(new File(outputVcf.getPath() + ".tbi"));
227+
if (!retainVcf)
228+
{
229+
tracker.addIntermediateFile(outputVcf);
230+
tracker.addIntermediateFile(new File(outputVcf.getPath() + ".tbi"));
231+
}
215232

216233
File inputBamLocal = ensureLocalCopy(inputBam, workDir, tracker);
217234
ensureLocalCopy(SequenceUtil.getExpectedIndex(inputBam), workDir, tracker);

jbrowse/package-lock.json

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)