How to use the cyvcf2.VCFReader function in cyvcf2

To help you get started, we’ve selected a few cyvcf2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AndersenLab / VCF-kit / vcfkit / utils / primer_vcf.py View on Github external
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
github arq5x / gemini / gemini / gemini_load_chunk.py View on Github external
def _get_vcf_reader(self):
        return vcf.VCFReader(self.args.vcf)

cyvcf2

fast vcf parsing with cython + htslib

MIT
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis

Similar packages