Package: peddy
Fast Pedigree::VCF QCpeddy compares familial-relationships and sexes as reported in aPED/FAM filewith those inferred from a VCF.It samples the VCF at about 25000 sites (plus chrX) to accurately estimaterelatedness,IBS0,heterozygosity,sexandancestry. It uses 2504 thousand genome samples as backgrounds to calibrate the relatedness calculation and to make ancestry predictions.It does this very quickly by sampling, by using C for computationally intensive parts, and by parallelization.If you use peddy, please citePedersen and Quinlan, Who’s Who? Detecting and Resolving Sample Anomalies in Human DNA
Sequencing Studies with Peddy, The American Journal of Human Genetics (2017),
http://dx.doi.org/10.1016/j.ajhg.2017.01.017Note thatsomalieris a more scalable, faster, replacement for peddy
that uses some of the same methods as peddy along with some new ones.QuickstartSee installation below.Most users will only need to run as a command-line tool with a ped and VCF, e.g:python -m peddy -p 4 --plot --prefix ceph-1463 data/ceph1463.peddy.vcf.gz data/ceph1463.pedThis will use 4 cpus to run various checks and createceph-1463.htmlwhich
you can open in any browser to interactively explore your data.It will also create create 4 csv files and 4 QC plots.
These will indicate:discrepancies between ped-reported and genotype-inferred relationsdiscrepancies between ped-reported and genotype-inferred sexsamples with higher levels of HET calls, lower depth, or more variance in b-allele-frequency (ref / (ref + alt )) for het calls.an ancestry prediction based on projection onto the thousand genomes principal componentsFinally, it will create a new file ped filesceph1463.peddy.pedthat also lists
the most useful columns from thehet-checkandsex-check. Users canfirst
look at this extended ped file for an overview of likely problems.Seethe docsfor a walk-through and thorough explanation of each plot.hg38 or custom sitesBy default, peddy uses hg19/GRCh37. It can be forced to use sites for hg38 by passing--sites hg38.
To create custom sites, have a look atthe sites files included with peddyalong
with the corresponding .bin.gz which is just the raw binary alternate counts (gt_types) from thousand-genomes that have been written as uint8
and gzipped.SpeedBecause of the sampling approach and parallelization,peddyis very fast.
With 4 CPUs, on the 17-memberCEPH1643pedigree whole-genome VCF, peddy can run the het-check and PCA in ~ 8 seconds. The pedigree check comparing all vs.
all samples run in 3.6 seconds.
It finishes the full set of checks in about 20 seconds.In comparisonKINGruns
in 14 seconds (it isextremely fast); the time including the conversion
from VCF to binary ped is 85 seconds.On larger datasets, with hundreds or thousands of samples, it can be beneficial to add as many
cores as possible; for smaller datasets with dozens of samples about 4 processors reduces the
computation time as much as 8 or more would.ValidationThe results between peddy and KING are comparable, but peddy does better on
cohorts where most samples are related. See the figure below where the peddy
relatedness estimate is closer to the actual than KING which over-estimates relatedness.Peddy uses the KING algorithm for calculating relatedness and so they
match quite well.
Peddy also runs PCA on the 2504 samples from 1000 genomes,
then fitting an SVM and predicting ancestry in addition to
calculating relatedness among all pairwise combinations of the 17 samples.Warnings and ChecksOn creating a pedigree object (via Ped('some.ped').peddywill print warnings to STDERR as appropriate like:pedigree warning: '101811-101811' is dad but has female sex
pedigree warning: '101897-101897' is dad but has female sex
pedigree warning: '101896-101896' is mom of self
pedigree warning: '102110-102110' is mom but has male sex
pedigree warning: '102110-102110' is mom of self
pedigree warning: '101381-101381' is dad but has female sex
pedigree warning: '101393-101393' is mom but has male sex

unknown sample: 102498-102498 in family: K34175
unknown sample: 11509-11509 in family: K567331
unknown sample: 5180-5180 in family: K8565InstallationCondaNearly all users should install using conda in the anaconda python distribution. This means
have your own version of python easily installed via:INSTALL_PATH=~/anaconda
wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
# or wget http://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh
bash Miniconda2-latest* -fbp $INSTALL_PATH
PATH=$INSTALL_PATH/bin:$PATH

conda update -y conda
conda config --add channels bioconda

conda install -y peddyThis should install all dependencies so you can then run peddy with 4 processes as:python -m peddy --plot -p 4 --prefix mystudy $VCF $PEDGithubgit clone https://github.com/brentp/peddy
cd peddy
pip install -r requirements.txt
pip install --editable .run withpeddy --plot -p 4 --prefix mystudy $VCF $PED