Skip to content

Commit c58258b

Browse files
authored
Merge pull request #40 from LabKey/fb_merge_discvr-20.3
Merge discvr-20.3 to develop
2 parents 22eeb3a + 2253ff6 commit c58258b

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

+1681
-332
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/SequenceAnalysisService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,6 @@ static public void setInstance(SequenceAnalysisService instance)
100100
abstract public File combineVcfs(List<File> files, File outputGz, ReferenceGenome genome, Logger log, boolean multiThreaded, @Nullable Integer compressionLevel) throws PipelineJobException;
101101

102102
abstract public String getScriptPath(String moduleName, String path) throws PipelineJobException;
103+
104+
abstract public void sortGxf(Logger log, File input, @Nullable File output) throws PipelineJobException;
103105
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.labkey.api.sequenceanalysis.model.Readset;
2121

2222
import java.io.File;
23-
import java.util.List;
2423

2524
/**
2625
* User: bimber
@@ -41,11 +40,13 @@ default void init(SequenceAnalysisJobSupport support) throws PipelineJobExceptio
4140

4241
/**
4342
* Will perform analysis steps on the remote pipeline server
43+
* Note: outputDir is the location where the BAM is expected to be written
4444
*/
4545
public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, ReferenceGenome referenceGenome, File outputDir) throws PipelineJobException;
4646

4747
/**
4848
* Will perform analysis steps on the local webserver
49+
* Note: outputDir is the location where the BAM was created (if this step creates a BAM)
4950
*/
5051
public Output performAnalysisPerSampleLocal(AnalysisModel model, File inputBam, File referenceFasta, File outDir) throws PipelineJobException;
5152

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,13 @@ public interface HasActionNames
245245

246246
public static interface TracksVCF
247247
{
248-
public File getFinalVCF(JobContext ctx) throws PipelineJobException;
248+
public File getScatterJobOutput(JobContext ctx) throws PipelineJobException;
249249

250-
public SequenceOutputFile createFinalSequenceOutput(PipelineJob job, File processed, List<SequenceOutputFile> inputFiles);
250+
public SequenceOutputFile createFinalSequenceOutput(PipelineJob job, File processed, List<SequenceOutputFile> inputFiles) throws PipelineJobException;
251+
}
252+
253+
public static interface HasCustomVariantMerge
254+
{
255+
public File performVariantMerge(TaskFileManager manager, RecordedAction action, SequenceOutputHandler<SequenceOutputHandler.SequenceOutputProcessor> handler, PipelineJob job) throws PipelineJobException;
251256
}
252257
}

SequenceAnalysis/pipeline_code/sequence_tools_install.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,15 @@ cd $LKSRC_DIR
175175
if [[ ! -e ${LKTOOLS_DIR}/bwa || ! -z $FORCE_REINSTALL ]];
176176
then
177177
echo "Cleaning up previous installs"
178-
rm -Rf bwa-0.6.2*
179-
rm -Rf bwa-0.7.9a*
180-
rm -Rf bwa-0.7.12*
178+
rm -Rf bwa-0.*
181179
rm -Rf $LKTOOLS_DIR/bwa
182180

183-
wget $WGET_OPTS https://downloads.sourceforge.net/project/bio-bwa/bwa-0.7.12.tar.bz2
184-
bunzip2 bwa-0.7.12.tar.bz2
185-
tar -xf bwa-0.7.12.tar
186-
bzip2 bwa-0.7.12.tar
187-
cd bwa-0.7.12
188-
make CFLAGS=-msse2
181+
wget $WGET_OPTS https://downloads.sourceforge.net/project/bio-bwa/bwa-0.7.17.tar.bz2
182+
bunzip2 bwa-0.7.17.tar.bz2
183+
tar -xf bwa-0.7.17.tar
184+
bzip2 bwa-0.7.17.tar
185+
cd bwa-0.7.17
186+
make
189187
install bwa $LKTOOLS_DIR/
190188
else
191189
echo "Already installed"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE sequenceanalysis.chain_files ADD source varchar(4000);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE sequenceanalysis.chain_files ADD source varchar(4000);

SequenceAnalysis/resources/schemas/sequenceanalysis.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,6 +2607,9 @@
26072607
<fkTable>data</fkTable>
26082608
<fkColumnName>RowId</fkColumnName>
26092609
</fk>
2610+
</column>
2611+
<column columnName="source">
2612+
26102613
</column>
26112614
<column columnName="version">
26122615

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Ext4.define('SequenceAnalysis.field.SequenceOutputFileSelectorField', {
2+
extend: 'LABKEY.ext4.ComboBox',
3+
alias: 'widget.sequenceanalysis-sequenceoutputfileselectorfield',
4+
5+
genomeId: -1,
6+
7+
initComponent: function(){
8+
Ext4.apply(this, {
9+
forceSelection: true,
10+
displayField: 'name',
11+
valueField: 'dataid',
12+
listConfig: {
13+
innerTpl: ['{name} ({[values["rowid"]]})']
14+
},
15+
store: {
16+
type: 'labkey-store',
17+
containerPath: Laboratory.Utils.getQueryContainerPath(),
18+
schemaName: 'sequenceanalysis',
19+
queryName: 'outputfiles',
20+
autoLoad: true,
21+
filterArray: this.getFilterArray(),
22+
sort: 'name',
23+
columns: 'library_id,name,dataid,category'
24+
}
25+
});
26+
27+
this.callParent(arguments);
28+
29+
this.on('afterrender', function() {
30+
var parent = this.up('sequenceanalysis-basesequencepanel'); //Alignment panels
31+
var window = this.up('window'); //OutputHandlerWindow
32+
if (parent) {
33+
var field = parent.down('field[name=referenceLibraryCreation.SavedLibrary.libraryId]');
34+
if (field) {
35+
this.mon(field, 'change', this.onGenomeChange, this);
36+
if (field.getValue()){
37+
this.updateStoreFilters(field.getValue());
38+
}
39+
}
40+
else if (parent.libraryIds){
41+
if (parent.libraryIds.length === 1){
42+
this.updateStoreFilters(parent.libraryIds[0]);
43+
}
44+
else if (!parent.libraryIds.length){
45+
Ext4.Msg.alert('Genome Error', 'There are no reference genomes associated with these samples');
46+
}
47+
else if (parent.libraryIds.length > 1){
48+
Ext4.Msg.alert('Genome Error', 'More than one reference genome associated with these samples. They must all use the same genome.');
49+
}
50+
}
51+
else {
52+
LDK.Utils.logError('unable to find library field in GenomeFileSelectorField');
53+
}
54+
}
55+
else if (window && window.libraryId){
56+
this.updateStoreFilters(window.libraryId);
57+
}
58+
else {
59+
LDK.Utils.logError('unable to find basesequencepanel in SequenceOutputFileSelectorField');
60+
Ext4.Msg.alert('Error', 'There is no genome ID provided to this field. This indicates an error in how the module was developed - please contact your administrator.');
61+
}
62+
}, this);
63+
},
64+
65+
onGenomeChange: function(field, genomeId){
66+
genomeId = genomeId ? genomeId : -1;
67+
if (genomeId === this.genomeId){
68+
return;
69+
}
70+
71+
this.updateStoreFilters(genomeId);
72+
},
73+
74+
updateStoreFilters: function(genomeId){
75+
this.genomeId = genomeId;
76+
this.store.filterArray = this.getFilterArray();
77+
this.store.load();
78+
},
79+
80+
getFilterArray: function(){
81+
return [LABKEY.Filter.create('library_id', this.genomeId), LABKEY.Filter.create('category', this.category, LABKEY.Filter.Types.EQUAL)];
82+
}
83+
});

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Ext4.define('SequenceAnalysis.panel.VariantScatterGatherPanel', {
1717
labelWidth: this.labelWidth,
1818
width: this.defaultFieldWidth,
1919
expandToFitContent: true,
20-
value: 'none',
20+
value: this.defaultValue || 'none',
2121
displayField: 'label',
2222
valueField: 'value',
2323
store: {
@@ -36,6 +36,9 @@ Ext4.define('SequenceAnalysis.panel.VariantScatterGatherPanel', {
3636
allowBlank: false,
3737
listeners: {
3838
scope: this,
39+
render: function(field){
40+
field.fireEvent('change', field, field.getValue());
41+
},
3942
change: function(field, val) {
4043
var panel = this.down('#scatterGatherMethodOptions');
4144
panel.removeAll();

SequenceAnalysis/resources/web/SequenceAnalysis/window/ImportChainFileWindow.js

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Ext4.define('SequenceAnalysis.window.ImportChainFileWindow', {
2020
width: 450
2121
},
2222
items: [{
23-
html: 'This will import a chain file, which is used to liftover variants or annotations from one reference genome to another.',
23+
html: 'This will import a chain file, which is used to liftover variants or annotations from one reference genome to another. Note: because UCSC is a common source of chain files and they use non-standard contig names, the server-side code will attempt to parse any non-standard names in the chain file, match them with the genomes, and write an updated chain file.',
2424
style: 'padding-bottom: 10px;',
2525
width: null
2626
},{
@@ -58,11 +58,23 @@ Ext4.define('SequenceAnalysis.window.ImportChainFileWindow', {
5858
fieldLabel: 'File',
5959
name: 'chainFile',
6060
allowBlank: false
61+
},{
62+
xtype: 'textfield',
63+
fieldLabel: 'Source',
64+
name: 'source',
65+
allowBlank: false
6166
},{
6267
xtype: 'ldk-numberfield',
6368
fieldLabel: 'Version',
69+
helpPopup: 'This field is used by the system - when a chain file is being selected automatically it will choose the one with the highest version',
6470
name: 'version',
6571
allowBlank: false
72+
},{
73+
xtype: 'checkbox',
74+
fieldLabel: 'Allow Unknown Contigs',
75+
helpPopup: 'By default, if the chain file contains contigs that cannot be mapped to contigs in the genomes, it will fail. If this is checked, these chains will simply be discarded.',
76+
name: 'allowUnknownContig',
77+
checked: false
6678
},{
6779
xtype: 'hidden', name: 'X-LABKEY-CSRF', value: LABKEY.CSRF
6880
}]
@@ -103,12 +115,24 @@ Ext4.define('SequenceAnalysis.window.ImportChainFileWindow', {
103115
this.down('form').submit({
104116
scope: this,
105117
timeout: 999999999,
106-
success: function(){
118+
success: function(form, action){
107119
Ext4.Msg.hide();
108120

121+
var msg = null;
122+
if (action && action.response && action.response.responseText){
123+
if (Ext4.String.startsWith(action.response.responseText, '{')) {
124+
action.response.responseJSON = Ext4.decode(action.response.responseText);
125+
}
126+
127+
if (action.response.responseJSON && action.response.responseJSON.messages) {
128+
console.log(action.response.responseJSON.messages);
129+
msg = action.response.responseJSON.messages.join('<br>');
130+
}
131+
}
132+
109133
this.close();
110134

111-
Ext4.Msg.alert('Success', 'Chain File Imported!', function(){
135+
Ext4.Msg.alert('Success', 'Chain File Imported!' + (msg ? ' Notes:<br><br>' + msg : ''), function(){
112136
var dataRegion = LABKEY.DataRegions[this.dataRegionName];
113137
dataRegion.refresh();
114138
}, this);
@@ -118,7 +142,16 @@ Ext4.define('SequenceAnalysis.window.ImportChainFileWindow', {
118142
var msg;
119143
var serverMsg = [];
120144
if (action && action.response && action.response.responseText){
121-
msg = action.response.responseText;
145+
if (Ext4.String.startsWith(action.response.responseText, '{')) {
146+
action.response.responseJSON = Ext4.decode(action.response.responseText);
147+
}
148+
149+
if (action.response.responseJSON && action.response.responseJSON.exception) {
150+
msg = action.response.responseJSON.exception;
151+
}
152+
else {
153+
msg = action.response.responseText;
154+
}
122155
serverMsg.push(action.response.responseText);
123156
}
124157

0 commit comments

Comments
 (0)