How to fix phenotype information when converting from VCF to PLINK
2
0
Entering edit mode
3.3 years ago
Diego ▴ 30

I have a series of VCF files (one for each chromosome) that have an incorrect values for the phenotype (all samples have the value "-9"). I have read on other questions that the make-pheno or pheno flags can be used to add phenotype information when creating the PLINK format files. But I am unsure if thsis would work correctly since the VCF files "incorrectly" already provide that information.

plink -- bfile file --make-pheno phenotype_file.phe --make_bed --out out_file

Would this work right even if the VCF files contain the PHENO column? Also how can I generate the phenotype file? Can it be done in a program like Excel and then exported to csv, and then somehow converted to .phe format?

Any help is appreciated!

GWAS QC Phenotype PLINK VCF • 2.7k views
ADD COMMENT
3
Entering edit mode
3.3 years ago
Diego ▴ 30

I figured it out, for anyone who might be trying something similar: the make-pheno flag allows to add/fix the phenotype information if there is a problem with it. Instead of a phe file format, a tab separated .txt file works fine. The file should contain 3 columns FID, IID and PHENO (without headers). So for many cases the first two columns contain the exact same ids and then the 3rd column has the phenotype. The phenotype can be a string (eg. 'POS' and 'NEG') , you just need to define the positive case in the command, just as follows:

plink --vcf file.vcf --make-pheno phenotype_file.txt POS --make_bed --out out_file

To make the phenotype.txt file excel works great!

ADD COMMENT
0
Entering edit mode
2.4 years ago
bioinfo • 0

Thank you for the valuable sharing,

Kindly I have a question, currently, I have merged VCF genotype for more than 300 animal samples with different traits, and I was able to convert them to plink files, but the question is how can I extract the phenotype from the vcf file. if possible, rather than fill it with suggested columns from a separate file?

ADD COMMENT

Login before adding your answer.

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