hsinnan75 / MapCaller

MapCaller – An efficient and versatile approach for short-read alignment and variant detection in high-throughput sequenced genomes
MIT License
29 stars 5 forks source link

Sort BAM by coordinate not name? #53

Closed tseemann closed 4 years ago

tseemann commented 4 years ago

The -bam output of MapCaller seems to be sorted by name. (like samtools sort -n)

Normally we want them sorted by coordinate (like samtools sort), so we can run samtools index and provide to other tools that assume coordinate sorting.

Could MapCaller produce coordinate-sorted BAMs ? Or does that not work because you align reads in order and write out results immediately?

To get around this I do this:

CPUS=18
MapCaller -i ref.fa -f R1.fq -f2 R2.fq -t $CPUS -no_vcf -bam - | samtools sort -@ $CPUS > out.bam
hsinnan75 commented 4 years ago

@tseemann Yes, MapCaller aligns reads in order and writes out results immediately. Therefore, it takes another step to sort all read alignments.

tseemann commented 4 years ago

Ok - will keep using samtools sort. Thank you!