From 527d9358b9475d55cfdc04d0e8ebf72abd6f9d5f Mon Sep 17 00:00:00 2001 From: "Gervaise H. Henry" <gervaise.henry@utsouthwestern.edu> Date: Mon, 18 Jan 2021 21:38:31 -0600 Subject: [PATCH] Move mem param to sort --- workflow/rna-seq.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/rna-seq.nf b/workflow/rna-seq.nf index 23d59c8..abec019 100644 --- a/workflow/rna-seq.nf +++ b/workflow/rna-seq.nf @@ -757,13 +757,13 @@ process alignSampleData { # convert the output sam file to a sorted bam file using Samtools echo -e "LOG: converting from sam to bam" >> ${repRID}.${ref}.alignSampleData.log - samtools view -1 -@ `nproc` -m \${mem}K -F 4 -F 8 -F 256 -o ${ref}.sampled.bam ${ref}.sampled.sam + samtools view -1 -@ `nproc` -F 4 -F 8 -F 256 -o ${ref}.sampled.bam ${ref}.sampled.sam # sort the bam file using Samtools echo -e "LOG: sorting the bam file" >> ${repRID}.${ref}.alignSampleData.log mem=\$(vmstat -s -S K | grep 'total memory' | grep -o '[0-9]*') mem=\$(expr \${mem} / `nproc` \\* 85 / 100) - samtools sort -@ `nproc` -O BAM -o ${ref}.sampled.sorted.bam ${ref}.sampled.bam + samtools sort -@ `nproc` -m \${mem}K -O BAM -o ${ref}.sampled.sorted.bam ${ref}.sampled.bam # index the sorted bam using Samtools echo -e "LOG: indexing sorted bam file" >> ${repRID}.${ref}.alignSampleData.log -- GitLab