66import org .labkey .api .sequenceanalysis .pipeline .SequenceOutputHandler ;
77import org .labkey .api .singlecell .pipeline .AbstractSingleCellPipelineStep ;
88import org .labkey .api .singlecell .pipeline .SingleCellOutput ;
9+ import org .labkey .api .util .FileUtil ;
910import org .labkey .api .writer .PrintWriters ;
1011
1112import java .io .File ;
@@ -35,7 +36,7 @@ protected File createRmd(SingleCellOutput output, SequenceOutputHandler.JobConte
3536 markdown .setup = new SetupChunk (getRLibraries ());
3637 markdown .chunks = new ArrayList <>();
3738 markdown .chunks .add (createParamChunk (inputObjects , outputPrefix ));
38- markdown .chunks .add (createDataChunk (countData ));
39+ markdown .chunks .add (createDataChunk (countData , ctx . getOutputDir () ));
3940
4041 markdown .chunks .addAll (getChunks ());
4142 markdown .chunks .add (createFinalChunk ());
@@ -50,7 +51,7 @@ protected File createRmd(SingleCellOutput output, SequenceOutputHandler.JobConte
5051 return outfile ;
5152 }
5253
53- protected Chunk createDataChunk (Map <Integer , File > hashingData )
54+ protected Chunk createDataChunk (Map <Integer , File > hashingData , File outputDir )
5455 {
5556 List <String > lines = new ArrayList <>();
5657
@@ -63,7 +64,7 @@ protected Chunk createDataChunk(Map<Integer, File> hashingData)
6364 }
6465 else
6566 {
66- lines .add ("\t '" + key + "' = '" + hashingData .get (key ). getName ( ) + "'," );
67+ lines .add ("\t '" + key + "' = '" + getRelativePath ( hashingData .get (key ), outputDir ) + "'," );
6768 }
6869 }
6970
@@ -77,6 +78,11 @@ protected Chunk createDataChunk(Map<Integer, File> hashingData)
7778 return new Chunk ("featureData" , null , null , lines , "include=FALSE" );
7879 }
7980
81+ protected String getRelativePath (File target , File outputDir )
82+ {
83+ return FileUtil .relativePath (outputDir .getPath (), target .getPath ());
84+ }
85+
8086 @ Override
8187 public boolean requiresHashingOrCiteSeq ()
8288 {
0 commit comments