Skip to content

Commit

Permalink
Merge pull request #382 from esrice/fix-star-gzip-error
Browse files Browse the repository at this point in the history
Fix gzip error
  • Loading branch information
grst authored Oct 28, 2024
2 parents 44c9360 + 9d13a7e commit eaa74dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/local/simpleaf_quant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
Expand Down
8 changes: 7 additions & 1 deletion modules/local/star_align.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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.uncompressed.txt
else
cp $whitelist whitelist.uncompressed.txt
fi
STAR \\
--genomeDir $index \\
--readFilesIn ${reverse.join( "," )} ${forward.join( "," )} \\
--runThreadN $task.cpus \\
--outFileNamePrefix $prefix. \\
--soloCBwhitelist <(gzip -cdf $whitelist) \\
--soloCBwhitelist whitelist.uncompressed.txt \\
--soloType $protocol \\
--soloFeatures $star_feature \\
$other_10x_parameters \\
Expand Down

0 comments on commit eaa74dd

Please sign in to comment.