How to use the kipoiseq.dataclasses.Variant.from_cyvcf_and_given_alt function in kipoiseq

To help you get started, we’ve selected a few kipoiseq 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 kipoi / kipoiseq / kipoiseq / extractors / vcf.py View on Github external
def fetch_variants(self, interval, sample_id=None):
        for v in self(self._region(interval)):
            # in case deletion is present
            ALTs = [''] if len(v.ALT) == 0 else v.ALT
            # extract variants
            # single REF can have multiple ALT
            for alt in ALTs:
                # not defined variants are not supported
                if 'N' in alt:
                    print('Undefined variants are not supported: Skip')
                    continue
                variant = Variant.from_cyvcf_and_given_alt(v, alt)
                if sample_id is None or self.has_variant(variant, sample_id):
                    yield variant