Python Apache-2.0

pyensembl

Python interface to access reference genome features (such as genes, transcripts, and exons) from Ensembl

O

openvax

Dernière activité 28 sept. 2026
openvax/pyensembl

409

étoiles

75

forks

7

issues ouvertes

Ce README est souvent en anglais.

Tests Coverage PyPI

PyEnsembl

PyEnsembl queries Ensembl genes, transcripts, exons and sequences from local indexes. It supports numbered releases, dated new-platform annotations and custom matched GTF/FASTA files.

Installation

Use Python 3.9 or later. Install the package and one explicit annotation:

python -m pip install pyensembl
pyensembl install --release 93 --species human

This selects human GRCh38 and downloads and indexes its annotation, transcript and peptide files. Setup takes several minutes and disk space; whole-genome DNA is optional. See installation and first lookup.

Example Usage

After installing the data above:

from pyensembl import EnsemblRelease

with EnsemblRelease(93, species="human") as data:
    gene = data.gene_by_id("ENSG00000141510")
    print(gene.name, gene.contig, gene.start, gene.end, gene.strand)
TP53 17 7661779 7687550 -

Coordinates are one-based and inclusive; TP53 is on the minus strand. Pin the release you analyze: coordinates, IDs and sequences can change between releases, and a gene name can match several loci. The documentation continues with protein and transcript sequences.

Documentation

The documentation home page includes installation and getting-started examples. Use these guides for other tasks:

Task Guide
Find genes by name, position or biotype Genes and transcripts
Protein, coding and transcript sequences; exons Get protein and transcript sequences
Search additional gene names Alias lookup
Read genomic DNA Reference DNA
Choose an assembly, species and coverage Assembly selection
Install from Python, check or delete data Install and manage data
Use your own annotations Custom genomes
Use dated Ensembl downloads Dated annotations
Find a class or query method API reference

For contributions, see development setup, documentation style and releasing. Every PR includes a version bump, lint and tests; maintainers merge through a PR and publish with ./deploy.sh from clean main.

Projets similaires

genes and genomes at your fingertips

Pythonbiocondaensemblgenome
Vvanheeringen-lab
411 étoiles41

🧬 gget enables efficient querying of genomic reference databases

Pythonalphafoldalphafold2archs4
Sscverse
1,2 k étoiles97

This API provides programmatic access to the AlphaGenome model developed by Google DeepMind.

Python
Ggoogle-deepmind
2,2 k étoiles305