Skip to content

Commit 7cd466b

Browse files
authored
Merge pull request #60 from LabKey/fb_merge_discvr-20.7
Merge discvr-20.7 to develop
2 parents f13531c + 8aa849a commit 7cd466b

File tree

20 files changed

+269
-64
lines changed

20 files changed

+269
-64
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public interface SequenceAnalysisJobSupport extends Serializable
4747

4848
public void cacheReadset(int readsetId, User u);
4949

50+
public void cacheReadset(int readsetId, User u, boolean allowReadsetsWithArchivedData);
51+
5052
public List<AnalysisModel> getCachedAnalyses();
5153

5254
public void cacheGenome(ReferenceGenome m);

SequenceAnalysis/resources/web/SequenceAnalysis/field/GenomeFileSelectorField.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Ext4.define('SequenceAnalysis.field.GenomeFileSelectorField', {
2626
load: function(store){
2727
if (this.extensions) {
2828
Ext4.Array.forEach(store.getRange(), function (r) {
29-
if (this.extensions.indexOf(r.get('fileid/FileExtension')) == -1){
29+
if (this.extensions.indexOf(r.get('fileid/FileExtension')) === -1){
3030
store.remove(r);
3131
}
3232
}, this);
@@ -50,7 +50,7 @@ Ext4.define('SequenceAnalysis.field.GenomeFileSelectorField', {
5050
}
5151
}
5252
else if (parent.libraryIds){
53-
if (parent.libraryIds.length == 1){
53+
if (parent.libraryIds.length === 1){
5454
this.updateStoreFilters(parent.libraryIds[0]);
5555
}
5656
else if (!parent.libraryIds.length){

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,13 +723,19 @@ Ext4.define('SequenceAnalysis.panel.AlignmentImportPanel', {
723723
if (rec.get('error'))
724724
totalErrors++;
725725
else {
726-
if (!rec.get('fileId'))
727-
fields.inputFiles.push({
728-
fileName: rec.get('fileName'),
729-
relPath: rec.get('relPath')
730-
});
731-
else
726+
if (!rec.get('fileId')) {
727+
var recIdx = this.fileNameStore.find('fileName', rec.get('fileName'));
728+
if (recIdx > -1) {
729+
var r = this.fileNameStore.getAt(recIdx);
730+
fields.inputFiles.push({
731+
fileName: r.get('fileName'),
732+
relPath: r.get('relPath')
733+
});
734+
}
735+
}
736+
else {
732737
fields.inputFiles.push({dataId: rec.get('fileId')});
738+
}
733739
}
734740
}, this);
735741

SequenceAnalysis/resources/web/SequenceAnalysis/window/ImportTrackWindow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Ext4.define('SequenceAnalysis.window.ImportTrackWindow', {
5151
name: 'track',
5252
allowBlank: false,
5353
validator: function(){
54-
var matcher = /^.*\.(bed|gff|gff3|gtf|vcf|bigwig|bw)$/i;
55-
return matcher.test(this.getValue()) ? true : 'File must be either: .bed, .gff, .gff3, .gtf, .vcf, .bigwig, or .bw';
54+
var matcher = /^.*\.(bed|gff|gff3|gtf|vcf|bigwig|bw|gbk)$/i;
55+
return matcher.test(this.getValue()) ? true : 'File must be either: .bed, .gff, .gff3, .gtf, .gbk, .vcf, .bigwig, or .bw';
5656
}
5757
},{
5858
xtype: 'textfield',

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ private File getFile(int fileIdx, Integer fileId)
236236

237237
public void cacheForRemoteServer()
238238
{
239-
getFile1();
240-
getFile2();
239+
if (!isArchived())
240+
{
241+
getFile1();
242+
getFile2();
243+
}
241244
}
242245

243246
@Transient

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ else if (o.containsKey("relPath") || o.containsKey("fileName"))
21492149

21502150
if (f == null || !f.exists())
21512151
{
2152-
throw new PipelineValidationException("Unknown file: " + o.getString("relPath"));
2152+
throw new PipelineValidationException("Unknown file: " + o.getString("relPath") + " / " + o.getString("fileName"));
21532153
}
21542154

21552155
ret.add(f);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,14 @@ else if (SequenceUtil.FILETYPE.vcf.getFileType().isType(file))
287287
else
288288
{
289289
getJob().getLogger().info("skipping VCF sort");
290+
SequenceAnalysisService.get().ensureVcfIndex(file, getJob().getLogger());
290291
}
291292
}
293+
else if (SequenceUtil.FILETYPE.gbk.getFileType().isType(file))
294+
{
295+
getJob().getLogger().debug("no processing needed: " + file.getName());
296+
FileUtils.moveFile(file, outputFile);
297+
}
292298
else
293299
{
294300
throw new PipelineJobException("Unsupported filetype: " + file.getName());

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.labkey.api.files.FileUrls;
1717
import org.labkey.api.pipeline.AbstractTaskFactory;
1818
import org.labkey.api.pipeline.AbstractTaskFactorySettings;
19+
import org.labkey.api.pipeline.CancelledException;
1920
import org.labkey.api.pipeline.PipeRoot;
2021
import org.labkey.api.pipeline.PipelineJob;
2122
import org.labkey.api.pipeline.PipelineJobException;
@@ -324,6 +325,11 @@ public void getOrphanFilesForContainer(Container c, User u, Set<File> orphanFile
324325
return;
325326
}
326327

328+
if (getJob().isCancelled())
329+
{
330+
throw new CancelledException();
331+
}
332+
327333
messages.add("## processing container: " + c.getPath());
328334

329335
Map<URI, Set<Integer>> dataMap = getDataMapForContainer(c);

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,19 @@ public AnalysisModel getCachedAnalysis(int rowId)
7373
return _cachedAnalyses.get(rowId);
7474
}
7575

76+
@Override
7677
public void cacheReadset(int readsetId, User u)
78+
{
79+
cacheReadset(readsetId,u, false);
80+
}
81+
82+
@Override
83+
public void cacheReadset(int readsetId, User u, boolean allowReadsetsWithArchivedData)
7784
{
7885
SequenceReadsetImpl rs = SequenceAnalysisServiceImpl.get().getReadset(readsetId, u);
7986
if (rs != null)
8087
{
81-
cacheReadset(rs);
88+
cacheReadset(rs, allowReadsetsWithArchivedData);
8289
}
8390
else
8491
{
@@ -88,9 +95,14 @@ public void cacheReadset(int readsetId, User u)
8895

8996
public void cacheReadset(SequenceReadsetImpl m)
9097
{
91-
if (m.hasArchivedData())
98+
cacheReadset(m, false);
99+
}
100+
101+
public void cacheReadset(SequenceReadsetImpl m, boolean allowReadsetsWithArchivedData)
102+
{
103+
if (!allowReadsetsWithArchivedData && m.hasArchivedData())
92104
{
93-
throw new IllegalArgumentException("Readset has archived data, cannot be used for pipeline jobs");
105+
throw new IllegalArgumentException("Readset has archived data, cannot be used for pipeline jobs", new Exception());
94106
}
95107

96108
m.cacheForRemoteServer();
@@ -113,6 +125,11 @@ public void cacheReadset(SequenceReadsetImpl m)
113125
}
114126

115127
public void cacheAnalysis(AnalysisModelImpl m, PipelineJob job)
128+
{
129+
cacheAnalysis(m, job, false);
130+
}
131+
132+
public void cacheAnalysis(AnalysisModelImpl m, PipelineJob job, boolean allowReadsetsWithArchivedData)
116133
{
117134
if (m.getAlignmentFile() != null)
118135
{
@@ -122,7 +139,7 @@ public void cacheAnalysis(AnalysisModelImpl m, PipelineJob job)
122139
if (m.getReadset() != null)
123140
{
124141
SequenceReadsetImpl rs = SequenceAnalysisServiceImpl.get().getReadset(m.getReadset(), job.getUser());
125-
cacheReadset(rs);
142+
cacheReadset(rs, allowReadsetsWithArchivedData);
126143
}
127144

128145
if (m.getLibraryId() != null)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ public RecordedActionSet run() throws PipelineJobException
9696

9797
if (f.getReadset() != null)
9898
{
99-
getPipelineJob().getSequenceSupport().cacheReadset(f.getReadset(), getJob().getUser());
99+
getPipelineJob().getSequenceSupport().cacheReadset(f.getReadset(), getJob().getUser(), true);
100100
}
101101

102102
if (f.getAnalysis_id() != null)
103103
{
104-
getPipelineJob().getSequenceSupport().cacheAnalysis(AnalysisModelImpl.getFromDb(f.getAnalysis_id(), getJob().getUser()), getJob());
104+
getPipelineJob().getSequenceSupport().cacheAnalysis(AnalysisModelImpl.getFromDb(f.getAnalysis_id(), getJob().getUser()), getJob(), true);
105105
}
106106
}
107107

0 commit comments

Comments
 (0)