Debian Codegraph @

scripts/trio-denovo.py

raw
1 import numpy as np
2 import sys
3 from scipy.stats import binom_test
4 path = sys.argv[1]
5
6 import cyvcf2
7 vcf = cyvcf2.VCF(path)
8 PRO, MOM, DAD = range(3)
9
10 for v in vcf:
11 if v.QUAL < 10: continue
12 if np.any(v.gt_depths < 10): continue
13 refs, alts = v.gt_ref_depths, v.gt_alt_depths
14 if not all(v.gt_types == [vcf.HET, vcf.HOM_REF, vcf.HOM_REF]): continue
15 if alts[MOM] > 1 or alts[DAD] > 1: continue
16 print("%s\t%d\t%s\t%s\t%s" % (v.CHROM, v.start, v.REF,
17 ",".join(v.ALT), ",".join(v.gt_bases)))