Skip to content

Commit 158e238

Browse files
authored
Merge pull request #152 from BimberLab/22.3_fb_merge
Merge discvr-21.11 to discvr-22.3
2 parents 218fbf2 + dbbe062 commit 158e238

File tree

132 files changed

+4722
-1211
lines changed

Some content is hidden

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

132 files changed

+4722
-1211
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/model/ReadData.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public interface ReadData extends Serializable
5656

5757
public Integer getModifiedBy();
5858

59+
public Integer getTotalReads();
60+
5961
public String getSra_accession();
6062

6163
public boolean isArchived();

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public interface PipelineStepProvider<StepType extends PipelineStep>
8383
*/
8484
public ToolParameterDescriptor getParameterByName(String name);
8585

86+
default boolean hasParameter(String name)
87+
{
88+
return getParameterByName(name) != null;
89+
}
90+
8691
/**
8792
* Creates the JSON object sent to the client that is used to build the client UI
8893
*/

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.apache.commons.io.FileUtils;
55
import org.apache.commons.lang3.StringUtils;
66
import org.apache.logging.log4j.Logger;
7-
import org.apache.logging.log4j.LogManager;
87
import org.jetbrains.annotations.Nullable;
98
import org.labkey.api.pipeline.PipelineJobException;
109
import org.labkey.api.pipeline.PipelineJobService;
@@ -30,6 +29,11 @@ public SamSorter(@Nullable Logger logger)
3029
}
3130

3231
public File execute(File input, @Nullable File output, SAMFileHeader.SortOrder sortOrder) throws PipelineJobException
32+
{
33+
return execute(input, output, sortOrder, null);
34+
}
35+
36+
public File execute(File input, @Nullable File output, SAMFileHeader.SortOrder sortOrder, @Nullable List<String> extraArgs) throws PipelineJobException
3337
{
3438
getLogger().info("Sorting SAM/BAM: " + input.getPath());
3539

@@ -50,7 +54,7 @@ public File execute(File input, @Nullable File output, SAMFileHeader.SortOrder s
5054
}
5155
else if (sortOrder != SAMFileHeader.SortOrder.coordinate)
5256
{
53-
throw new PipelineJobException("Improper sort order: " + sortOrder.name());
57+
getLogger().debug("Using sort order: " + sortOrder.name());
5458
}
5559

5660
Integer threads = SequencePipelineService.get().getMaxThreads(getLogger());
@@ -71,6 +75,11 @@ else if (sortOrder != SAMFileHeader.SortOrder.coordinate)
7175
params.add("-T");
7276
params.add(tmpDir);
7377

78+
if (extraArgs != null)
79+
{
80+
params.addAll(extraArgs);
81+
}
82+
7483
params.add("-o");
7584
params.add(output.getPath());
7685

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public Class getProcessorClass()
6565

6666
public String getName();
6767

68+
default String getAnalysisType(PipelineJob job)
69+
{
70+
return getName();
71+
}
72+
6873
public String getDescription();
6974

7075
/**

SequenceAnalysis/resources/queries/sequenceanalysis/outputfiles.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,17 @@ function beforeDelete(row, errors){
1414
errors._form = 'You cannot directly delete analyses. To delete these records, use the delete button above the analysis grid.';
1515
}
1616
}
17+
18+
function beforeInsert(row, errors){
19+
beforeUpsert(row, errors);
20+
}
21+
22+
function beforeUpdate(row, errors){
23+
beforeUpsert(row, errors);
24+
}
25+
26+
function beforeUpsert(row, errors) {
27+
if (row.dataid && typeof row.dataid == 'string') {
28+
row.dataid = triggerHelper.createExpData(row.dataid);
29+
}
30+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE INDEX IDX_asj_status_container_alignment_id_ref_nt_id ON sequenceanalysis.alignment_summary_junction (
2+
status ASC,
3+
container ASC,
4+
alignment_id ASC,
5+
ref_nt_id ASC
6+
);
7+
8+
CREATE INDEX IDX_readData_readset ON sequenceanalysis.readData (
9+
readset ASC
10+
)
11+
INCLUDE(fileid1, fileid2, runid);
12+
13+
CREATE INDEX IDX_quality_metrics_metricname_dataid_readset ON sequenceanalysis.quality_metrics (
14+
metricName ASC,
15+
dataId ASC,
16+
readset ASC
17+
)
18+
INCLUDE(metricValue);
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE NONCLUSTERED INDEX IDX_asj_status_container_alignment_id_ref_nt_id ON sequenceanalysis.alignment_summary_junction (
2+
status ASC,
3+
container ASC,
4+
alignment_id ASC,
5+
ref_nt_id ASC
6+
);
7+
8+
CREATE NONCLUSTERED INDEX IDX_readData_readset ON sequenceanalysis.readData (
9+
readset ASC
10+
)
11+
INCLUDE(fileid1, fileid2, runid);
12+
13+
CREATE NONCLUSTERED INDEX IDX_quality_metrics_metricname_dataid_readset ON sequenceanalysis.quality_metrics (
14+
metricName ASC,
15+
dataId ASC,
16+
readset ASC
17+
)
18+
INCLUDE(metricValue);
19+

SequenceAnalysis/resources/web/SequenceAnalysis/Utils.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ SequenceAnalysis.Utils = new function(){
137137
exonPosition = nt_position - startNT + exon[0];
138138
nt_positions.push(exonPosition);
139139
exons.push(idx);
140-
if(nt_positions.length == 3)
140+
if(nt_positions.length === 3)
141141
return false; //jump to next exon
142142

143143
nt_position++;
@@ -152,6 +152,22 @@ SequenceAnalysis.Utils = new function(){
152152
nt_positions: nt_positions,
153153
exons: exons
154154
};
155+
},
156+
157+
// https://github.com/overset/javascript-natural-sort/blob/master/naturalSort.js
158+
naturalSortFn: function(o1, o2){
159+
o1 = SequenceAnalysis.Utils.getNaturalSortValue(o1);
160+
o2 = SequenceAnalysis.Utils.getNaturalSortValue(o2);
161+
162+
if (o1 === o2) {
163+
return 0;
164+
}
165+
166+
return o1 < o2 ? -1 : 1;
167+
},
168+
169+
getNaturalSortValue: function(value) {
170+
return value ? value.replace(/(\d+)/g, "0000000000$1").replace(/0*(\d{10,})/g, "$1") : value;
155171
}
156172
}
157173
}

SequenceAnalysis/resources/web/SequenceAnalysis/field/SequenceOutputFileSelectorField.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Ext4.define('SequenceAnalysis.field.SequenceOutputFileSelectorField', {
4949
}
5050
}
5151
else {
52-
LDK.Utils.logError('unable to find library field in GenomeFileSelectorField');
52+
LDK.Utils.logError('unable to find library field in SequenceOutputFileSelectorField');
5353
}
5454
}
5555
else if (window && window.libraryId){

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

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,27 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
128128

129129
items.push({
130130
xtype: 'ldk-linkbutton',
131-
text: 'Add',
131+
text: 'Add to Start',
132+
linkCls: 'labkey-text-link',
133+
step: step,
134+
handler: function(btn){
135+
var win = btn.up('window');
136+
var owner = win.ownerPanel;
137+
var target = owner.down('#toolConfgPanel');
138+
139+
//check if exists
140+
if (!owner.allowDuplicateSteps && target.down('[stepName=' + btn.step.name + ']')) {
141+
Ext4.Msg.alert('Already Added', 'This step has already been added and cannot be used twice.');
142+
}
143+
else {
144+
target.insert(0, owner.getAbbreviatedConfigForItem(btn.step));
145+
}
146+
}
147+
});
148+
149+
items.push({
150+
xtype: 'ldk-linkbutton',
151+
text: 'Add to End',
132152
linkCls: 'labkey-text-link',
133153
step: step,
134154
handler: function(btn){
@@ -144,7 +164,7 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
144164
target.add(owner.getAbbreviatedConfigForItem(btn.step));
145165
}
146166
}
147-
})
167+
});
148168
}, this);
149169

150170
if (items.length){
@@ -161,7 +181,7 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
161181
},
162182
layout: {
163183
type: 'table',
164-
columns: 3
184+
columns: 4
165185
},
166186
items: items
167187
}];

0 commit comments

Comments
 (0)