Skip to content

Commit e0ee7cc

Browse files
authored
Merge pull request #112 from LabKey/fb_merge_21.7_to_develop
Merge discvr-21.7 to develop
2 parents 51b9e0d + 6cf6bd5 commit e0ee7cc

File tree

62 files changed

+2647
-801
lines changed

Some content is hidden

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

62 files changed

+2647
-801
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,5 +56,7 @@ public interface ReadData extends Serializable
5656

5757
public Integer getModifiedBy();
5858

59+
public String getSra_accession();
60+
5961
public boolean isArchived();
6062
}

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.labkey.api.sequenceanalysis.model.Readset;
2323

2424
import java.io.File;
25+
import java.util.List;
2526

2627
/**
2728
* User: bimber
@@ -43,12 +44,27 @@ default public String getIndexCachedDirName(PipelineJob job)
4344

4445
/**
4546
* Performs a reference guided alignment using the provided files.
46-
* @param inputFastq1 The forward FASTQ file
47-
* @param inputFastq2 The second FASTQ, if using paired end data
47+
* @param inputFastqs1 The forward FASTQ file(s). In most cases this is a single FASTQ. The aligner must return true for canAlignMultiplePairsAtOnce() otherwise.
48+
* @param inputFastqs2 The second FASTQ(s), if using paired end data
4849
* @param basename The basename to use as the output
4950
* @throws PipelineJobException
5051
*/
51-
public AlignmentOutput performAlignment(Readset rs, File inputFastq1, @Nullable File inputFastq2, File outputDirectory, ReferenceGenome referenceGenome, String basename, String readGroupId, @Nullable String platformUnit) throws PipelineJobException;
52+
public AlignmentOutput performAlignment(Readset rs, List<File> inputFastqs1, @Nullable List<File> inputFastqs2, File outputDirectory, ReferenceGenome referenceGenome, String basename, String readGroupId, @Nullable String platformUnit) throws PipelineJobException;
53+
54+
default boolean canAlignMultiplePairsAtOnce()
55+
{
56+
return false;
57+
}
58+
59+
default File assertSingleFile(List<File> inputs)
60+
{
61+
if (inputs != null && inputs.size() > 1)
62+
{
63+
throw new IllegalArgumentException("This aligner only supports a single pair of input FASTQs");
64+
}
65+
66+
return inputs == null ? null : inputs.get(0);
67+
}
5268

5369
public boolean doAddReadGroups();
5470

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="SRA Info" canOverride="true">
2+
<columns>
3+
<column name="rowid" />
4+
<column name="name" />
5+
<column name="subjectid" />
6+
<column name="sampledate"/>
7+
<column name="platform" />
8+
<column name="librarytype" />
9+
<column name="application" />
10+
<column name="sampletype" />
11+
<column name="comments" />
12+
13+
<column name="runIds"/>
14+
<column name="jobIds"/>
15+
<column name="created" />
16+
<column name="status" />
17+
<column name="workbook" />
18+
<column name="sraRuns" />
19+
<column name="isArchived" />
20+
<column name="files" />
21+
</columns>
22+
<sorts>
23+
<sort column="rowid" descending="true"/>
24+
</sorts>
25+
</customView>

SequenceAnalysis/resources/web/SequenceAnalysis/panel/AlignmentImportPanel.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ Ext4.define('SequenceAnalysis.panel.AlignmentImportPanel', {
610610
},
611611
scope: this,
612612
success: this.onFileLoad,
613-
failure: LDK.Utils.getErrorCallback
613+
failure: LDK.Utils.getErrorCallback()
614614
});
615615

616616
this.fileNameStore = Ext4.create('Ext.data.Store', {
@@ -860,7 +860,7 @@ Ext4.define('SequenceAnalysis.panel.AlignmentImportPanel', {
860860

861861
var found = false;
862862
Ext4.each(cols, function(col, idx){
863-
if (col.name == field || col.text == field || col.dataIndex.toLowerCase() == field.toLowerCase()){
863+
if (col.name === field || col.text === field || col.dataIndex.toLowerCase() === field.toLowerCase()){
864864
columns.push(col);
865865
found = true;
866866
return false;
@@ -918,11 +918,11 @@ Ext4.define('SequenceAnalysis.panel.AlignmentImportPanel', {
918918
var recIdx = col.editor.store.find(col.editor.valueField, value, null, false, false);
919919

920920
//attempt to resolve by displayField
921-
if (recIdx == -1) {
921+
if (recIdx === -1) {
922922
recIdx = col.editor.store.find(col.editor.displayField, value, null, false, false);
923923
}
924924

925-
if (recIdx == -1) {
925+
if (recIdx === -1) {
926926
errors.push('Invalid value for field ' + col.text + ': ' + value);
927927
}
928928
else {
@@ -932,6 +932,10 @@ Ext4.define('SequenceAnalysis.panel.AlignmentImportPanel', {
932932
}
933933
}
934934

935+
if (value && col.dataIndex === 'readset' && !Ext4.isNumeric(value)) {
936+
errors.push('Readset Id should be an integer: ' + value);
937+
}
938+
935939
if (!Ext4.isEmpty(value)){
936940
obj[col.dataIndex] = value;
937941
}

SequenceAnalysis/resources/web/SequenceAnalysis/panel/SequenceImportPanel.js

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
3636
{name: 'fileGroupId', allowBlank: false},
3737
{name: 'readset', allowBlank: false},
3838
{name: 'readsetname', useNull: true},
39+
{name: 'importType', useNull: true},
3940
{name: 'barcode5', useNull: true},
4041
{name: 'barcode3', useNull: true},
4142
{name: 'platform', allowBlank: false},
@@ -794,6 +795,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
794795
barcode3: r.get('barcode3'),
795796
readset: r.get('readset'),
796797
readsetname: r.get('readsetname'),
798+
importType: r.get('importType'),
797799
platform: r.get('platform'),
798800
application: r.get('application'),
799801
chemistry: r.get('chemistry'),
@@ -1643,6 +1645,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
16431645
Ext4.Msg.wait('Loading...');
16441646
var doDemultiplex = this.down('#doDemultiplex').getValue();
16451647
var showBarcodes = this.down('#showBarcodes').getValue();
1648+
var allowReadsetMerge = this.down('#allowReadsetMerge').getValue();
16461649

16471650
LABKEY.Query.selectRows({
16481651
method: 'POST',
@@ -1659,8 +1662,8 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
16591662
if (results && results.rows && results.rows.length){
16601663
Ext4.Array.forEach(results.rows, function(row) {
16611664
var records = recordsById[row.rowid];
1662-
if (row.totalFiles) {
1663-
msgs.push('Readset ' + row.rowid + 'has already been associated with files and cannot be re-used. If you would like to reanalyze this readset, load the table of readsets and look for the \'Analyze Data\' button.');
1665+
if (!allowReadsetMerge && row.totalFiles) {
1666+
msgs.push('Readset ' + row.rowid + ' has already been associated with files and cannot be re-used. If you would like to reanalyze this readset, load the table of readsets and look for the \'Analyze Data\' button.');
16641667
Ext4.Array.forEach(records, function(record) {
16651668
record.data.readset = null;
16661669
}, this);
@@ -1675,18 +1678,16 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
16751678
return;
16761679
}
16771680
else if (!doDemultiplex && !showBarcodes && (row.barcode3 || row.barcode5)) {
1678-
msgs.push('Readset ' + row.rowid + ' has barcodes, but you have not selected to either show barcodes or perform demultiplexing');
1679-
Ext4.Array.forEach(records, function(record) {
1680-
record.data.readset = null;
1681-
}, this);
1682-
1683-
return;
1681+
this.down('#showBarcodes').setValue(true);
1682+
showBarcodes = true;
16841683
}
16851684

16861685
//update row based on saved readset. avoid firing event
16871686
Ext4.Array.forEach(records, function(record) {
1687+
var importType = !record.data.readset ? null : row.totalFiles ? 'Merge With Existing' : 'New Data';
16881688
Ext4.apply(record.data, {
16891689
readsetname: row.name,
1690+
importType: importType,
16901691
platform: row.platform,
16911692
application: row.application,
16921693
chemistry: row.chemistry,
@@ -1716,6 +1717,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
17161717
Ext4.apply(record.data, {
17171718
readset: null,
17181719
readsetname: null,
1720+
importType: null,
17191721
platform: null,
17201722
application: null,
17211723
chemistry: null,
@@ -1866,7 +1868,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
18661868

18671869
var grid = btn.up('panel').down('ldk-gridpanel');
18681870
Ext4.Array.forEach(grid.columns, function(c){
1869-
if (c.dataIndex === 'readset'){
1871+
if (c.dataIndex === 'readset' || c.dataIndex === 'importType'){
18701872
c.setVisible(val);
18711873
}
18721874
}, this);
@@ -1881,12 +1883,18 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
18811883
hideMode: 'offsets',
18821884
width: 'auto',
18831885
itemId: 'existingReadsetOptions',
1886+
border: false,
18841887
fieldDefaults: {
18851888
width: 350
18861889
},
18871890
items: [{
18881891
html: 'It is possible to import readset information before you import the actual read data. This is most commonly done when you plan a run upfront (such as the Illumina workflow). If you did this, just enter the readset Id below and the details will automatically populate. Note: when this option is selected the readset details are not editable through this form.',
18891892
border: false
1893+
},{
1894+
itemId: 'allowReadsetMerge',
1895+
xtype: 'checkbox',
1896+
fieldLabel: 'Allow Merge If Existing Readset Has Data',
1897+
helpPopup: 'If there is already data for the selected readset(s), the original readset will be copied (same attrbitues), and a new readset will be creating using these reads and the original data. The original readset will remain.'
18901898
}]
18911899
},{
18921900
xtype: 'ldk-gridpanel',
@@ -1964,6 +1972,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
19641972
if (records && records.length) {
19651973
records[0].set({
19661974
readset: null,
1975+
importType: null,
19671976
readsetname: null,
19681977
platform: null,
19691978
application: null,
@@ -1989,6 +1998,18 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
19891998
}
19901999
}
19912000
}
2001+
}, {
2002+
text: 'Import Status',
2003+
tdCls: 'ldk-wrap-text',
2004+
name: 'importType',
2005+
hidden: true,
2006+
dataIndex: 'importType',
2007+
width: 110,
2008+
editable: true,
2009+
editor: {
2010+
xtype: 'displayfield',
2011+
allowBlank: true
2012+
}
19922013
},{
19932014
text: '5\' Barcode',
19942015
tdCls: 'ldk-wrap-text',
@@ -2615,7 +2636,12 @@ Ext4.define('SequenceAnalysis.panel.SequenceImportPanel', {
26152636
}
26162637

26172638
if (obj.readset){
2618-
readsetsToUpdate.push(obj.readset);
2639+
if (!Ext4.isNumeric(obj.readset)) {
2640+
errors.push('Readset Id should be an integer: ' + obj.readset);
2641+
}
2642+
else {
2643+
readsetsToUpdate.push(obj.readset);
2644+
}
26192645
}
26202646
}, this);
26212647

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class ReadDataImpl implements ReadData
3131
private Integer _modifiedBy;
3232
private Integer _runId;
3333
private boolean _archived = false;
34+
private String sra_accession;
3435

3536
private Map<Integer, File> _cachedFiles = new HashMap<>();
3637

@@ -259,4 +260,15 @@ public void setArchived(boolean archived)
259260
{
260261
_archived = archived;
261262
}
263+
264+
@Override
265+
public String getSra_accession()
266+
{
267+
return sra_accession;
268+
}
269+
270+
public void setSra_accession(String sra_accession)
271+
{
272+
this.sra_accession = sra_accession;
273+
}
262274
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public int getRowId()
7272
return _rowId == null ? 0 : _rowId;
7373
}
7474

75+
public void unsetRowId()
76+
{
77+
_rowId = null;
78+
}
79+
7580
public void setRowId(int rowId)
7681
{
7782
_rowId = rowId;

0 commit comments

Comments
 (0)