Skip to content

Commit 0ca0e1c

Browse files
committed
velocyto bugfixes
1 parent 3a83c60 commit 0ca0e1c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

singlecell/src/org/labkey/singlecell/run/CellRangerWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private void createSymLink(File input, File target) throws IOException
170170
Files.createSymbolicLink(target.toPath(), input.toPath());
171171
}
172172

173-
public String makeLegalSampleName(String sampleName)
173+
public static String makeLegalSampleName(String sampleName)
174174
{
175175
return FileUtil.makeLegalName(sampleName.replaceAll("_", "-")).replaceAll(" ", "-").replaceAll("\\.", "-").replaceAll("\\+", "");
176176
}

singlecell/src/org/labkey/singlecell/run/VelocytoAlignmentStep.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ else if (!gtf.exists())
7777
}
7878
}
7979

80-
File loom = new VelocytoWrapper(getPipelineCtx().getLogger()).runVelocytoFor10x(localBam, gtf, outputDirectory, mask);
80+
File loom = new VelocytoWrapper(getPipelineCtx().getLogger()).runVelocytoFor10x(localBam, gtf, outputDirectory, mask, rs);
8181
output.addSequenceOutput(loom, rs.getName() + ": velocyto", "Velocyto Counts", rs.getReadsetId(), null, referenceGenome.getGenomeId(), null);
8282

8383
return output;
@@ -96,7 +96,7 @@ public VelocytoWrapper(Logger log)
9696
super(log);
9797
}
9898

99-
public File runVelocytoFor10x(File localBam, File gtf, File outputFolder, @Nullable File mask) throws PipelineJobException
99+
public File runVelocytoFor10x(File localBam, File gtf, File outputFolder, @Nullable File mask, Readset rs) throws PipelineJobException
100100
{
101101
// https://velocyto.org/velocyto.py/tutorial/cli.html#run10x-run-on-10x-chromium-samples
102102
// velocyto run10x -m repeat_msk.gtf mypath/sample01 somepath/refdata-cellranger-mm10-1.2.0/genes/genes.gtf
@@ -111,7 +111,8 @@ public File runVelocytoFor10x(File localBam, File gtf, File outputFolder, @Nulla
111111
args.add(outputFolder.getPath());
112112

113113
args.add("-b");
114-
File barcodeCSV = new File(localBam.getParentFile(), "outs/raw_feature_bc_matrix/barcodes.tsv.gz");
114+
String sampleName = CellRangerWrapper.makeLegalSampleName(rs.getName());
115+
File barcodeCSV = new File(localBam.getParentFile(), sampleName + "/outs/raw_feature_bc_matrix/barcodes.tsv.gz");
115116
if (!barcodeCSV.exists())
116117
{
117118
throw new PipelineJobException("Unable to find file: " + barcodeCSV.getPath());
@@ -136,7 +137,7 @@ public File runVelocytoFor10x(File localBam, File gtf, File outputFolder, @Nulla
136137

137138
wrapper.execute(args);
138139

139-
File loom = new File(outputFolder, "sample.loom");
140+
File loom = new File(outputFolder, sampleName + ".loom");
140141
if (!loom.exists())
141142
{
142143
throw new PipelineJobException("Missing expected file: " + loom.getPath());

0 commit comments

Comments
 (0)