Lue dans les fichiers PHP du paquet au commit bf907cf93e8a : 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é.
CactusSourceclassThe NCI/CADD Chemical Identifier Resolver (CIR, cactus.nci.nih.gov): a structure from whatever names it - a name ("caffeine", "acetylsalicylic acid"), a CAS number, an InChIKey, a standard InChI, a SMILES - turned into the others: its standard InChIKey (its id here: CIR keeps none of its own), standard InChI, SMILES, IUPAC name, formula, molecular weight, CAS numbers and names, and a picture of it.
4 methods · 3 constants
CactusSourceFactoryclassThe NCI/CADD Chemical Identifier Resolver: a structure from a name, a CAS number, an InChIKey, an InChI or a SMILES, and its other identifiers and representations; OPSIN for a name it cannot read - no key needed.
5 options
Omnilab\Cactus
CactusSource class
final class CactusSource extends HttpSource CactusSource.php:45
The NCI/CADD Chemical Identifier Resolver (CIR, cactus.nci.nih.gov): a structure from whatever names it - a name ("caffeine", "acetylsalicylic acid"), a CAS number, an InChIKey, a standard InChI, a SMILES - turned into the others: its standard InChIKey (its id here: CIR keeps none of its own), standard InChI, SMILES, IUPAC name, formula, molecular weight, CAS numbers and names, and a picture of it.
A name CIR cannot resolve is given to OPSIN (the University of
Cambridge's IUPAC name parser, served by the EBI), once, unless opsin
is off: CIR already reads systematic names with OPSIN first (its
resolver "name_by_opsin"), so OPSIN is no other base - no identifier,
no record - but the current parser, asked when CIR's fails or is out of
date; what it gives (standard InChI and InChIKey, SMILES) is then asked
of CIR by the InChI for the rest.
One call a representation: up to eight an entity (the InChIKey first, in CIR's XML, which says what CIR read the string as; nothing more is asked of what CIR cannot resolve), one more to OPSIN for a name CIR does not know. CIR answers text; a structure it cannot resolve is an empty XML answer, a 404, or a 500 whose page says "Page not found": null. No key, no published rate.
const BASE_URI = 'https://cactus.nci.nih.gov/chemical/structure/'const REPRESENTATIONS = ['stdinchi', 'smiles', 'iupac_name', 'formula', 'mw', 'cas', 'names']What entity() asks after the InChIKey, by default.
const OPSIN_URI = 'https://www.ebi.ac.uk/opsin/ws/'
CactusSource::__construct()
public function __construct(HttpClientInterface $http, readonly array $representations = self::REPRESENTATIONS, readonly int $names = 20, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0, readonly ?string $opsinUri = self::OPSIN_URI)$representationswhat entity() asks after the InChIKey (of self::REPRESENTATIONS)
$nameshow many names to keep as synonyms
CactusSource::getName()
public function getName(): stringCactusSource::capabilities()
public function capabilities(): arrayCactusSource::entity()
public function entity(Identifier|string $id): ?EntityA structure by an InChIKey, a standard InChI or a CAS number (as an Identifier or a string), or by a name or a SMILES (a string no scheme reads); an identifier of another base is refused before any call (CIR does not resolve PubChem's or ChEBI's ids); null when CIR cannot resolve it.
CactusSourceFactory class
final class CactusSourceFactory extends SourceFactory CactusSourceFactory.php:24
The NCI/CADD Chemical Identifier Resolver: a structure from a name, a CAS number, an InChIKey, an InChI or a SMILES, and its other identifiers and representations; OPSIN for a name it cannot read - no key needed.
options: mailto: 'support@glitchr.io' # in the User-Agent representations: [stdinchi, smiles, iupac_name, formula, mw, cas, names] # one call each, after the InChIKey names: 20 # how many names to keep as synonyms (0: the names are not asked) opsin: true # a name CIR cannot read is given to OPSIN (false: never; or OPSIN's address) throttle: 0 # seconds between two calls: CIR publishes no rate base_uri: 'https://cactus.nci.nih.gov/chemical/structure/'
Options
| Option | Default | |
|---|---|---|
representations | CactusSource::REPRESENTATIONS | |
names | 20 | |
opsin | true | |
throttle | 0.0 | |
base_uri | CactusSource::BASE_URI |