Skip to content

Commit 9a6abc8

Browse files
committed
Bugfix to RestoreSraDataHandler for new SRA datasets
1 parent 4b3fd43 commit 9a6abc8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,36 @@ public void init(PipelineJob job, SequenceAnalysisJobSupport support, List<Reads
149149
throw new PipelineJobException("Missing accession for archived readdata: " + rd.getRowid());
150150
}
151151

152+
// This indicates there is no pipeline job and no file, meaning it was imported as a TSV with SRA info. Therefore use this job's folder as the output location:
153+
if (rd.getRunId() == null)
154+
{
155+
ExpData f1 = ExperimentService.get().getExpData(rd.getFileId1());
156+
if (f1 == null)
157+
{
158+
throw new PipelineJobException("Missing Expdata: " + rd.getFileId1());
159+
}
160+
161+
if (!f1.getFile().exists() && !f1.getFile().getParentFile().exists())
162+
{
163+
f1.setDataFileURI(new File(outputDir, accession + "_1.fastq.gz").toURI());
164+
f1.save(job.getUser());
165+
job.getLogger().debug("Updating filepath: " + f1.getFile().getPath());
166+
167+
if (rd.getFileId2() != null)
168+
{
169+
ExpData f2 = ExperimentService.get().getExpData(rd.getFileId2());
170+
if (f2 == null)
171+
{
172+
throw new PipelineJobException("Missing Expdata: " + rd.getFileId2());
173+
}
174+
175+
f2.setDataFileURI(new File(outputDir, accession + "_2.fastq.gz").toURI());
176+
f2.save(job.getUser());
177+
job.getLogger().debug("Updating filepath: " + f2.getFile().getPath());
178+
}
179+
}
180+
}
181+
152182
totalArchivedPairs++;
153183
support.cacheExpData(ExperimentService.get().getExpData(rd.getFileId1()));
154184
if (rd.getFileId2() != null)

0 commit comments

Comments
 (0)