Skip to content

Commit ad5a2f4

Browse files
committed
Allow readset handlers to work on archived data
1 parent cabeb69 commit ad5a2f4

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ default boolean requiresGenome()
8585

8686
public boolean canProcess(SequenceOutputFile o);
8787

88+
default boolean supportsSraArchivedData()
89+
{
90+
return false;
91+
}
92+
8893
/**
8994
* If false, this handler will not be returned with the list of available handlers for a given set of files.
9095
* This allows the developer to register handlers that feed into the pipeline, but can only be called through specific code/UI

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3546,7 +3546,7 @@ private JSONObject getDataJsonForReadset(SequenceOutputHandler handler, Readset
35463546
o.put("totalReadData", rs.getReadData().size());
35473547
for (ReadData rd : rs.getReadData())
35483548
{
3549-
if (rd.isArchived())
3549+
if (rd.isArchived() && !handler.supportsSraArchivedData())
35503550
{
35513551
o.put("fileExists", false);
35523552
o.put("isArchived", true);
@@ -3557,19 +3557,25 @@ private JSONObject getDataJsonForReadset(SequenceOutputHandler handler, Readset
35573557
ExpData d = rd.getFileId1() == 0 ? null : ExperimentService.get().getExpData(rd.getFileId1());
35583558
if (d == null || d.getFile() == null || !d.getFile().exists())
35593559
{
3560-
o.put("fileExists", false);
3561-
o.put("error", true);
3562-
return o;
3560+
if (!handler.supportsSraArchivedData())
3561+
{
3562+
o.put("fileExists", false);
3563+
o.put("error", true);
3564+
return o;
3565+
}
35633566
}
35643567

35653568
if (rd.getFileId2() != null)
35663569
{
35673570
d = rd.getFileId2() == 0 ? null : ExperimentService.get().getExpData(rd.getFileId2());
35683571
if (d == null || d.getFile() == null || !d.getFile().exists())
35693572
{
3570-
o.put("fileExists", false);
3571-
o.put("error", true);
3572-
return o;
3573+
if (!handler.supportsSraArchivedData())
3574+
{
3575+
o.put("fileExists", false);
3576+
o.put("error", true);
3577+
return o;
3578+
}
35733579
}
35743580
}
35753581
}

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/RestoreSraDataHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ public boolean canProcess(SequenceOutputFile o)
6666
return false;
6767
}
6868

69+
@Override
70+
public boolean supportsSraArchivedData()
71+
{
72+
return true;
73+
}
74+
6975
@Override
7076
public boolean doRunRemote()
7177
{

0 commit comments

Comments
 (0)