Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def fetch_variant_count(self, region, sample_set = None):
"""
Fetches variant count in a region.
"""
v = VCFReader(self.filename)
sample_indices = [v.samples.index(x) for x in sample_set]
vc = 0
for i in v(self.region):
gt_len = len(set([i.gt_types[x] for x in sample_indices]))
if gt_len > 1:
vc += 1
return vc
def _get_vcf_reader(self):
return vcf.VCFReader(self.args.vcf)