This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract SNP with wrong REF in vcf file?

Just like the topic: I got a vcf file contained plenty of SNPs, but some of SNPs seems got wrong ref. So i want to extract these snp with wrong ref. How can i do this jobs? Thanks a lot.

snp

1 answer

Please define 'wrong ref'. The issue may relate to this: A: Alternate nucleotide is more frequent than reference nucleotide. OMG I'm dizzy.

What i mean is just like this : Chrom Pos Ref Alt 1 1200 A G

But in the published genome fasta file,the chromsome 1 position 1200 nucleotide is T。 So my snp`s ref is not same as the nucleotide in published genome fasta file. How can i extract this kind of snp from my vcf file ?

I see. Please take a look at the --check-ref option in bcftools norm:

-c, --check-ref <e|w|x|s>         check REF alleles and exit (e), warn (w), exclude (x), or set (s) bad sites [e]

You will also have to specify an input FASTA genome, of course.

thank you very much , i will try it

Log in to answer this question.