I used the following command for the sorting of bam file (samtools sort eg2.bam -o eg2.sorted.bam) size of my sam file was 44.6GB and after conversion into bam it is 35GB. sorting of bam file is producing a large no. of temporary files in MB.
I used the following command for the sorting of bam file (samtools sort eg2.bam -o eg2.sorted.bam) size of my sam file was 44.6GB and after conversion into bam it is 35GB. sorting of bam file is producing a large no. of temporary files in MB.
SAMtools by default uses 768Mb memory per thread, so when sorting larger bams it will have to write a large amount of temporary files to disk. If you have RAM memory available, you can reduce disk writing (and execution time) by giving samtools more memory per thread:
-m INT Set maximum memory per thread; suffix K/M/G recognized [768M]
As cpad0112 stated, when the sorting is finished, all temporary files are deleted and only the final sorted file should remain. If this is not the case, samtools sort
did not finish successfully.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
either you can furnish a temporary directory for storing temporary files or wait till the process is over. Only one sorted bam file be output as per OP function. iqraishtiaq411
indexing of .bam file is giving this error . how it would be handle ?
Check this
Are you using the latest version of samtools?
samtools 1.7 Using htslib 1.7-2 Copyright (C) 2018 Genome Research Ltd.