This is a test version of Biostars. For the public version, visit https://www.biostars.org.
PLINK .ped file from vcf file with 2 alleles

Hi!

I got my .vcf files after doing the variant calling with GATK Haplotype caller.

I am new to PLINK, I would like to know how to get a set of PLINK files (.ped, .map) from the vcf file for somatic cells. So far I used the following:

plink --vcf file.vcf --recode --out PLINKfile

But then in the .ped file I have information only about one of the alleles:

person1  person1  0  0  0  -9  G  A  G  C  C  C ...
person2  person2  0  0  0  -9  G  A  G  C  T  C ...
person3  person3  0  0  0  -9  G  T  C  C  C  C ...

As I understand, for SNPs it should have 2 letters at each position, one for each allele, so it should look like this:

person1  person1  0  0  0  -9  GA  AA  GG  CT  CC  CC ...
person2  person2  0  0  0  -9  GA  AA  GG  CC  TC  CC ...
person3  person3  0  0  0  -9  GA  TA  CG  CT  CC  CC ...

How do I do that? Also, is there a way to encode deletions and insertions, especially if they are longer than 1 nucleotide?

Thank you

plink ped vcf

ped/map is a very outdated and generally poor and memory inefficient way to store data. Would reccomend using another format if you can.

1 answer

PLINK has had better support for VCF than .ped files for the last 7 years. I could answer this question, but I would probably be doing you a disservice; you probably shouldn't bother to learn how this format works at all.

The PLINK formats that are actually worth learning about are .bed and .pgen; those are much more efficient than VCF for their purposes.

Thank you!

Actually, I think I found the answer myself: there is a space between two alleles, so actually the first way also includes the information about both alleles, it just prints them in 2 consecutive columns.

My plan was to create .bed, .bim and .fam from .ped and .map afterwards, and run DFAM: family-based association for disease traits. But now I think of it, there probably should be a way to create those files directly from .vcf.

UPD: --make_bed should do it

yes, use --make-bed and directly produce the .bim/.bed//.fam files - no need to make intermediary .map/.ped files

Log in to answer this question.