Take the 2-minute tour ×
Biology Stack Exchange is a question and answer site for biology researchers, academics, and students. It's 100% free, no registration required.

How do I display a single nucleotide position from reads in a BAM file? I have been looking at variation using samtools mpileup, but I want to actually just display the nucleotide at the position I am interested in. This seems like you should be able to do it but I can't figure out how.

To be clear I have a BAM file of a bunch of reads. I'm looking to do something like samtools magic reads.bam chr3:10000 where I get back something like:

T T T T T T T T T T T T T T T T T T T A A A A A A A A A A A A A.

I just want to sanity check the output of bcftools by actually looking at the base calls.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Your best option is to create a tab delimited position list file:

chr3    1000

You can then use the samtools mpileup -l pos.txt option

-l FILE      list of positions (chr pos) or regions (BED)

This file can also be in bed format if you are interested in specific regions

share|improve this answer
    
Thanks! This worked great, just what I was looking for. –  rory Feb 27 '12 at 22:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.