Lue dans les fichiers PHP du paquet au commit d54f5d36a8be : 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é.
KeggSourceclassKEGG, the Kyoto Encyclopedia of Genes and Genomes (Kanehisa Laboratories), through its REST API at rest.kegg.jp: a compound ("C07481", caffeine), a drug ("D00528"), a reaction ("R00200"), a pathway map ("map00010", "hsa00010") or an enzyme ("2.7.1.40") by its KEGG identifier - names, formula, masses, a reaction's equation, a pathway's class and description, an enzyme's class and systematic name; the same thing in other bases (CAS, ChEBI, ChEMBL, Rhea) as identifiers; the reactions, pathways, enzymes and compounds it is tied to as related things -; a compound by its ChEBI id (KEGG's conv); a search of the configured databases (find).
5 methods · 2 constants
KeggSourceFactoryclassKEGG: compounds, drugs, reactions, pathways and enzymes by their KEGG identifiers, their cross-references, and a search - no key, but KEGG's API is for academic use by academic users only (see the README).
3 options
Omnilab\Kegg
KeggSource class
final class KeggSource extends HttpSource KeggSource.php:36
KEGG, the Kyoto Encyclopedia of Genes and Genomes (Kanehisa Laboratories), through its REST API at rest.kegg.jp: a compound ("C07481", caffeine), a drug ("D00528"), a reaction ("R00200"), a pathway map ("map00010", "hsa00010") or an enzyme ("2.7.1.40") by its KEGG identifier - names, formula, masses, a reaction's equation, a pathway's class and description, an enzyme's class and systematic name; the same thing in other bases (CAS, ChEBI, ChEMBL, Rhea) as identifiers; the reactions, pathways, enzymes and compounds it is tied to as related things -; a compound by its ChEBI id (KEGG's conv); a search of the configured databases (find).
KEGG's API is for academic use by academic users only (non-academic use needs a licence from Pathway Solutions); three calls a second at most, or KEGG blocks the caller: 0.34 s between two calls by default. One call an entity (two from a ChEBI id), one a database searched.
const BASE_URI = 'https://rest.kegg.jp/'const DATABASES = ['compound' => Domain::CHEMISTRY, 'drug' => Domain::CHEMISTRY, 'reaction' => Domain::CHEMISTRY, 'pathway' => Domain::BIOLOGY, 'enzyme' => Domain::BIOLOGY]The databases find can search, and the domain each belongs to.
KeggSource::__construct()
public function __construct(HttpClientInterface $http, readonly array $databases = ['compound'], string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.34)$databaseswhat search() searches, in this order (compound, drug, reaction, pathway, enzyme)
KeggSource::getName()
public function getName(): stringKeggSource::capabilities()
public function capabilities(): arrayKeggSource::entity()
public function entity(Identifier|string $id): ?EntityA compound or drug ("C07481", "cpd:C07481", "D00528"), a reaction ("R00200", "rn:R00200"), a pathway ("map00010", "hsa00010", "path:map00010"), an enzyme ("2.7.1.40", "EC 2.7.1.40", "ec:2.7.1.40"), a KEGG page, or a compound by its ChEBI id ("CHEBI:27732": KEGG's conv first); another base's identifier is refused before any call; null when KEGG has no such entry.
KeggSource::search()
public function search(Query $query): PageThe entries whose names hold the text, in the configured databases (compound by default), in KEGG's order, one database after the other; a domain narrows to its databases (chemistry: compound, drug, reaction; biology: pathway, enzyme). An entity of a page holds its id and names: entity() reads it whole.
KeggSourceFactory class
final class KeggSourceFactory extends SourceFactory KeggSourceFactory.php:21
KEGG: compounds, drugs, reactions, pathways and enzymes by their KEGG identifiers, their cross-references, and a search - no key, but KEGG's API is for academic use by academic users only (see the README).
options: mailto: 'support@glitchr.io' # in the User-Agent databases: ['compound'] # what search() searches: compound, drug, reaction, pathway, enzyme throttle: 0.34 # seconds between two calls: KEGG blocks a caller above three a second base_uri: 'https://rest.kegg.jp/'
Options
| Option | Default | |
|---|---|---|
databases | ['compound'] | |
throttle | 0.34 | |
base_uri | KeggSource::BASE_URI |