Skip to content
Snippets Groups Projects
Commit 5988eb64 authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Add -m to samtools sort

parent adf2b8be
2 merge requests!65Develop,!64Resolve "samtools sort: couldn't allocate memory for bam_mem"
Pipeline #9042 passed with stages
in 3 minutes and 11 seconds
...@@ -1451,7 +1451,9 @@ process alignData { ...@@ -1451,7 +1451,9 @@ process alignData {
# sort the bam file using Samtools # sort the bam file using Samtools
echo -e "LOG: sorting the bam file" >> ${repRID}.align.log echo -e "LOG: sorting the bam file" >> ${repRID}.align.log
samtools sort -@ `nproc` -O BAM -o ${repRID}.sorted.bam ${repRID}.bam mem=\$(vmstat -s -S K | grep 'total memory' | grep -o '[0-9]*')
mem=\$(expr \${mem} / `nproc` \* 85 / 100)
samtools sort -@ `nproc` -m \${mem}K -O BAM -o ${repRID}.sorted.bam ${repRID}.bam
# index the sorted bam using Samtools # index the sorted bam using Samtools
echo -e "LOG: indexing sorted bam file" >> ${repRID}.align.log echo -e "LOG: indexing sorted bam file" >> ${repRID}.align.log
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment