Monday, January 14, 2013

samtools tview only show alignments with non-* QUAL field

If your input file is fasta (or fastq without quality score), then your alignment from Tophat or Bowtie2 will generate SAM like:


$ samtools view alignment.bam  | fgrep -wi T0730373
t0730373 256 scaffold00006 1146736 0 27M * 0 0 ACTGGGAACACCGCGTGATGTTGGCTA * AS:i:-12 XS:i:-12 XN:i:0 XM:i:2 XO:i:0XG:i:0 NM:i:2 MD:Z:0C25T0 YT:Z:UU
t0730373 272 scaffold00006 1351262 0 27M * 0 0 TAGCCAACATCACGCGGTGTTCCCAGT * AS:i:-12 XS:i:-12 XN:i:0 XM:i:2 XO:i:0XG:i:0 NM:i:2 MD:Z:0A25G0 YT:Z:UU
t0730373 0 scaffold00006 1460535 0 27M * 0 0 ACTGGGAACACCGCGTGATGTTGGCTA IIIIIIIIIIIIIIIIIIIIIIIIIII AS:i:-12 XS:i:-12 XN:i:0 XM:i:2 XO:i:0 XG:i:0 NM:i:2 MD:Z:0C25T0 YT:Z:UU
t0730373 256 scaffold00144 669608 0 27M * 0 0 ACTGGGAACACCGCGTGATGTTGGCTA * AS:i:-12 XS:i:-12 XN:i:0 XM:i:2 XO:i:0XG:i:0 NM:i:2 MD:Z:0C25T0 YT:Z:UU
t0730373 256 scaffold00550 85141 0 27M * 0 0 ACTGGGAACACCGCGTGATGTTGGCTA * AS:i:-12 XS:i:-12 XN:i:0 XM:i:2 XO:i:0XG:i:0 NM:i:2 MD:Z:0C25T0 YT:Z:UU

You see that only the first alignment has the QUAL field, the other secondary alignments have a "*" in the field. And the samtools tview cannot display those alignment.  That's the tip!



No comments:

Post a Comment