Skip to content

Commit fcbd3fe

Browse files
authored
Merge pull request #33 from BimberLab/fb_merge_discvr-20.11
Merge discvr-20.11 to discvr-21.3
2 parents c04637e + b75fafe commit fcbd3fe

File tree

5 files changed

+51
-5
lines changed

5 files changed

+51
-5
lines changed

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,24 @@ public List<SequenceOutput> getSequenceOutputs()
105105
@Override
106106
public void addSequenceOutput(File file, String label, String category, @Nullable Integer readsetId, @Nullable Integer analysisId, @Nullable Integer genomeId, @Nullable String description)
107107
{
108+
_intermediateFiles.remove(file);
109+
108110
_sequenceOutputs.add(new SequenceOutput(file, label, category, readsetId, analysisId, genomeId, description));
109111
}
110112

113+
private boolean existsAsOutput(File f)
114+
{
115+
for (Pair<File, String> pair : _outputs)
116+
{
117+
if (pair.first != null && pair.first.equals(f))
118+
{
119+
return true;
120+
}
121+
}
122+
123+
return false;
124+
}
125+
111126
@Override
112127
public void addInput(File input, String role)
113128
{
@@ -132,13 +147,16 @@ public void addIntermediateFile(File file, String role)
132147
if (role != null)
133148
addOutput(file, role);
134149

135-
_intermediateFiles.add(file);
150+
if (!existsAsOutput(file))
151+
{
152+
_intermediateFiles.add(file);
153+
}
136154
}
137155

138156
@Override
139157
public void addIntermediateFiles(Collection<File> files)
140158
{
141-
_intermediateFiles.addAll(files);
159+
files.forEach(this::addIntermediateFile);
142160
}
143161

144162
public void addPicardMetricsFile(Readset rs, File metricFile, File inputFile)

SequenceAnalysis/resources/views/sequenceAnalysisDetails.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
queryName: 'quality_metrics',
6969
maxRows: 20,
7070
containerPath: Laboratory.Utils.getQueryContainerPath(),
71-
columns: 'fileid,metricname,metricvalue,qualvalue,comment,workbook,readset,runid',
71+
columns: 'dataid,metricname,metricvalue,qualvalue,comment,workbook,readset,runid',
7272
filterArray: [LABKEY.Filter.create('analysis_id', analysisId, LABKEY.Filter.Types.EQUAL)]
7373
}).render('qualityMetrics_'+webpart.wrapperDivId);
7474

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,27 @@ private File convertRelPathToFile(String line)
401401
public void addIntermediateFile(File f)
402402
{
403403
_job.getLogger().debug("adding intermediate file: " + f.getPath());
404-
_intermediateFiles.add(f);
404+
if (existsAsOutput(f))
405+
{
406+
_job.getLogger().debug("file exists as sequence output, will not put into intermediate files");
407+
}
408+
else
409+
{
410+
_intermediateFiles.add(f);
411+
}
412+
}
413+
414+
private boolean existsAsOutput(File f)
415+
{
416+
for (SequenceOutputFile so : _outputsToCreate)
417+
{
418+
if (so.getFile() != null && so.getFile().equals(f))
419+
{
420+
return true;
421+
}
422+
}
423+
424+
return false;
405425
}
406426

407427
@Override

singlecell/api-src/org/labkey/api/singlecell/pipeline/AbstractSingleCellPipelineStep.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public Output execute(SequenceOutputHandler.JobContext ctx, List<SeuratObjectWra
100100
File intermediates = new File(ctx.getOutputDir(), "intermediateFiles.txt");
101101
if (intermediates.exists())
102102
{
103+
getPipelineCtx().getLogger().debug("inspecting intermediateFiles.txt");
103104
try (CSVReader reader = new CSVReader(Readers.getReader(intermediates), '\t'))
104105
{
105106
String[] line;

singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,14 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
905905
}
906906

907907
File htmlFile = new File(outputDir, basename + ".html");
908+
File localHtml = new File(localPipelineDir, htmlFile.getName());
909+
910+
// Note: if this job fails and then is resumed, having that pre-existing copy of the HTML can pose a problem
911+
if (localHtml.exists())
912+
{
913+
log.debug("Deleting pre-existing HTML file: " + localHtml.getPath());
914+
}
915+
908916
File callsFile = new File(outputDir, basename + CALL_EXTENSION);
909917
File metricsFile = getMetricsFile(callsFile);
910918

@@ -1011,7 +1019,6 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
10111019
{
10121020
try
10131021
{
1014-
File localHtml = new File(localPipelineDir, htmlFile.getName());
10151022
log.info("copying HTML file locally for easier debugging: " + localHtml.getPath());
10161023
if (localHtml.exists())
10171024
{

0 commit comments

Comments
 (0)