Skip to content
Thomas Kono edited this page Nov 2, 2017 · 1 revision

Making Mendel Error Input Files From ExCap Variants

We decided to use the exome capture variants that overlap the BOPA positions as the genotype data for the parents, rather than the Alchemy calls. The missing data is more uniform and heterozygosity patterns are less wacky than with the genotyping data.

Required files

  • 384-Capture_Overlap.vcf: Parental reseq SNPs that overlap BOPA physical positions
  • GP_All.ped: Original combined PED file from Alchemy calls
  • GP_All.map: Original combined MAP from Alchemy calls
  • Munoz2011_BOPA_ConsensusMap.csv: Munoz et al. 2011 genetic map positions
  • 9K_Reference_Orientiation.txt: Flip/Match for 9K SNPs against Morex reference
  • Population_Pedigrees.csv: Pedigrees of the experimental population

Steps

  1. Convert parental resequencing VCF to PLINK PED/MAP

    plink2 --vcf  384-Capture_Overlap.vcf --allow-extra-chr --recode --out Parents_VCF
  2. Add genetic map information to MAP

    python Add_Genetic_Positions_to_Map.py Parents_VCF.map Munoz2011_BOPA_ConsensusMap.csv > Parents_VCF_WithGen.map
  3. Sort MAP and interpolate positions

    sort -k1,1V -k3,3V Parents_VCF_WithGen.map > Parents_VCF_WithGen_Sorted.map
    python Interpolate_MAP_Positions.py Parents_VCF_WithGen_Sorted.map > Parents_VCF_WithGen_Sorted_Interpolated.map
  4. Reorder PED using interpolated MAP

    python Fix_Map_Order.py Parents_VCF.map Parents_VCF_WithGen_Sorted_Interpolated.map Parents_VCF.ped > Parents_VCF_Reordered.ped
  5. Subset GP_All.ped to contain only progeny information

    awk '$1 != "-9" {print}' GP_All.ped. > Progeny.ped
  6. Subset markers in GP_All.ped to contain only SNPs that are covered by exome capture

    cut -f 2 Parents_VCF_WithGen_Sorted_Interpolated.map > Keep.txt
    plink2 --ped Progeny.ped --map GP_All.map --allow-extra-chr --extract Keep.txt --recode --out Progeny_Reseq
  7. Generate allele frequency report on subset progeny PED

    plink2 --file Progeny_Reseq --allow-extra-chr --freq --out Progeny_Freq
  8. Identify progeny SNPs to flip so they match exome capture variants

    python Find_SNPs_to_Flip.py 384-Capture_Overlap.vcf Progeny_Freq.frq > Flip.txt
    grep 'Flip' 9K_Reference_Orientiation.txt | cut -f 1 >> Flip.txt
    sort Flip.txt | uniq > Flip_Uniq.txt
  9. Flip the SNPs

    plink2 --file Progeny_Reseq --allow-extra-chr --flip Flip_Uniq.txt --recode --out Progeny_Flipped
  10. Reorder progeny PED to match parental PED

    python Fix_Map_Order.py Progeny_Flipped.map Parents_VCF_WithGen_Sorted_Interpolated.map Progeny_Flipped.ped > Progeny_Flipped_Reordered.ped
  11. Concatenate parental PED and progeny PED

    cat Parents_VCF_WithGen_Sorted_Interpolated.map Progeny_Flipped_Reordered.ped > Combined.ped
  12. Add family data to combined PED

    python Add_Family_to_PED.py Population_Pedigrees.csv Combined.ped > Combined_WithPedigree.ped
  13. Make Mendel error input files

    python Make_Mendel_Error_Inputs.py Combined_WithPedigree.ped

Clone this wiki locally