Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, filename, reference=None):
if not os.path.isfile(filename) and filename != "-":
exit(message("Error: " + filename + " does not exist"))
self.filename = filename
if reference:
self.reference = reference
self.reference_file = resolve_reference_genome(reference)
cyvcf2.__init__(self, self.filename)
# Check if file exists
self.n = len(self.samples) # Number of Samples
# Meta Data
comp = re.compile(r'''^##(?P[^<#]+?)=(?P[^<#]+$)''', re.M)
self.metadata = OrderedDict(comp.findall(self.raw_header))
# Contigs
self.contigs = OrderedDict(zip(
re.compile("##contig=]*?)>").findall(self.raw_header))
))
self.info_set = [x for x in self.header_iter() if x.type == "INFO"]
self.filter_set = [x for x in self.header_iter() if x.type == "FILTER"]
self.format_set = [x for x in self.header_iter() if x.type == "FORMAT"]
def __init__(self, filename, reference=None, use_template="ALT", polymorphic=True):
if not os.path.isfile(filename) and filename != "-":
exit(message("Error: " + filename + " does not exist"))
self.filename = filename
self.use_template = use_template
self.use_polymorphic = polymorphic
if reference:
self.reference = reference
self.reference_file = resolve_reference_genome(reference)
cyvcf2.__init__(self, self.filename)
# Check if file exists
self.n = len(self.samples) # Number of Samples
# Meta Data
comp = re.compile(r'''^##(?P[^<#]+?)=(?P[^<#]+$)''', re.M)
self.metadata = OrderedDict(comp.findall(self.raw_header))
# Contigs
self.contigs = OrderedDict(zip(
re.compile("##contig=").findall(self.raw_header))
))
self.info_set = [x for x in self.header_iter() if x.type == "INFO"]
self.filter_set = [x for x in self.header_iter() if x.type == "FILTER"]
self.format_set = [x for x in self.header_iter() if x.type == "FORMAT"]
def __init__(self, filename, reference=None):
if not os.path.isfile(filename) and filename != "-":
with indent(4):
exit(puts(colored.red("\nError: " + filename + " does not exist\n")))
self.filename = filename
if reference:
self.reference = reference
cyvcf2.__init__(self, self.filename)
# Check if file exists
self.n = len(self.samples) # Number of Samples
# Meta Data
comp = re.compile(r'''^##(?P[^<#]+?)=(?P[^<#]+$)''', re.M)
self.metadata = OrderedDict(comp.findall(self.raw_header))
# Contigs
self.contigs = OrderedDict(zip(
re.compile("##contig=").findall(self.raw_header))
))
# Info
r = re.compile(r'''\#\#INFO=<
ID=(?P[^,]+),
Number=(?P-?\d+|\.|[AG]),
def __init__(self, filename, reference=None):
if not os.path.isfile(filename) and filename != "-":
with indent(4):
exit(puts(colored.red("\nError: " + filename + " does not exist\n")))
self.filename = filename
if reference:
self.reference = reference
self.reference_file = resolve_reference_genome(reference)
cyvcf2.__init__(self, self.filename)
# Check if file exists
self.n = len(self.samples) # Number of Samples
# Meta Data
comp = re.compile(r'''^##(?P[^<#]+?)=(?P[^<#]+$)''', re.M)
self.metadata = OrderedDict(comp.findall(self.raw_header))
# Contigs
self.contigs = OrderedDict(zip(
re.compile("##contig=").findall(self.raw_header))
))
self.info_set = [x for x in self.header_iter() if x.type == "INFO"]
self.filter_set = [x for x in self.header_iter() if x.type == "FILTER"]
self.format_set = [x for x in self.header_iter() if x.type == "FORMAT"]