Mpileup: View The Bases That Were Involved In Making The Call
1
0
Entering edit mode
12.3 years ago
Lee Katz ★ 3.2k

Hi, I want to use samtools mpileup because it's not deprecated, but I want to be able to perform the base calling myself. The pileup command is deprecated but shows the actual bases involved in making the call which is awesome. Is there a way to output the bases in the mpileup command so that I can make my own call? Thereby, getting the best of both worlds: not deprecated and also showing the base pileup?

mpileup samtools • 3.2k views
ADD COMMENT
4
Entering edit mode
12.3 years ago
matted 7.8k

It will do that by default if you don't output in BCF format (that is, omit -b). It will give you:

chr10   250     N       85      A$A$A$a$AaaAAaaaaTaaaaaAaAaaaAAAaaaAaAaaaaaaaaAAaaaaaAAaAaaaaaaaAaaaaaAAaAaaAaaaaaaAaAaa^!a     hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
chr10   251     N       85      A$a$a$AAaaaaAaaaaaAaAaaaAAAaaaAaAaaaaaaaaAAaaaaaAAaAaaaaaaaAaaaaaAAaAaaAaaaaaaAaAgaa^!A^!a^!A^!a        hhhhhhhhhdhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
chr10   252     N       85      G$G$g$g$ggGgggggGgGgggGGGgggGgGggggggggGGgggggGGgGgggggggGgggggGGgGggGggggggGgGgggGgGg^!g^!g^!g hhhhhhhhhhhhhhhhhhhhKhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhXhhhhhhhhhhhJhXh
chr10   253     N       83      c$c$CcccccCcCcccCCCcccCcCccccccccCCcccccCCcCcccccccCcccccCCcCccCccccccCcCcccCcCcccc^!C^!c       hhghhhhhhhhhhhhhHhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
chr10   254     N       84      T$t$t$tttTtTtttTTTtttTtTttttttttTTtttttTTtTtttttttTtttttTTtTttTttttttTtTtttTtTttttTt^!T^!T^!t   hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
chr10   255     N       83      a$a$aAaAaaaAAAaaaAaAaaaaaaaaAAaaaaaAAaAaaaaaaaAaaaaaAAaAaaAaaaaaaAaAaaaAaAaaaaAaAAa^!a^!a       hhhhhhhhhhh>hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

And if you specific the reference (with -f) it will replace matching bases with . or ,, depending on the strand:

chr10   250     A       84      .$.$.$,$.,,..,,,,T,,,,,.,.,,,...,,,.,.,,,,,,,,..,,,,,..,.,,,,,,,.,,,,,..,.,,.,,,,,,.,.,^!,      ::::AAAYYYY\\EeehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfhhhhhhMhD\\\[[BB;;=
chr10   251     A       84      .$,$,$..,,,,.,,,,,.,.,,,...,,,.,.,,,,,,,,..,,,,,..,.,,,,,,,.,,,,,..,.,,.,,,,,,.,.,,^!.^!,^!.^!, ???TTTT\\EeehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfhhhhhhPhG\\\]]EE>>>EEEE
chr10   252     G       84      .$.$,$,$,,.,,,,,.,.,,,...,,,.,.,,,,,,,,..,,,,,..,.,,,,,,,.,,,,,..,.,,.,,,,,,.,.,,.,.,^!,^!,^!,  EEEEUUEeehhhhhhhhhhhKhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhXhhhhhheUUUJEEE
chr10   253     C       83      ,$,$.,,,,,.,.,,,...,,,.,.,,,,,,,,..,,,,,..,.,,,,,,,.,,,,,..,.,,.,,,,,,.,.,,,.,.,,,,^!.^!,       EEEUUeehhhhhhhhhHhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdhheeeeUUUEE
chr10   254     T       84      .$,$,$,,,.,.,,,...,,,.,.,,,,,,,,..,,,,,..,.,,,,,,,.,,,,,..,.,,.,,,,,,.,.,,,.,.,,,,.,^!.^!.^!,   ADDIIUUUUUUUhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhheeeUUEEE
chr10   255     A       83      ,$,$,.,.,,,...,,,.,.,,,,,,,,..,,,,,..,.,,,,,,,.,,,,,..,.,,.,,,,,,.,.,,,.,.,,,,.,..,^!,^!,       CCRRRRRRRhh>hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhheeQQQEE

This assumes you want to do it by parsing the pileup, like you said. I believe you can get the same information out of BCF/VCF directly.

ADD COMMENT
0
Entering edit mode

Perfect, thanks. This is exactly what I needed. I just did the command "samtools mpileup tmp.bam" to get the kind of output you displayed.

ADD REPLY

Login before adding your answer.

Traffic: 1791 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