samtools : print single columns at position
1
1
Entering edit mode
9.7 years ago
sacha ★ 2.4k

How can I print only 1 column from a BAM file at specific coordinate.

For example:

ACGTGACGGACGGGGCCA
   TGACGGACGGGGCCA
       GGACGGGGCCA
         ^

For example print the column at coord 'x' will return AAA (see example above)

print position samtools • 1.7k views
ADD COMMENT
2
Entering edit mode
9.7 years ago
John 13k

Maybe something like this?

/package/samtools/samtools mpileup ./your.bam | cut -f 1,2,5

That will give you a chromosome, base position (1-based) and a string similar to what you're looking for, but is case sensitive (strand) and has some other symbols for mismatches, etc.

Check out: http://samtools.sourceforge.net/pileup.shtml

ADD COMMENT
1
Entering edit mode

Thanks! But the problem is that mpileup filter data. I just want to see raw data from BAM , like samtools tview.

ADD REPLY
1
Entering edit mode

Sorry.. I just see that mpilup do for each base and do not filter ! Thanks! You were right and solve my problem

ADD REPLY

Login before adding your answer.

Traffic: 1693 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6