From 81ba00167925a5606fe3e7222d63b17a1e687e07 Mon Sep 17 00:00:00 2001 From: "Edward S. Rice" Date: Fri, 11 Oct 2024 14:54:11 +0200 Subject: [PATCH 1/3] Fix #380 --- modules/local/star_align.nf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/local/star_align.nf b/modules/local/star_align.nf index 4b3df1e1..b7e2bf58 100644 --- a/modules/local/star_align.nf +++ b/modules/local/star_align.nf @@ -54,12 +54,18 @@ process STAR_ALIGN { // separate forward from reverse pairs def (forward, reverse) = reads.collate(2).transpose() """ + if [[ $whitelist == *.gz ]]; then + gzip -cdf $whitelist > whitelist.txt + else + cp $whitelist whitelist.txt + fi + STAR \\ --genomeDir $index \\ --readFilesIn ${reverse.join( "," )} ${forward.join( "," )} \\ --runThreadN $task.cpus \\ --outFileNamePrefix $prefix. \\ - --soloCBwhitelist <(gzip -cdf $whitelist) \\ + --soloCBwhitelist whitelist.txt \\ --soloType $protocol \\ --soloFeatures $star_feature \\ $other_10x_parameters \\ From 017e0d3ef954b0e6b4b347a76d217f291ae5f1af Mon Sep 17 00:00:00 2001 From: "Edward S. Rice" Date: Fri, 11 Oct 2024 15:26:40 +0200 Subject: [PATCH 2/3] Fix same error as last commit, but for alevin The alevin-fry workflow for this pipeline has the same issue as the STAR workflow: it assumes the whitelist is gzipped, and crashes if it is not. This commit fixes that by only trying to unzip the whitelist if it is in fact gzipped. --- modules/local/simpleaf_quant.nf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/local/simpleaf_quant.nf b/modules/local/simpleaf_quant.nf index abb58404..53e0ccb2 100644 --- a/modules/local/simpleaf_quant.nf +++ b/modules/local/simpleaf_quant.nf @@ -39,7 +39,11 @@ process SIMPLEAF_QUANT { save_whitelist = "" if (!(args_list.any { it in ['-k', '--knee', '-e', '--expect-cells', '-f', '--forced-cells']} || meta.expected_cells)) { if (whitelist) { - unzip_whitelist = "gzip -dcf $whitelist > whitelist.uncompressed.txt" + if (whitelist.name.endsWith('.gz')) { + unzip_whitelist = "gzip -dcf $whitelist > whitelist.uncompressed.txt" + } else { + unzip_whitelist = "cp $whitelist whitelist.uncompressed.txt" + } unfiltered_command = "-u whitelist.uncompressed.txt" save_whitelist = "mv whitelist.uncompressed.txt ${prefix}_alevin_results/" } From 9d13a7e1e113c51428db41a9d912d531f8ccaa09 Mon Sep 17 00:00:00 2001 From: "Edward S. Rice" Date: Mon, 28 Oct 2024 11:41:36 +0100 Subject: [PATCH 3/3] Fix potential filename conflict Call the uncompressed whitelist whitelist.uncompressed.txt instead of whitelist.txt. --- modules/local/star_align.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/local/star_align.nf b/modules/local/star_align.nf index b7e2bf58..0b26e037 100644 --- a/modules/local/star_align.nf +++ b/modules/local/star_align.nf @@ -55,9 +55,9 @@ process STAR_ALIGN { def (forward, reverse) = reads.collate(2).transpose() """ if [[ $whitelist == *.gz ]]; then - gzip -cdf $whitelist > whitelist.txt + gzip -cdf $whitelist > whitelist.uncompressed.txt else - cp $whitelist whitelist.txt + cp $whitelist whitelist.uncompressed.txt fi STAR \\ @@ -65,7 +65,7 @@ process STAR_ALIGN { --readFilesIn ${reverse.join( "," )} ${forward.join( "," )} \\ --runThreadN $task.cpus \\ --outFileNamePrefix $prefix. \\ - --soloCBwhitelist whitelist.txt \\ + --soloCBwhitelist whitelist.uncompressed.txt \\ --soloType $protocol \\ --soloFeatures $star_feature \\ $other_10x_parameters \\