Guest User

Untitled

a guest
Jan 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import hts/vcf
  2. import os
  3.  
  4. var gnomad_path = commandLineParams()[0]
  5.  
  6. var
  7. gvcf:VCF
  8. total:int
  9. mid:int
  10.  
  11. if not open(gvcf, gnomad_path, threads=3):
  12. quit "could not open vcf"
  13.  
  14. var af = newSeq[float32](1)
  15. for v in gvcf:
  16. if v.info.get("AF", af) != Status.OK: continue
  17. total += 1
  18. if af[0] > 0.05: mid += 1
  19.  
  20. echo "> 0.05:", mid
  21. echo "count:", total
  22. echo "pct:", 100'f64 * (mid / total)
Add Comment
Please, Sign In to add comment