Recode vcf with specified reference allele
1
0
Entering edit mode
6.4 years ago
wangdavid758 ▴ 30

Hi,

I have a phased vcf file and I want to recode the reference allele according to be what is a specified in a list. The list is 2 columns: SNP id in the first, and the reference allele I want in the second. For example, if my REF and ALT alleles in the vcf are A and T respectively for SNP rs12345, and the REF allele in my list for rs12345 is T, I want to flip the encoding (0/1) for all samples and flip the ref and alt alleles. However, if the REF allele in my list for the above case is A, then nothing is changed. Is there a quick and easy way to do this on plink or vcf tools. My file is huge and any script I write myself to do this will take ages without efficiency exploits of these tools...

Thanks!

plink vcf vcftools flip reference allele • 4.7k views
ADD COMMENT
1
Entering edit mode
6.4 years ago

see --reference-allele in plink http://zzz.bwh.harvard.edu/plink/dataman.shtml#updateallele

ADD COMMENT

Login before adding your answer.

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