Summoning Singletons with plink

Singletons are variants private to individuals, a personal mutation. Sometimes these variants can carry disease risk when passed to offspring. Especially when the risk is additive and multiple disease variants are transmitted to an affected child.

Summoning singletons is easy with plink. Here's a basic guideline of how to do it.

1. Convert the VCF into a plink bfile
2. Run plink --freq counts

That's it.

I included a test case you can download from GitHub

$ git clone --recursive https://github.com/biosigil/plink_singletons.git

All following commands are assuming you installed plink and changed directory to plink_singletons/

The VCF is located in input/1kgp.vcf.gz and consists of three trios (child and parents). These data are a sampling from the 1000 Genome Project

Convert the VCF

$ plink --vcf input/1kgp.chr21.vcf.gz --make-bed --out 1kgp

plink will now make three files, 1kgp.bed, 1kgp.bim, 1kgp.fam

The fam file is not correct, the relation information is missing. Replace 1kgp.fam with truth.fam

$ cp input/truth.fam 1kgp.fam

Get Allele Counts

$ plink --bfile 1kgp --freq counts --out 1kgp

print singletons

$ less 1kgp.frq.counts | tr -s ' ' '\t' | awk '{ if($5==1) { print $0 }}'

Comments

Popular posts from this blog

Custom Usage Message for Python

Push to GitHub with the Terminal