Skip to content

Commit 0b33547

Browse files
authored
Merge pull request #1 from BimberLab/discvr-21.3
Updating branch from BimberLab repo
2 parents 7d43ec3 + c2fe35c commit 0b33547

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+845
-122
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- !latest
6+
- "*"
7+
tags-ignore:
8+
- latest
79
pull_request:
810
jobs:
911
build-modules:
@@ -12,20 +14,42 @@ jobs:
1214
if: github.repository == 'BimberLab/DiscvrLabKeyModules'
1315
runs-on: ubuntu-latest
1416
steps:
17+
- name: "Find default branch"
18+
uses: octokit/request-action@v2.x
19+
id: get_default_branch
20+
with:
21+
route: GET /repos/${{ github.repository }}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.PAT }}
24+
25+
- name: "Print default branch"
26+
run: |
27+
echo 'Default branch: ${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}'
28+
echo "##[set-output name=branch;]$(echo '${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}')"
29+
id: default-branch
30+
31+
- name: Extract branch name
32+
shell: bash
33+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
34+
id: extract-branch
35+
1536
- name: "Build DISCVR"
1637
uses: bimberlabinternal/DevOps/githubActions/discvr-build@master
1738
with:
1839
artifactory_user: ${{secrets.artifactory_user}}
1940
artifactory_password: ${{secrets.artifactory_password}}
2041
# NOTE: permissions are limited on the default secrets.GITHUB_TOKEN, including updating workflows, so use a personal access token
2142
github_token: ${{ secrets.PAT }}
43+
env:
44+
# Only generate the distribution if this is the default branch
45+
GENERATE_DIST: ${{ steps.default-branch.branch == steps.extract-branch.branch && '1' || '0' }}
2246

2347
- name: Publish Release
24-
48+
if: github.ref == '/refs/heads/${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}'
2549
uses: "marvinpinto/action-automatic-releases@latest"
2650
with:
2751
repo_token: "${{ secrets.PAT }}"
52+
automatic_release_tag: "latest"
2853
prerelease: true
29-
title: "Release "
30-
files: |
31-
/home/runner/work/_temp/_github_home/lkDist/discvr/DISCVR-*
54+
title: "Development Build: ${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}"
55+
files: /home/runner/work/_temp/_github_home/lkDist/discvr/DISCVR-*

SequenceAnalysis/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,20 @@ if (project.findProject(BuildUtils.getTestProjectPath(project.gradle)) != null &
6767
dependsOn(createPipelineConfigTask)
6868
}
6969
}
70+
71+
project.task("copyJars",
72+
type: Copy,
73+
group: "Build",
74+
description: "Copy commons-math3 JAR to module's lib directory",
75+
{ CopySpec copy ->
76+
copy.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
77+
copy.from(project.configurations.external)
78+
copy.into new File("${project.labkey.explodedModuleLibDir}")
79+
copy.include {
80+
"**commons-math3-**.jar"
81+
}
82+
}
83+
)
84+
85+
project.tasks.module.dependsOn(project.tasks.copyJars)
86+
project.tasks.copyJars.mustRunAfter(project.tasks.processModuleResources)

SequenceAnalysis/resources/queries/sequenceanalysis/quality_metrics_analyses_pivoted.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ select
55
max(category) as category,
66
count(*) as records,
77
metricName,
8-
avg(metricValue) as metricValue
8+
avg(metricValue) as metricValue,
9+
group_concat(distinct qualValue, chr(10)) as qualValue
910

1011
from sequenceanalysis.quality_metrics q
1112
where (category is null or category not in ('FIRST_OF_PAIR', 'SECOND_OF_PAIR'))
1213
group by analysis_id, metricName
13-
pivot metricValue by metricName
14+
pivot metricValue, qualValue by metricName

SequenceAnalysis/resources/queries/sequenceanalysis/quality_metrics_pivoted.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ select
66
max(category) as category,
77
count(*) as records,
88
metricName,
9-
avg(metricValue) as metricValue
9+
avg(metricValue) as metricValue,
10+
group_concat(distinct qualValue, chr(10)) as qualValue
1011

1112
from sequenceanalysis.quality_metrics q
1213
where (category is null or category not in ('FIRST_OF_PAIR', 'SECOND_OF_PAIR'))
1314
group by dataId, metricName
14-
pivot metricValue by metricName
15+
pivot metricValue, qualValue by metricName

SequenceAnalysis/resources/queries/sequenceanalysis/ref_aa_sequences.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function beforeUpsert(row, errors) {
2828

2929
if (row.name){
3030
//trim name
31-
row.name = row.name.replace(/^\s+|\s+$/g, '')
31+
row.name = row.name.replace(/^\s+|\s+$/g, '');
3232

3333
//enforce no pipe character in name
3434
if (row.name.match(/\|/)){
@@ -47,7 +47,7 @@ function beforeUpsert(row, errors) {
4747
exonArray = row.exons.split(';');
4848
for (var i = 0;i<exonArray.length; i++) {
4949
var exon = exonArray[i].split('-');
50-
if (exon.length != 2 || isNaN(exon[0]) || isNaN(exon[1])){
50+
if (exon.length !== 2 || isNaN(exon[0]) || isNaN(exon[1])){
5151
addError(errors, 'exons', 'Improper exons: ' + row.exons);
5252
return;
5353
}
@@ -59,25 +59,25 @@ function beforeUpsert(row, errors) {
5959
}
6060

6161
//infer from coordinates:
62-
if (row.ref_nt_id && exonArray.length){
62+
if (!row.sequence && row.ref_nt_id && exonArray.length){
6363
row.isComplement = !!row.isComplement;
6464
var sequence = triggerHelper.extractAASequence(row.ref_nt_id, exonArray, row.isComplement);
65-
if (sequence && lengthFromExons != sequence.length){
65+
if (sequence && lengthFromExons !== sequence.length){
6666
addError(errors, 'sequence', 'The length of the sequence (' + sequence.length + ') does not match the exon boundaries (' + lengthFromExons + ')');
6767
return;
6868
}
6969

7070
row.sequence = sequence;
7171
}
7272

73-
if (row.exons && row.sequence && lengthFromExons != row.sequence.length){
73+
if (row.exons && row.sequence && lengthFromExons !== row.sequence.length){
7474
addError(errors, 'sequence', 'The length of the sequence (' + row.sequence.length + ') does not match the exon boundaries (' + lengthFromExons + ')');
7575
}
7676

7777
if (row.exons && row.exons.length){
7878
var exonArray = row.exons.split(';');
7979
var coordinates = exonArray[0].split('-');
80-
if(coordinates.length == 2)
80+
if(coordinates.length === 2)
8181
row.start_location = coordinates[0];
8282
}
8383
}

SequenceAnalysis/resources/web/SequenceAnalysis/field/TrimmingTextArea.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ Ext4.define('SequenceAnalysis.field.TrimmingTextArea', {
1919
this.callParent();
2020
},
2121

22+
getErrors: function(value){
23+
var errors = this.callParent(arguments);
24+
25+
if (!this.allowBlank && Ext4.isEmpty(this.getSubmitValue())) {
26+
errors = errors.concat('Must enter a value');
27+
}
28+
29+
return errors;
30+
},
31+
2232
setValue: function(val){
2333
if (Ext4.isString(val)) {
2434
val = val.split(this.delimiter);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
5959
}
6060

6161
//force checkboxes to submit true instead of 'on'
62-
if (o.xtype == 'checkbox' && !Ext4.isDefined(o.inputValue)){
63-
o.inputValue = true;
62+
if (o.xtype === 'checkbox'){
63+
if (!Ext4.isDefined(o.inputValue)){
64+
o.inputValue = true;
65+
}
66+
67+
if (o.value){
68+
o.checked = true;
69+
}
6470
}
6571

6672
paramCfg.push(o);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Ext4.define('SequenceAnalysis.window.OutputHandlerWindow', {
170170
}
171171

172172
//force checkboxes to submit true instead of 'on'
173-
if (o.xtype == 'checkbox'){
173+
if (o.xtype === 'checkbox'){
174174
if (!Ext4.isDefined(o.inputValue)){
175175
o.inputValue = true;
176176
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
import org.labkey.sequenceanalysis.run.reference.SavedReferenceLibraryStep;
132132
import org.labkey.sequenceanalysis.run.reference.VirusReferenceLibraryStep;
133133
import org.labkey.sequenceanalysis.run.util.CombineGVCFsHandler;
134+
import org.labkey.sequenceanalysis.run.util.FastqcRunner;
134135
import org.labkey.sequenceanalysis.run.util.GenomicsDBAppendHandler;
135136
import org.labkey.sequenceanalysis.run.util.GenomicsDBImportHandler;
136137
import org.labkey.sequenceanalysis.run.variant.CombineVariantsHandler;
@@ -476,7 +477,8 @@ public Set<Class> getUnitTests()
476477
ProcessVariantsHandler.TestCase.class,
477478
VariantProcessingJob.TestCase.class,
478479
ScatterGatherUtils.TestCase.class,
479-
ChainFileValidator.TestCase.class
480+
ChainFileValidator.TestCase.class,
481+
FastqcRunner.TestCase.class
480482
);
481483
}
482484

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.labkey.api.sequenceanalysis.pipeline.HasJobParams;
2727
import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputTracker;
2828
import org.labkey.api.assay.AssayFileWriter;
29+
import org.labkey.api.settings.AppProps;
2930
import org.labkey.api.util.FileType;
3031
import org.labkey.api.util.FileUtil;
3132
import org.labkey.api.util.PageFlowUtil;
@@ -103,14 +104,23 @@ public SequenceJob(String providerName, Container c, User u, @Nullable String jo
103104
_taskPipelineId = taskPipelineId;
104105
_folderPrefix = folderPrefix;
105106
_webserverJobDir = createLocalDirectory(pipeRoot);
107+
108+
addCustomParams(params);
106109
_params = params;
110+
107111
writeParameters(params);
108112

109113
_folderFileRoot = c.isWorkbook()? PipelineService.get().findPipelineRoot(c.getParent()) : pipeRoot;
110114

111115
setLogFile(_getLogFile());
112116
}
113117

118+
protected void addCustomParams(JSONObject params)
119+
{
120+
params.put("serverBaseUrl", AppProps.getInstance().getBaseServerUrl() + AppProps.getInstance().getContextPath());
121+
params.put("labkeyFolderPath", getContainer().isWorkbook() ? getContainer().getParent().getPath() : getContainer().getPath());
122+
}
123+
114124
private File _getLogFile() throws IOException
115125
{
116126
return AssayFileWriter.findUniqueFileName((FileUtil.makeLegalName(_jobName) + ".log"), getDataDirectory());

0 commit comments

Comments
 (0)