Biostar Beta. Not for public use.
Base Quality of a reported variant in VCF
0
Entering edit mode
17 months ago
India

Hello World,

                Curious to know if any simple way is there to get base quality of a reported variant in VCF. To be exact I am not looking for phred score of variant which is directly available in VCF but the base quality phred score. I am using bcftools and alignment using samtools.

0
Entering edit mode

Multiple bases above a threshold are required to support a variant, no? You might have to look at extracting the base quality scores of all reads involved.

0
Entering edit mode

Thank You RamRS. Lets say we have the confident variant(mainly SNP) with us. Thus from that filtered vcf I require basecall phred score. I can get it with scripting, but luking for any easy option btw.

0
Entering edit mode

In other words, you want the phred scores of the bases underlying a variant call, yes?

0
Entering edit mode

Exactly Devon Ryan. I need the base quality of variant rather than phred quality of variant which is there in vcf row for a variant

2
Entering edit mode
15 months ago
Freiburg, Germany

Just parse the mpileup:

samtools mpileup -f reference.fasta -r chr1:234-235 file.bam


The last column is the base quality. You might also be able to use sam2tsv from Pierre's jvarkit, where it looks like column 6 has the quality score for each base in each read.