yay it works.thank you very much GenoMax.
Hello everyone
I am trying to convert sam to bam
samtools sort -@ 8 -o UHR_Rep1.bam UHR_Rep1.sam
and I got this error
samtools sort: couldn't allocate memory for bam_mem
I check my disk memory and I see have enough space in my disk.How I can achieve this problem?
1 answer
Depending on the size of the BAM file you have you may not be able to do this on your machine. You have only 3.7 G of RAM out of which 1.2 G seems to be available when you ran the above command. Generally samtools will use temporary files to do the sort (and writes them to the directory you ran this from, I assume that is the disk where you have space).
I suggest that you try this sort with just one thread (i.e remove -@ 8) and see if following works. It may take a while to sort the file so be patient if the following starts running without the memory error.
samtools sort -o UHR_Rep1.bam UHR_Rep1.sam
Yes, because each additional thread needs about 800MB of memory by default so that exceeded what you had when using 8 threads.
Log in to answer this question.
Output of
free -mh? Disk space != memory fyido you asked for it ? ı dont know how much it is need.
How ı can allocate mem properly for convert to sam to bam file via samtools