Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise ValueError("Gene not found: %s" % (gene_id,))
gene_name, gene_biotype = None, None
if len(result) < 4 or len(result) > 6:
raise ValueError(
"Result is not the expected length: %d" % len(result))
contig, start, end, strand = result[:4]
if len(result) == 5:
if "gene_name" in field_names:
gene_name = result[4]
else:
gene_biotype = result[4]
elif len(result) == 6:
gene_name, gene_biotype = result[4:]
self._genes[gene_id] = Gene(
gene_id=gene_id,
gene_name=gene_name,
contig=contig,
start=start,
end=end,
strand=strand,
biotype=gene_biotype,
genome=self)
return self._genes[gene_id]
def __eq__(self, other):
return (
other.__class__ is Gene and
self.id == other.id and
self.genome == other.genome)