3
$\begingroup$

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.

$\endgroup$
3
$\begingroup$

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

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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