Hi Martin Thanks for the suggestion - I'll give it a try!
Best Sergej Dr. Sergej Nowoshilow Post-doc in Tanaka Lab Elly Tanaka group Animal models of regeneration Campus-Vienna-Biocenter 1 1030 Vienna email: sergej.nowoshi...@imp.ac.at phone: +43 (0) 1 79730 3203 This message is confidential and may contain privileges information. It is intended for the named recipients only. If you receive it in error please notify me and permanently delete the original message and any copies. Am 10.03.18, 12:51 schrieb "Martin MOKREJŠ" <mmokr...@gmail.com>: Hi Sergei, maybe you want to try biobambam2 (based on libmaus2). The bamsort is IMO superior to samtools. The tricks are to increase write chunk sizes. You can eventually for mu Closed issue on github under biobambam2 project where I experienced performance issues, resulting in the below tweaks. Nowoshilow,Sergej napsal(a): > > The reads map beyond 1,073,741,824. > > > > I guess I’ll just write a small sorting utility. take_memory=57344 # * 1024 = 56GB through bamsort sort_bam_file(){ # samtools sort of a 149GB BAM file takes 1.2TB RAM and uses only a single thread despite '-@ 15' argument # samtools sort -@ $xthreads -m "$gb_mem_per_thread"G -O bam -T "$1" -o "$2".sorted.bam "$2".bam || exit 255 LIBMAUS2_POSIXFDINPUT_BLOCKSIZE_OVERRIDE==1m export LIBMAUS2_POSIXFDINPUT_BLOCKSIZE_OVERRIDE bamsort SO=coordinate blockmb="$take_memory" sortthreads="$sort_threads" inputthreads="$input_threads" outputthreads="$output_threads" level=9 index=1 I="$2".bam O="$2".sorted.bam || exit 255 } sort_bam_file_by_name(){ # samtools sort of a 149GB BAM file takes 1.2TB RAM and uses only a single thread despite '-@ 15' argument # samtools sort -@ "${xthreads}" -n -m "${gb_mem_per_thread}"G -O bam -T "$1" -o "$2".namesorted.bam "$2".bam || exit 255 LIBMAUS2_POSIXFDINPUT_BLOCKSIZE_OVERRIDE==1m export LIBMAUS2_POSIXFDINPUT_BLOCKSIZE_OVERRIDE bamsort SO=queryname blockmb="$take_memory" sortthreads="$sort_threads" inputthreads="$input_threads" outputthreads="$output_threads" level=9 index=1 I="$2".bam O="$2".namesorted.bam || exit 255 } Hope this helps, Martin ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help