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

Copy samtools mem param fix to align sample

parent 4ed64765
2 merge requests!65Develop,!64Resolve "samtools sort: couldn't allocate memory for bam_mem"
Pipeline #9044 passed with stages
in 3 minutes and 18 seconds
......@@ -757,10 +757,12 @@ 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` -F 4 -F 8 -F 256 -o ${ref}.sampled.bam ${ref}.sampled.sam
samtools view -1 -@ `nproc` -m \${mem}K -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
# index the sorted bam using Samtools
......
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