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_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