Skip to content

Commit 7fb741a

Browse files
committed
Copy the metadata TSV file locally in seurat jobs
1 parent 9c198da commit 7fb741a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

singlecell/src/org/labkey/singlecell/analysis/AbstractSingleCellHandler.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void init(JobContext ctx, List<SequenceOutputFile> inputFiles, List<Recor
200200
{
201201
if (pd instanceof ToolParameterDescriptor.CachableParam)
202202
{
203-
ctx.getLogger().debug("caching params for : " + pd.getName());
203+
ctx.getLogger().debug("caching params for : " + pd.getName()+ ", with step idx: " + stepCtx.getStepIdx());
204204
Object val = pd.extractValue(ctx.getJob(), stepCtx.getProvider(), stepCtx.getStepIdx(), Object.class);
205205
((ToolParameterDescriptor.CachableParam)pd).doCache(ctx.getJob(), val, ctx.getSequenceSupport());
206206
}
@@ -433,6 +433,24 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
433433
{
434434
ctx.getLogger().debug("cellBarcodes TSV not found, expected: " + cellBarcodes.getPath());
435435
}
436+
437+
File metadataFile = CellHashingServiceImpl.get().getMetaTableFromSeurat(so.getFile(), false);
438+
if (metadataFile.exists())
439+
{
440+
ctx.getLogger().debug("Also making local copy of metadata TSV: " + metadataFile.getPath());
441+
File metadataFileLocal = new File(ctx.getOutputDir(), metadataFile.getName());
442+
if (metadataFileLocal.exists())
443+
{
444+
metadataFileLocal.delete();
445+
}
446+
447+
FileUtils.copyFile(metadataFile, metadataFileLocal);
448+
_resumer.getFileManager().addIntermediateFile(metadataFileLocal);
449+
}
450+
else
451+
{
452+
ctx.getLogger().warn("metadataFile TSV not found, expected: " + metadataFile.getPath());
453+
}
436454

437455
currentFiles.add(new SingleCellStep.SeuratObjectWrapper(datasetId, datasetId, local, so));
438456
}

0 commit comments

Comments
 (0)