Skip to content

Commit 7a9cea3

Browse files
authored
Merge pull request #95 from LabKey/fb_merge_discvr-20.11
Merge discvr-20.11 to develop
2 parents 11ce50f + 854edbe commit 7a9cea3

29 files changed

+372
-72
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,12 @@ jobs:
2020
# NOTE: permissions are limited on the default secrets.GITHUB_TOKEN, including updating workflows, so use a personal access token
2121
github_token: ${{ secrets.PAT }}
2222

23+
- name: Publish Release
24+
25+
uses: "marvinpinto/action-automatic-releases@latest"
26+
with:
27+
repo_token: "${{ secrets.PAT }}"
28+
prerelease: true
29+
title: "Release "
30+
files: |
31+
/home/runner/work/_temp/_github_home/lkDist/discvr/DISCVR-*

.github/workflows/build_latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ jobs:
4040
repo_token: "${{ secrets.PAT }}"
4141
automatic_release_tag: "latest"
4242
prerelease: true
43-
title: "DISCVR Development Build: ${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}"
43+
title: "Development Build: ${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}"
4444
files: /home/runner/work/_temp/_github_home/lkDist/discvr/DISCVR-*

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ name: Publish Release
22
on:
33
release:
44
types: [created]
5-
tags-ignore:
6-
- 'latest'
75
jobs:
86
generate:
97
name: Create release-artifacts
108
# See: https://help.github.com/en/actions/reference/contexts-and-expression-syntax-for-github-actions#github-context
119
# https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
12-
if: github.repository == 'BimberLab/DiscvrLabKeyModules'
10+
# Note: 'latest' is a tag created by branch_latest.yml, which is the latest development build. This should not trigger normal releases.
11+
if: github.repository == 'BimberLab/DiscvrLabKeyModules' && github.ref != 'refs/tags/latest'
1312
runs-on: ubuntu-latest
1413
steps:
1514
- name: "Build DISCVR"

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/pipeline/SequenceOutputHandler.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ default boolean requiresSingleGenome()
7575
return true;
7676
}
7777

78+
/**
79+
* @return Whether this handler requires each input to be associated with a genome
80+
*/
81+
default boolean requiresGenome()
82+
{
83+
return true;
84+
}
85+
7886
public boolean canProcess(SequenceOutputFile o);
7987

8088
/**

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/pipeline/VariantProcessingStep.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ default void init(PipelineJob job, SequenceAnalysisJobSupport support, List<Sequ
3838

3939
}
4040

41+
enum ScatterGatherMethod
42+
{
43+
none(),
44+
contig(),
45+
chunked(),
46+
fixedJobs()
47+
}
48+
4149
public static interface Output extends PipelineStepOutput
4250
{
4351
public File getVCF();
@@ -50,7 +58,10 @@ public static interface RequiresPedigree
5058

5159
public static interface SupportsScatterGather
5260
{
61+
default void validateScatter(ScatterGatherMethod method, PipelineJob job) throws IllegalArgumentException
62+
{
5363

64+
}
5465
}
5566

5667
public static interface MayRequirePrepareTask

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ Ext4.define('SequenceAnalysis.panel.SequenceAnalysisPanel', {
255255
version: 2
256256
};
257257

258-
//first add the general params
259-
Ext4.apply(json, this.down('#runInformation').getForm().getFieldValues());
258+
//first add the general params. Note: include all to ensure we include unchecked checkboxes. Using useDataValues=false to ensure we get the string-serialized value
259+
Ext4.apply(json, this.down('#runInformation').getForm().getValues(false, false, false, false));
260260

261261
json['alignment.doAlignment'] = this.down('#doAlignment').getValue();
262262

@@ -305,13 +305,15 @@ Ext4.define('SequenceAnalysis.panel.SequenceAnalysisPanel', {
305305
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.',
306306
name: 'deleteIntermediateFiles',
307307
inputValue: true,
308+
uncheckedValue: false,
308309
checked: true,
309310
xtype: 'checkbox'
310311
},{
311312
fieldLabel: 'Copy Inputs To Working Directory?',
312313
helpPopup: 'Check to copy the input files to the working directory. Depending on your environment, this may or may not help performance.',
313314
name: 'copyInputsLocally',
314315
inputValue: true,
316+
uncheckedValue: false,
315317
checked: false,
316318
xtype: 'checkbox'
317319
}, this.getSaveTemplateCfg(),{
@@ -320,6 +322,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceAnalysisPanel', {
320322
hidden: !LABKEY.Security.currentUser.isAdmin,
321323
name: 'submitJobToReadsetContainer',
322324
inputValue: true,
325+
uncheckedValue: false,
323326
checked: false,
324327
xtype: 'checkbox'
325328
}]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,11 @@ Ext4.define('SequenceAnalysis.panel.VariantProcessingPanel', {
407407
return;
408408
}
409409

410-
Ext4.Msg.wait('Submitting...');
411410
var json = {
412411
handlerClass: 'org.labkey.sequenceanalysis.' + (this.showGenotypeGVCFs ? 'analysis.GenotypeGVCFHandler' : 'pipeline.ProcessVariantsHandler'),
413412
outputFileIds: this.outputFileIds,
414413
params: Ext4.encode(values)
415-
}
414+
};
416415

417416
if (Ext4.isDefined(values.doSplitJobs)) {
418417
json.doSplitJobs = !!values.doSplitJobs;
@@ -441,6 +440,7 @@ Ext4.define('SequenceAnalysis.panel.VariantProcessingPanel', {
441440
}
442441
}
443442

443+
Ext4.Msg.wait('Submitting...');
444444
LABKEY.Ajax.request({
445445
url: LABKEY.ActionURL.buildURL('sequenceanalysis', actionName),
446446
jsonData: json,
@@ -465,8 +465,8 @@ Ext4.define('SequenceAnalysis.panel.VariantProcessingPanel', {
465465
version: 2
466466
};
467467

468-
//first add the general params
469-
Ext4.apply(json, this.down('#runInformation').getForm().getFieldValues());
468+
//first add the general params. Note: include all to ensure we include unchecked checkboxes. Using useDataValues=false to ensure we get the string-serialized value
469+
Ext4.apply(json, this.down('#runInformation').getForm().getValues(false, false, false, false));
470470

471471
//then append each section
472472
var sections = this.query('sequenceanalysis-analysissectionpanel');

SequenceAnalysis/resources/web/SequenceAnalysis/panel/VariantScatterGatherPanel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Ext4.define('SequenceAnalysis.panel.VariantScatterGatherPanel', {
6161
name: 'scatterGather.allowSplitChromosomes',
6262
fieldLabel: 'Allow Split Contigs',
6363
value: true,
64+
uncheckedValue: false,
6465
inputValue: true,
6566
helpPopup: 'If true, a given chromosome/contig can be split between jobs. Otherwise chromosomes are always intact across jobs.'
6667
});

SequenceAnalysis/resources/web/SequenceAnalysis/window/OutputHandlerWindow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Ext4.define('SequenceAnalysis.window.OutputHandlerWindow', {
250250
return;
251251
}
252252

253-
//Note: include all to ensure we include unchecked checkboxes
253+
//Note: include all to ensure we include unchecked checkboxes. Using useDataValues=false to ensure we get the string-serialized value
254254
var params = this.down('form').getForm().getValues(false, false, false, false);
255255
var json = {
256256
handlerType: this.handlerType,

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputHandler;
115115
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
116116
import org.labkey.api.sequenceanalysis.pipeline.ToolParameterDescriptor;
117+
import org.labkey.api.sequenceanalysis.pipeline.VariantProcessingStep;
117118
import org.labkey.api.util.ExceptionUtil;
118119
import org.labkey.api.util.FileType;
119120
import org.labkey.api.util.FileUtil;
@@ -162,7 +163,6 @@
162163
import org.labkey.sequenceanalysis.run.util.FastqcRunner;
163164
import org.labkey.sequenceanalysis.util.ChainFileValidator;
164165
import org.labkey.sequenceanalysis.util.FastqUtils;
165-
import org.labkey.sequenceanalysis.util.ScatterGatherUtils;
166166
import org.labkey.sequenceanalysis.util.SequenceUtil;
167167
import org.labkey.sequenceanalysis.visualization.VariationChart;
168168
import org.springframework.beans.PropertyValues;
@@ -4053,13 +4053,37 @@ public ApiResponse execute(RunSequenceHandlerForm form, BindException errors) th
40534053
errors.reject(ERROR_MSG, "Unable to parse JSON params: " + e.getMessage());
40544054
return null;
40554055
}
4056+
catch (IllegalArgumentException e)
4057+
{
4058+
errors.reject(ERROR_MSG, e.getMessage());
4059+
return null;
4060+
}
40564061
}
40574062

40584063
protected PipelineJob createOutputJob(RunSequenceHandlerForm form, Container targetContainer, String jobName, PipeRoot pr1, SequenceOutputHandler handler, List<SequenceOutputFile> inputs, JSONObject json) throws IOException, PipelineJobException
40594064
{
4065+
validateGenomes(inputs, handler);
40604066
return new SequenceOutputHandlerJob(targetContainer, getUser(), jobName, pr1, handler, inputs, json);
40614067
}
40624068

4069+
protected void validateGenomes(List<SequenceOutputFile> inputs, SequenceOutputHandler<?> handler) throws IllegalArgumentException
4070+
{
4071+
Set<Integer> genomes = new HashSet<>();
4072+
inputs.forEach(x -> {
4073+
if (x.getLibrary_id() == null && (handler.requiresGenome() || handler.requiresSingleGenome()))
4074+
{
4075+
throw new IllegalArgumentException("Input missing genome: " + x.getRowid());
4076+
}
4077+
4078+
genomes.add(x.getLibrary_id());
4079+
});
4080+
4081+
if (genomes.size() > 1 && handler.requiresSingleGenome())
4082+
{
4083+
throw new IllegalArgumentException("All inputs must use the same base genome");
4084+
}
4085+
}
4086+
40634087
private PipeRoot getPipeRoot(Container targetContainer, Map<Container, PipeRoot> containerToPipeRootMap)
40644088
{
40654089
if (!containerToPipeRootMap.containsKey(targetContainer))
@@ -4078,12 +4102,14 @@ private PipeRoot getPipeRoot(Container targetContainer, Map<Container, PipeRoot>
40784102
@RequiresPermission(InsertPermission.class)
40794103
public class RunVariantProcessingAction extends RunSequenceHandlerAction
40804104
{
4105+
@Override
40814106
protected PipelineJob createOutputJob(RunSequenceHandlerForm form, Container targetContainer, String jobName, PipeRoot pr1, SequenceOutputHandler handler, List<SequenceOutputFile> inputs, JSONObject json) throws PipelineJobException, IOException
40824107
{
40834108
String method = json.getString("scatterGatherMethod");
40844109
try
40854110
{
4086-
ScatterGatherUtils.ScatterGatherMethod scatterMethod = ScatterGatherUtils.ScatterGatherMethod.valueOf(method);
4111+
validateGenomes(inputs, handler);
4112+
VariantProcessingStep.ScatterGatherMethod scatterMethod = VariantProcessingStep.ScatterGatherMethod.valueOf(method);
40874113

40884114
return new VariantProcessingJob(targetContainer, getUser(), jobName, pr1, handler, inputs, json, scatterMethod);
40894115
}

0 commit comments

Comments
 (0)