This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Order of samtools mpileup - arbitrary or not?

Hi,

edited to clarify

I want to compare two mpileup files that have the same no. of reads. is the mpileup output ordered or not? If I have several reads that are ordered 1,2 ...n, will mpileup list them in the order in which they entered the pileup?

i.e.

Read1
A

Read2
C

Read3
C

Readn
G

will the pileup look like this (ordered)

chr   100  A     ACCG

or might it be random, like perhaps

chr   100  A     AGCC

or any other combination? (there are other positions around this pileup, like position 99 and 101, this is a specific position just to clarify my meaning)

thanks,

samtools mpileup

Can you clarify your question? There are going to be additional bases around a specific position you are looking at.

1 answer

The pileup will be ordered by the order of the reads in the BAM file. This isn't strictly guaranteed, it's a by-product of how the code works under the hood.

Log in to answer this question.