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 tutorial continues with a selected transcript and explains identifiers, versions and sequence lengths. Pin an annotation version: coordinates and sequences can differ between releases, and names may match several loci.
Usage tips
The documentation separates task guides and complete reference. Existing README anchors below lead to the corresponding guidance.
| Task | Guide |
|---|---|
| Choose an assembly, species and coverage | Assembly selection |
| Use dated Ensembl downloads | New platform |
| Load custom matched files | Custom genomes |
| Inspect data and cache readiness | Cached data |
| Load human or custom aliases | Alias lookup |
| Work with feature objects | Genes and transcripts |
| Read genomic intervals and manage DNA | Reference DNA |
| 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.2
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.2.tar.gz | 172.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyensembl-2.22.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 266.7 kB
Release files / pyensembl-2.22.2.tar.gz
| Download URL | pyensembl-2.22.2.tar.gz |
|---|---|
| Size | 172.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d8d959e73851aa6af3c0b87b604218f521698931f7cd865a7295912f14bbeae
|
|
BLAKE2b-256 checksum How to use checksums |
d8a2d54df4c05acabbe7dbad9fdfe151ef5d46683b6bd632a775e917406e2cc7
|
| 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.2-py3-none-any.whl
| Download URL | pyensembl-2.22.2-py3-none-any.whl |
|---|---|
| Size | 93.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0181d905e60ebad1627b60f5951f72b4d42e398a5a3b0f862ceffcba9ef289dd
|
|
BLAKE2b-256 checksum How to use checksums |
3faa1c8739e510d35e278b7fe0fd920ee4b4b4737254c1df035e11d98a9f5f04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|