biod / sambamba

Tools for working with SAM/BAM data
http://thebird.nl/blog/D_Dragon.html
GNU General Public License v2.0
558 stars 104 forks source link

sambamba-sort - Too many open files #403

Closed msubirana closed 4 years ago

msubirana commented 5 years ago

I get this error

sambamba-sort: Cannot open or create file 
'/imppc/labs/lplab/share/marc/insulinomas/processed/bam/hg38/bwa/Sambamba/sambamba-pid14901-xxib/stdin.339' : Too many open files

Running

bwa mem -M -t $cores \
    -R "@RG\\tID:${filename}\\tPU:1\\tSM:${filename}\\tPL:ILLUMINA" \
    ${ref} ${file} ${file2} | \
    sambamba view /dev/stdin -S -f bam -t $cores | \
    sambamba sort /dev/stdin -t $cores -o ${outPath}/${filename}.bam --tmpdir ${outPath}  \
    sambamba index -t $cores ${outPath}/${filename}.bam

The fq.gz files are about 30gb (being paired-end)

pjotrp commented 5 years ago

That is a systems setting. You can try to increase -m memory limit to reduce chunks. Also test without pipes.