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. The home page also shows transcript and protein sequence examples. Pin an annotation version: coordinates and sequences can differ between releases, and names may match several loci.
Usage tips
The documentation home page includes installation and getting-started examples. Use these guides for other tasks:
| Task | Guide |
|---|---|
| Find genes and transcripts | Genes and transcripts |
| Search additional gene names | Alias lookup |
| Read genomic intervals and manage DNA | Reference DNA |
| Choose an assembly, species and coverage | Assembly selection |
| Check downloads or change cache location | Cached data |
| Use your own annotations | Custom genomes |
| Use dated Ensembl downloads | New platform |
| Find complete interfaces and lookup methods | 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.
Metadata
Release files for pyensembl 2.22.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyensembl-2.22.3.tar.gz | 174.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyensembl-2.22.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 268.0 kB
Release files / pyensembl-2.22.3.tar.gz
| Download URL | pyensembl-2.22.3.tar.gz |
|---|---|
| Size | 174.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
107531a1a2c41111c46453cdcb1c1ac0835a99cc03f85808b2e05a46b7e79b6f
|
|
BLAKE2b-256 checksum How to use checksums |
db4c91e8a941d129fc98a506062c974d621b1221911946170c83670398ed15f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|
Release files / pyensembl-2.22.3-py3-none-any.whl
| Download URL | pyensembl-2.22.3-py3-none-any.whl |
|---|---|
| Size | 93.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc5b2f417e4ae0bca5579129eca0afa9765877bd4e4d4a5a605efc953cfa2957
|
|
BLAKE2b-256 checksum How to use checksums |
a87967a2a895f8b19da23ffa8b5fc8faccf4a1433d5eb097f7d2a239cd11f1e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|