Skip to content

Commit 92ec1c6

Browse files
committed
Use better relative paths for CITE-seq
1 parent 1a8ee15 commit 92ec1c6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

singlecell/src/org/labkey/singlecell/pipeline/singlecell/AbstractCellHashingCiteseqStep.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputHandler;
77
import org.labkey.api.singlecell.pipeline.AbstractSingleCellPipelineStep;
88
import org.labkey.api.singlecell.pipeline.SingleCellOutput;
9+
import org.labkey.api.util.FileUtil;
910
import org.labkey.api.writer.PrintWriters;
1011

1112
import 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
{

singlecell/src/org/labkey/singlecell/pipeline/singlecell/AppendCiteSeq.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ public File getAdtMetadata(File countMatrix)
145145
}
146146

147147
@Override
148-
protected Chunk createDataChunk(Map<Integer, File> hashingData)
148+
protected Chunk createDataChunk(Map<Integer, File> hashingData, File outputDir)
149149
{
150-
Chunk ret = super.createDataChunk(hashingData);
150+
Chunk ret = super.createDataChunk(hashingData, outputDir);
151151

152152
List<String> lines = new ArrayList<>();
153153

@@ -161,7 +161,7 @@ protected Chunk createDataChunk(Map<Integer, File> hashingData)
161161
else
162162
{
163163
File meta = getAdtMetadata(hashingData.get(key));
164-
lines.add("\t'" + key + "' = '" + meta.getName() + "',");
164+
lines.add("\t'" + key + "' = '" + getRelativePath(meta, outputDir) + "',");
165165
}
166166
}
167167

0 commit comments

Comments
 (0)