Decoder for SAM pileup data
From the SAMTools project documentation:
The Pileup format was first used by Tony Cox and Zemin Ning at the Sanger Institute. It describes the base-pair information at each chromosomal position. This format facilitates SNP/indel calling and brief alignment viewing by eye. Note that the pileup program has been replaced in Samtools by mpileup, which produces a slightly different output format by default.
There are two versions of the original pileup format: the current 6-column format produced by Samtools, and the old 10/13-column "consensus" format which could be obtained by using the -c argument, now deprecated.
Each line consists of chromosome, 1-based coordinate, reference base, the number of reads covering the site, read bases and base qualities. At the read base column, a dot stands for a match to the reference base on the forward strand, a comma for a match on the reverse strand, `ACGTN' for a mismatch on the forward strand and `acgtn' for a mismatch on the reverse strand. A pattern `\+[0-9]+[ACGTNacgtn]+' indicates there is an insertion between this reference position and the next reference position. The length of the insertion is given by the integer in the pattern, followed by the inserted sequence.
seq1 272 T 24 ,.$.....,,.,.,...,,,.,..^+. <<<+;<<<<<<<<<<<=<;<;7<& seq1 273 T 23 ,.....,,.,.,...,,,.,..A <<<;<<<<<<<<<3<=<<<;<<+ seq1 274 T 23 ,.$....,,.,.,...,,,.,... 7<7;<;<<<<<<<<<=<;<;<<6 seq1 275 A 23 ,$....,,.,.,...,,,.,...^l. <+;9*<<<<<<<<<=<<:;<<<< seq1 276 G 22 ...T,,.,.,...,,,.,.... 33;+<<7=7<<7<&<<1;<<6< seq1 277 T 22 ....,,.,.,.C.,,,.,..G. +7<;<<<<<<<&<=<<:;<<&< seq1 278 G 23 ....,,.,.,...,,,.,....^k. %38*<<;<7<<7<=<<<;<<<<< seq1 279 C 23 A..T,,.,.,...,,,.,..... ;75&<<<<<<<<<=<<<9<<:<<
See the Pileup format documentation for more details.
The "consensus" or extended pileup consists of the following:
seq1 60 T T 66 0 99 13 ...........^~.^~. 9<<55<;<<<<<< seq1 61 G G 72 0 99 15 .............^~.^y. (;975&;<<<<<<<< seq1 62 T T 72 0 99 15 .$.............. <;;,55;<<<<<<<< seq1 63 G G 72 0 99 15 .$.............^~. 4;2;<7:+<<<<<<< seq1 64 G G 69 0 99 14 .............. 9+5<;;;<<<<<<< seq1 65 A A 69 0 99 14 .$............. <5-2<;;<<<<<<; seq1 66 C C 66 0 99 13 ............. &*<;;<<<<<<8< seq1 67 C C 69 0 99 14 .............^~. ,75<.4<<<<<-<< seq1 68 C C 69 0 99 14 .............. 576<;7<<<<<8<< *
Escherichia_coli_K12 3995037 * *\/* 430 0 37 144 * +A 143 1 0 Escherichia_coli_K12 3995279 * *\/* 202 0 36 68 * +A 67 1 0 Escherichia_coli_K12 3995281 * *\/* 239 0 36 67 * -CG 66 1 0
See Consensus pileup format (deprecated) for more details.
Handling of indels is questionable at the moment. Proceed with care.