Heng Li wrote: > samtools calmd does not really work with name sorted files. It spent all the > 12 hours to repeatedly load reference fasta.
Hmm, although I did it in the pipeline originally in these steps: samtools sort -@ $xthreads -n -m 4G -O bam -T "$sample" -o "$sample".realignedtogether.BQSR.namesorted.bam "$sample".realignedtogether.BQSR.bam samtools fixmate -O bam "$sample".realignedtogether.BQSR.namesorted.bam "$sample".realignedtogether.BQSR.namesorted.fixmate.bam samtools calmd -EArb "$sample".realignedtogether.BQSR.namesorted.fixmate.bam "$reference" > "$sample".realignedtogether.BQSR.namesorted.fixmate.calmd.bam you are probably right it kept the ordering. Hmm, I needed "samtools sort -n" for the "samtools fixmate" step as input. Although without testing, Bingo! ;-) Of course I could have used shell pipes -- but I wanted to have the BAM available after each step. Martin > > Heng > > On Aug 2, 2016, at 9:47 AM, Martin MOKREJŠ <mmokr...@gmail.com> wrote: > >> Keiran Raine wrote: >>> For BAM in/out yes: >>> >>> inputthreads=<[1]> : input helper threads (for inputformat=bam >>> only, default: 1) >>> outputthreads=<[1]> : output helper threads (for outputformat=bam >>> only, default: 1) >> >> bamsort fixmates=1 calmdnm=1 calmdnmreference="$reference" blockmb=40960 >> inputthreads=8 outputthreads=8 level=9 >> I="$sample".realignedtogether.BQSR.namesorted.bam >> O="$sample".realignedtogether.BQSR.namesorted.fixmate.calmd.bam >> >> The above takes about 3 cores during input and since much later it starts >> writing output it takes 8 cores. Maybe just because of the extreme output >> compression only. But definitely, it outperformed "samtools clamd" step >> doing half of the work (just MD: tag calculations). Actually, processing the >> whole file took maybe 2 minutes in total? "samtools calmd" ran out of >> wallclock time limit at 12hrs on a cluster node (running on a single core). >> >> Thank you for pointing me to bamsort, I added biobambam2 with libmaus2 to my >> Gentoo Linux recently (is in science overlay now), so it was simple to call >> it. ------------------------------------------------------------------------------ _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help