From e5c7ecc89c031b4c6ff9337adf98fa9840f9c224 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Mon, 30 Nov 2020 11:29:24 +0000 Subject: [PATCH] Use STAR to build initial index for RSEM --- software/rsem/preparereference/main.nf | 46 ++++++++++++++++++++------ 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/software/rsem/preparereference/main.nf b/software/rsem/preparereference/main.nf index 570eac76..982f6cdd 100644 --- a/software/rsem/preparereference/main.nf +++ b/software/rsem/preparereference/main.nf @@ -24,15 +24,41 @@ process RSEM_PREPAREREFERENCE { script: def software = getSoftwareName(task.process) - """ - mkdir rsem - rsem-prepare-reference \\ - --gtf $gtf \\ - --num-threads $task.cpus \\ - $options.args \\ - $fasta \\ - rsem/genome + def args = options.args.tokenize() + if (args.contains('--star')) { + args.removeIf { it.contains('--star') } + def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' + """ + mkdir rsem + STAR \\ + --runMode genomeGenerate \\ + --genomeDir rsem/ \\ + --genomeFastaFiles $fasta \\ + --sjdbGTFfile $gtf \\ + --runThreadN $task.cpus \\ + $memory \\ + $options.args2 + + rsem-prepare-reference \\ + --gtf $gtf \\ + --num-threads $task.cpus \\ + ${args.join(' ')} \\ + $fasta \\ + rsem/genome - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt - """ + rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + """ + } else { + """ + mkdir rsem + rsem-prepare-reference \\ + --gtf $gtf \\ + --num-threads $task.cpus \\ + $options.args \\ + $fasta \\ + rsem/genome + + rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + """ + } }