Skip to content

omnilab/uniprot API reference

Floor
Provider · Omnilab
Version
1.x
Conformance suite
not wired
Verified for real
Its README does not say
Licence
MIT
composer require omnilab/uniprot:1.x-dev

Read from the package's own PHP files at the commit 4f6c9c06bc72: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnilab\UniProt

  • UniProtSource class

    UniProtKB, the protein knowledgebase of the UniProt consortium (EMBL-EBI, SIB, PIR), through its REST API (rest.uniprot.org): a protein by its accession (P68871) or its entry name (HBB_HUMAN); its names, gene, organism, function, length, mass and sequence, where it sits in the cell, its cofactors and the ligands of its binding sites, its keywords; its NCBI Gene and Ensembl genes as cross-references, its organism, structures and ligands as related things; and UniProt's search, page after page.

    5 methods · 4 constants

  • UniProtSourceFactory class

    UniProtKB: proteins, their function, gene, organism, sequence, cofactors and ligands, their genes in NCBI Gene and Ensembl - no key needed.

    4 options

Omnilab\UniProt

UniProtSource class

final class UniProtSource extends HttpSource UniProtSource.php:32

UniProtKB, the protein knowledgebase of the UniProt consortium (EMBL-EBI, SIB, PIR), through its REST API (rest.uniprot.org): a protein by its accession (P68871) or its entry name (HBB_HUMAN); its names, gene, organism, function, length, mass and sequence, where it sits in the cell, its cofactors and the ligands of its binding sites, its keywords; its NCBI Gene and Ensembl genes as cross-references, its organism, structures and ligands as related things; and UniProt's search, page after page.

No key. An entry costs one call, asked for the fields read here only (an entry whole runs to hundreds of kilobytes); an accession merged into another gives that other.

const BASE_URI = 'https://rest.uniprot.org/uniprotkb/'
const MAX_PER_PAGE = 500

The most entries one search page is asked for (UniProt stops at 500).

const ENTRY_FIELDS = 'accession,id,reviewed,protein_name,gene_names,organism_name,organism_id,protein_existence,annotation_score,cc_function,cc_cofactor,cc_subcellular_location,e…

The fields entity() asks for.

const SEARCH_FIELDS = 'accession,id,reviewed,protein_name,gene_names,organism_name,organism_id,protein_existence,annotation_score,cc_function,length,mass,xref_geneid,xref_ensembl'

The fields of a search result: no sequence, no structures.

UniProtSource::__construct()

public function __construct(HttpClientInterface $http, readonly int $sequence = 2000, readonly int $structures = 20, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)
$sequence

the longest sequence given as a property, in residues (0: none)

$structures

how many PDB structures to keep among the related things (0: none)

UniProtSource::getName()

public function getName(): string

UniProtSource::capabilities()

public function capabilities(): array

UniProtSource::entity()

public function entity(Identifier|string $id): ?Entity
public function search(Query $query): Page

UniProt's search: the text in UniProt's query syntax ("hemoglobin beta", "gene:HBB AND organism_id:9606", "reviewed:true AND ec:4.2.1.1"), the best first; the cursor of the next page comes in the answer's Link header, the total in X-Total-Results.

UniProtSourceFactory class

final class UniProtSourceFactory extends SourceFactory UniProtSourceFactory.php:21

UniProtKB: proteins, their function, gene, organism, sequence, cofactors and ligands, their genes in NCBI Gene and Ensembl - no key needed.

options: mailto: 'support@glitchr.io' # in the User-Agent: whom UniProt writes to before it blocks a caller sequence: 2000 # the longest sequence given as a property, in residues (0: none) structures: 20 # how many PDB structures to keep among the related things (0: none) throttle: 0 # seconds between two calls: UniProt publishes no figure base_uri: 'https://rest.uniprot.org/uniprotkb/'

Options

OptionDefault
sequence2000
structures20
throttle0.0
base_uriUniProtSource::BASE_URI