Skip to content

Commit 9bef94f

Browse files
authored
Merge pull request #103 from LabKey/fb_merge_discvr-21.3
Merge discvr-21.3 to develop
2 parents 76352de + e9201a5 commit 9bef94f

File tree

51 files changed

+919
-146
lines changed

Some content is hidden

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

51 files changed

+919
-146
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/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/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());

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,11 @@ public static boolean isAlignmentUsed(PipelineJob job)
250250

251251
public static void logModuleVersions(Logger log)
252252
{
253-
log.info("SequenceAnalysis Module Version: " + ModuleLoader.getInstance().getModule(SequenceAnalysisModule.NAME).getReleaseVersion() + " (r" + (ModuleLoader.getInstance().getModule(SequenceAnalysisModule.NAME).getVcsRevision()) + ")");
254-
log.info("Pipeline Module Version: " + ModuleLoader.getInstance().getModule("pipeline").getReleaseVersion() + " (r" + (ModuleLoader.getInstance().getModule("pipeline").getVcsRevision()) + ")");
253+
String vcs1 = ModuleLoader.getInstance().getModule(SequenceAnalysisModule.NAME).getVcsRevision();
254+
log.info("SequenceAnalysis Module Version: " + ModuleLoader.getInstance().getModule(SequenceAnalysisModule.NAME).getReleaseVersion() + (StringUtils.isEmpty(vcs1) ? "" : " (r" + vcs1 + ")"));
255+
256+
String vcs2 = ModuleLoader.getInstance().getModule("pipeline").getVcsRevision();
257+
log.info("Pipeline Module Version: " + ModuleLoader.getInstance().getModule("pipeline").getReleaseVersion() + (StringUtils.isEmpty(vcs2) ? "" : " (r" + vcs2 + ")"));
255258
log.debug("java.io.tmpDir: " + System.getProperty("java.io.tmpdir"));
256259
try
257260
{

SequenceAnalysis/src/org/labkey/sequenceanalysis/query/SequenceAnalysisUserSchema.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private TableInfo createOutputFiles(TableInfo sourceTable, ContainerFilter cf)
165165

166166
private TableInfo createReadDataTable(TableInfo sourceTable, ContainerFilter cf)
167167
{
168-
SimpleTable ret = new SimpleTable(this, sourceTable, cf).init();
168+
SimpleTable ret = new SimpleTable<>(this, sourceTable, cf).init();
169169

170170
if (ret.getColumn("totalForwardReads") == null)
171171
{
@@ -197,7 +197,7 @@ private TableInfo createReadDataTable(TableInfo sourceTable, ContainerFilter cf)
197197

198198
private TableInfo createReadsetsTable(TableInfo sourceTable, ContainerFilter cf)
199199
{
200-
SimpleTable ret = new SimpleTable(this, sourceTable, cf).init();
200+
SimpleTable ret = new SimpleTable<>(this, sourceTable, cf).init();
201201
if (ret.getColumn("files") == null)
202202
{
203203
WrappedColumn newCol = new WrappedColumn(ret.getColumn("rowid"), "files");
@@ -383,7 +383,7 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
383383

384384
private TableInfo createRefSequencesTable(TableInfo sourceTable)
385385
{
386-
SharedDataTable ret = new SharedDataTable(this, sourceTable);
386+
SharedDataTable ret = new SharedDataTable<>(this, sourceTable);
387387
String chr = sourceTable.getSqlDialect().isPostgreSQL() ? "chr" : "char";
388388
SQLFragment sql = new SQLFragment("(SELECT ").append(sourceTable.getSqlDialect().getGroupConcat(new SQLFragment("r.name"), true, true, chr + "(10)")).append(" as expr FROM " + SequenceAnalysisSchema.SCHEMA_NAME + "." + SequenceAnalysisSchema.TABLE_REF_LIBRARY_MEMBERS + " rm JOIN " + SequenceAnalysisSchema.SCHEMA_NAME + "." + SequenceAnalysisSchema.TABLE_REF_LIBRARIES + " r ON (rm.library_id = r.rowid) WHERE rm.ref_nt_id = " + ExprColumn.STR_TABLE_ALIAS + ".rowid)");
389389
ExprColumn newCol = new ExprColumn(ret, "genomes", sql, JdbcType.VARCHAR, sourceTable.getColumn("rowid"));

0 commit comments

Comments
 (0)