In order to convert the VCF file to ped file, follow two steps.

1. Convert the text file in VCF format (http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41) to
genotype matrix file where 0 represents homozygous (major allele), 1 represents heterozygous and 2 represents homozygous (minor allele).
The input file must be in VCF format, where first 9 columns are CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO and FORMAT, then an arbitrary number of sample IDs.
Each sample ID column must start with the GT (genotype) value.

In order to execute this step, run the following command on UNIX prompt:

$  python genotype.py myvars.vcf > mygenotype.txt

2. The resulting mygenotype.txt matrix file is accepted by the ped_builder_prod.R R script along with the sample information file
in order to generate the ped file. Sample info file must be a three columns file as follows:
 Sample - sample name
 case_control - accepted values "case" or "control"
 Gender - accepted values "Female" or "Male"

In order to execute this step, start up R and on the R prompt issue commands:

 > source("ped_builder_prod.R")
 > ped(matrixfile="mygenotype.txt", samfile="sample_info.txt")

Note that the second step is rather memory intensive for large VCF files.


