Lue dans les fichiers PHP du paquet au commit 420c496e5ff6 : 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é.
PdbSourceclassThe Protein Data Bank, through the APIs of RCSB PDB: an entry by its PDB id (4HHB, or its extended form pdb_00004hhb) - its title, keywords, experimental method, resolution, weight, dates, primary citation and authors; its polymer entities (the chains: their description, strands, length, organism) and its ligands (their chemical component, formula, weight) as properties; the UniProt proteins of its chains, their organisms and its ligands as related things - a structure is not its protein, nor its ligand: the Collector follows none of them -; an image of its first assembly; and RCSB's full-text search.
5 methods · 4 constants
PdbSourceFactoryclassThe Protein Data Bank, through RCSB PDB's APIs: an entry by its PDB id - its title, method, resolution, dates, citation, its polymer entities with their UniProt proteins and organisms, its ligands with their chemical identifiers - and RCSB's full-text search - no key needed.
3 options
Omnilab\Pdb
PdbSource class
final class PdbSource extends HttpSource PdbSource.php:41
The Protein Data Bank, through the APIs of RCSB PDB: an entry by its PDB id (4HHB, or its extended form pdb_00004hhb) - its title, keywords, experimental method, resolution, weight, dates, primary citation and authors; its polymer entities (the chains: their description, strands, length, organism) and its ligands (their chemical component, formula, weight) as properties; the UniProt proteins of its chains, their organisms and its ligands as related things - a structure is not its protein, nor its ligand: the Collector follows none of them -; an image of its first assembly; and RCSB's full-text search.
Which API: the Data API's GraphQL endpoint (data.rcsb.org/graphql), one call for an entry with its entities, where the REST API takes one for the entry, one per polymer entity and one per ligand; RCSB's Search API (search.rcsb.org) for the search, which answers ids only, then one GraphQL call for the page's entries; the Data API's holdings for an entry removed from the archive (its replacement, when it has one).
No key. RCSB rate-limits every API, answers 429 beyond, and asks a client to start at a handful of calls a second: 0.25 s between two.
const BASE_URI = 'https://data.rcsb.org/'const SEARCH_URI = 'https://search.rcsb.org/rcsbsearch/v2/query'const THROTTLE = 0.25Seconds between two calls: RCSB's "a handful a second".
const MAX_PER_PAGE = 100The most entries one search page is asked for: their GraphQL answer grows with each.
PdbSource::__construct()
public function __construct(HttpClientInterface $http, readonly string $searchUri = self::SEARCH_URI, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = self::THROTTLE)PdbSource::getName()
public function getName(): stringPdbSource::capabilities()
public function capabilities(): arrayPdbSource::entity()
public function entity(Identifier|string $id): ?EntityAn entry by its PDB id (4HHB, 4hhb, pdb:4HHB, pdb_00004hhb, its RCSB page): one call. An entry removed from the archive gives the one that replaced it, when only one did (two calls more); several, or none: null. A UniProt accession, a name or any other scheme is refused before any call: search() looks entries up by text.
PdbSource::search()
public function search(Query $query): PageRCSB's full-text search over the experimental structures ("hemoglobin", "spike glycoprotein SARS-CoV-2"), the best first, page by offset: the Search API's ids, then their entries in one GraphQL call. A domain other than biology answers nothing.
PdbSourceFactory class
final class PdbSourceFactory extends SourceFactory PdbSourceFactory.php:22
The Protein Data Bank, through RCSB PDB's APIs: an entry by its PDB id - its title, method, resolution, dates, citation, its polymer entities with their UniProt proteins and organisms, its ligands with their chemical identifiers - and RCSB's full-text search - no key needed.
options: mailto: 'support@glitchr.io' # in the User-Agent: whom RCSB writes to before it blocks a caller throttle: 0.25 # seconds between two calls: RCSB asks to start at a handful a second, and answers 429 beyond its limit base_uri: 'https://data.rcsb.org/' # the Data API: GraphQL, and the holdings of removed entries search_uri: 'https://search.rcsb.org/rcsbsearch/v2/query' # the Search API
Options
| Option | Default | |
|---|---|---|
throttle | PdbSource::THROTTLE | |
base_uri | PdbSource::BASE_URI | |
search_uri | PdbSource::SEARCH_URI |