alimanfoo/anhima — pull request #45 by hardingnj (2014-09-12 11:17:37+00:00)
Title: Adding mendelian error code

So, I gave up trying to be clever, and just went with much more straightforward and quicker approach. Basically I just convert to 0/1/2 and go from there.
It doesn't support multiallelic sites, or anything other than diploid.

I think it is possible to write a fully generalizable function, but it's tricky to get it fast.

Also added some tests and a benchmark script.

***

Uses map and zip in leiu of loop.
Now assumes biallelic, diploid. In theory extensible to polyploid multiallelic, but too impractical for the moment.

Added test script run with nosetest test/ from the root dir.
Added benchmark script, run with python benchmark/benchmark_ped.py

for 1m variants, runs in approx 6 minutes for 10 samples. The more heterozygotes the slower it runs.