How to use the pyensembl.gene.Gene function in pyensembl

To help you get started, we’ve selected a few pyensembl 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 openvax / pyensembl / pyensembl / genome.py View on Github external
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]
github openvax / pyensembl / pyensembl / gene.py View on Github external
def __eq__(self, other):
        return (
            other.__class__ is Gene and
            self.id == other.id and
            self.genome == other.genome)