Skip to content

Commit 056f19c

Browse files
committed
Allow certain jobs to run when the readset has archived reads
1 parent 97b5215 commit 056f19c

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
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/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/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

cluster/src/org/labkey/cluster/ClusterController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public boolean handlePost(JobIdsForm form, BindException errors) throws Exceptio
201201
return false;
202202
}
203203

204-
if (!PipelineJob.TaskStatus.running.name().equalsIgnoreCase(sf.getStatus()))
204+
if (PipelineJob.TaskStatus.running.name().equalsIgnoreCase(sf.getStatus()))
205205
{
206206
errors.reject(ERROR_MSG, "This cannot be used on actively running jobs. Status was: " + sf.getStatus());
207207
return false;

0 commit comments

Comments
 (0)