Created
January 18, 2019 23:48
-
-
Save brentp/583552a9b29064ae26c01d4a95019fc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hts/vcf | |
import os | |
var gnomad_path = commandLineParams()[0] | |
var | |
gvcf:VCF | |
total:int | |
mid:int | |
if not open(gvcf, gnomad_path, threads=3): | |
quit "could not open vcf" | |
var af = newSeq[float32](1) | |
for v in gvcf: | |
if v.info.get("AF", af) != Status.OK: continue | |
total += 1 | |
if af[0] > 0.05: mid += 1 | |
echo "> 0.05:", mid | |
echo "count:", total | |
echo "pct:", 100'f64 * (mid / total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment