Lue dans les fichiers PHP du paquet au commit 21bd693ea97a : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
EnsemblSourceclassEnsembl (EMBL-EBI), the genome annotation of the vertebrates and the model organisms, through its REST API (rest.ensembl.org): a gene, a transcript, a protein (Ensembl's translation) or an exon by its Ensembl id (ENSG00000244734, its version dropped), or a gene by its symbol in a species ("HBB", "mus_musculus/Hbb-bs"); its symbol, name, biotype, species, assembly and place on the genome; a gene's NCBI Gene record and its Swiss-Prot proteins, a protein's UniProt entries, as cross-references for the Collector to follow; its species, gene, transcripts and protein as related things; and the genes a symbol names in a species.
5 methods · 4 constants
EnsemblSourceFactoryclassEnsembl: genes, transcripts, proteins and exons by their Ensembl id, genes by symbol in a species - their location, biotype, assembly, species and cross-references - no key needed.
4 options
Omnilab\Ensembl
EnsemblSource class
final class EnsemblSource extends HttpSource EnsemblSource.php:44
Ensembl (EMBL-EBI), the genome annotation of the vertebrates and the model organisms, through its REST API (rest.ensembl.org): a gene, a transcript, a protein (Ensembl's translation) or an exon by its Ensembl id (ENSG00000244734, its version dropped), or a gene by its symbol in a species ("HBB", "mus_musculus/Hbb-bs"); its symbol, name, biotype, species, assembly and place on the genome; a gene's NCBI Gene record and its Swiss-Prot proteins, a protein's UniProt entries, as cross-references for the Collector to follow; its species, gene, transcripts and protein as related things; and the genes a symbol names in a species.
The genomes whose ids are Ensembl's own (ENS..., the vertebrates) are of the core's ensembl scheme; those Ensembl and Ensembl Genomes annotate under their community's ids (FBgn0000008, AT5G10140, YAL001C) of its ensembl.genomes scheme, read the same way, with the genome their shape tells (a lookup without it took 7 to 23 s on 2026-10-15).
No key. Ensembl takes 15 calls a second (55,000 an hour), and asks every call to say "Content-Type: application/json". A gene costs three calls (its record, its cross-references, its Swiss-Prot proteins), a protein three (its record, its transcript's, its UniProt entries), a transcript or an exon one; each species' record once more (its taxon, its common name), kept for the source's life.
const BASE_URI = 'https://rest.ensembl.org/'const SPECIES = 'homo_sapiens'The species a symbol is looked up in when it names none.
const THROTTLE = 0.07000000000000001Seconds between two calls: Ensembl's 15 a second, with a margin.
const MAX_PER_PAGE = 1000The most ids one batch lookup takes (Ensembl stops at 1000).
EnsemblSource::__construct()
public function __construct(HttpClientInterface $http, readonly string $species = self::SPECIES, readonly bool $xrefs = true, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = self::THROTTLE)$speciesthe species a symbol is looked up in when it names none
$xrefswhether a gene's and a protein's cross-references are read (one or two calls more)
EnsemblSource::getName()
public function getName(): stringEnsemblSource::capabilities()
public function capabilities(): arrayEnsemblSource::entity()
public function entity(Identifier|string $id): ?EntityA gene, transcript, protein or exon by its Ensembl id (ENSG00000244734, ENSG00000244734.6, ensembl:..., its page), or a gene by its symbol in the configured species ("HBB") or in a species named before it ("mus_musculus/Hbb-bs", "mouse/Hbb-bs"). An identifier of another scheme is refused before any call.
EnsemblSource::search()
public function search(Query $query): PageThe genes a symbol names in a species - its own, or a synonym's ("p53" gives TP53) -, as Ensembl's cross-references know them: "HBB" in the configured species, "mus_musculus/Hbb-bs" in another. Each holds what the gene's record says (no cross-references: entity() reads them); a page by offset. A domain other than biology answers nothing.
EnsemblSourceFactory class
final class EnsemblSourceFactory extends SourceFactory EnsemblSourceFactory.php:22
Ensembl: genes, transcripts, proteins and exons by their Ensembl id, genes by symbol in a species - their location, biotype, assembly, species and cross-references - no key needed.
options: mailto: 'support@glitchr.io' # in the User-Agent: whom Ensembl writes to before it blocks a caller species: 'homo_sapiens' # the species a symbol is looked up in when it names none ("mus_musculus/Hbb-bs" does) xrefs: true # read a gene's or a protein's cross-references (NCBI Gene, UniProt): one or two calls more throttle: 0.07 # seconds between two calls: Ensembl takes 15 a second at most (55,000 an hour) base_uri: 'https://rest.ensembl.org/'
Options
| Option | Default | |
|---|---|---|
species | EnsemblSource::SPECIES | |
xrefs | true | |
throttle | EnsemblSource::THROTTLE | |
base_uri | EnsemblSource::BASE_URI |