Skip to content

Commit 4493f4b

Browse files
authored
Merge branch 'discvr-21.3-jbrowse2' into 21.4-jbrowse2-2.1.0
2 parents 7405875 + 0b33547 commit 4493f4b

File tree

86 files changed

+1986
-193
lines changed

Some content is hidden

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

86 files changed

+1986
-193
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/api-src/org/labkey/api/sequenceanalysis/pipeline/DefaultPipelineStepOutput.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,24 @@ public List<SequenceOutput> getSequenceOutputs()
105105
@Override
106106
public void addSequenceOutput(File file, String label, String category, @Nullable Integer readsetId, @Nullable Integer analysisId, @Nullable Integer genomeId, @Nullable String description)
107107
{
108+
_intermediateFiles.remove(file);
109+
108110
_sequenceOutputs.add(new SequenceOutput(file, label, category, readsetId, analysisId, genomeId, description));
109111
}
110112

113+
private boolean existsAsOutput(File f)
114+
{
115+
for (SequenceOutput so : _sequenceOutputs)
116+
{
117+
if (so.getFile() != null && so.getFile().equals(f))
118+
{
119+
return true;
120+
}
121+
}
122+
123+
return false;
124+
}
125+
111126
@Override
112127
public void addInput(File input, String role)
113128
{
@@ -132,13 +147,16 @@ public void addIntermediateFile(File file, String role)
132147
if (role != null)
133148
addOutput(file, role);
134149

135-
_intermediateFiles.add(file);
150+
if (!existsAsOutput(file))
151+
{
152+
_intermediateFiles.add(file);
153+
}
136154
}
137155

138156
@Override
139157
public void addIntermediateFiles(Collection<File> files)
140158
{
141-
_intermediateFiles.addAll(files);
159+
files.forEach(this::addIntermediateFile);
142160
}
143161

144162
public void addPicardMetricsFile(Readset rs, File metricFile, File inputFile)

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/.qview.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<column name="readset" />
1010
<column name="analysis_id" />
1111
<column name="runid" />
12+
<column name="workbook" />
1213
</columns>
1314
<sorts>
1415
<sort column="dataid/Name"/>

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/readData/.qview.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</properties>
2020
</column>
2121
<column name="created" />
22-
<column name="readset/workbook" />
22+
<column name="workbook" />
2323
</columns>
2424
<sorts>
2525
<sort column="readset" />

SequenceAnalysis/resources/queries/sequenceanalysis/readData/File Details.qview.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<column name="archived" />
1616

1717
<column name="created" />
18-
<column name="readset/workbook" />
18+
<column name="workbook" />
1919
</columns>
2020
<sorts>
2121
<sort column="readset" />

SequenceAnalysis/resources/queries/sequenceanalysis/readData/With Filepath.qview.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<column name="archived" />
1616

1717
<column name="created" />
18-
<column name="readset/workbook" />
18+
<column name="workbook" />
1919
</columns>
2020
<sorts>
2121
<sort column="readset" />

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
}

0 commit comments

Comments
 (0)