Skip to content

omnilab/string 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/string:1.x-dev

Read from the package's own PHP files at the commit 3b6770b81b11: 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\StringDb

  • Enrichment class

    One term enriched in a set of proteins, as STRING's enrichment gives it: its category (Process, Function, Component for GO; KEGG, RCTM for Reactome, Pfam, InterPro, DISEASES, TISSUES, HPO, Keyword, PMID...), its term and description, how many of the proteins it holds against how many of the genome, the p-value and the false discovery rate, the proteins' names.

    3 methods · 8 properties

  • Interaction class

    One interaction of STRING: two proteins, their combined score (0 to 1) and the score of each evidence channel that supports it (neighborhood, fusion, cooccurrence, coexpression, experiments, databases, textmining; StringSource::CHANNELS).

    3 methods · 6 properties

  • StringSource class

    STRING, the database of known and predicted protein-protein interactions (SIB, CPR, EMBL), through its API: a protein by its STRING id ("9606.ENSP00000269305", TP53), a UniProt accession, an Ensembl protein or a name in a species - its preferred name, annotation, species, its Ensembl protein as a cross-reference, and its interaction partners as related things, each partner's combined score a property; the network among several proteins and their functional enrichment (network(), enrichment(), outside the contract).

    7 methods · 2 constants

  • StringSourceFactory class

    STRING: a protein and its interaction partners, the network among proteins and their enrichment - no key needed.

    6 options

Omnilab\StringDb

Enrichment class

final readonly class Enrichment Enrichment.php:15

One term enriched in a set of proteins, as STRING's enrichment gives it: its category (Process, Function, Component for GO; KEGG, RCTM for Reactome, Pfam, InterPro, DISEASES, TISSUES, HPO, Keyword, PMID...), its term and description, how many of the proteins it holds against how many of the genome, the p-value and the false discovery rate, the proteins' names.

public string $category
public string $term
public ?string $description
public int $count
public int $background
public float $pValue
public float $fdr
public array $proteins

the preferred names of the proteins the term holds

Enrichment::__construct()

public function __construct(public string $category, public string $term, public ?string $description, public int $count, public int $background, public float $pValue, public float $fdr, public array $proteins = [])
$proteins

the preferred names of the proteins the term holds

Enrichment::fromRow()

public static function fromRow(array $row): ?self
$row

a row of enrichment

Enrichment::identifier()

public function identifier(): ?Identifier

The term as an identifier of a scheme Omnilab knows: a GO term (GO:0005344), an InterPro or Pfam entry, an HPO term, a GWAS trait (EFO:0005845), a Reactome pathway (STRING writes HSA-9927020, Reactome R-HSA-9927020); null for the others (KEGG's hsa05143, a PubMed id, a COMPARTMENTS, TISSUES or DISEASES term...).

Interaction class

final readonly class Interaction Interaction.php:14

One interaction of STRING: two proteins, their combined score (0 to 1) and the score of each evidence channel that supports it (neighborhood, fusion, cooccurrence, coexpression, experiments, databases, textmining; StringSource::CHANNELS).

public Identifier $a
public Identifier $b
public float $score
public ?string $nameA
public ?string $nameB
public array $channels

the evidence channels' scores, by name

Interaction::__construct()

public function __construct(public Identifier $a, public Identifier $b, public float $score, public ?string $nameA = null, public ?string $nameB = null, public array $channels = [])
$channels

the evidence channels' scores, by name

Interaction::fromRow()

public static function fromRow(array $row): ?self
$row

a row of interaction_partners or network

Interaction::evidence()

public function evidence(): array

The channels that support it, the strongest first: ['experiments' => 0.999, 'coexpression' => 0.978...]; a zero left out.

StringSource class

final class StringSource extends HttpSource StringSource.php:31

STRING, the database of known and predicted protein-protein interactions (SIB, CPR, EMBL), through its API: a protein by its STRING id ("9606.ENSP00000269305", TP53), a UniProt accession, an Ensembl protein or a name in a species - its preferred name, annotation, species, its Ensembl protein as a cross-reference, and its interaction partners as related things, each partner's combined score a property; the network among several proteins and their functional enrichment (network(), enrichment(), outside the contract).

No key, no account. STRING asks for one call a second at most and for the caller's identity in every call: a 1 s throttle by default and the caller_identity parameter. Two calls an entity (the mapping, the partners).

const BASE_URI = 'https://string-db.org/api/json/'
const CHANNELS = ['nscore' => 'neighborhood', 'fscore' => 'fusion', 'pscore' => 'cooccurrence', 'ascore' => 'coexpression', 'escore' => 'experiments', 'dscore' => 'databases'…

STRING's evidence channels, as its API names their scores.

StringSource::__construct()

public function __construct(HttpClientInterface $http, readonly ?string $species = '9606', readonly int $partners = 10, readonly int $requiredScore = 400, readonly string $callerIdentity = 'omnilab', string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 1.0)
$species

the NCBI taxon a name or an accession is looked up in ("9606"); a STRING id says its own

$partners

how many partners entity() asks for, the best first (0: none, one call)

$requiredScore

the lowest combined score of an interaction, in thousandths (400: STRING's medium confidence)

StringSource::getName()

public function getName(): string

StringSource::capabilities()

public function capabilities(): array

StringSource::entity()

public function entity(Identifier|string $id): ?Entity

A protein by its STRING id ("9606.ENSP00000269305", "string:...", its page), by a UniProt accession or an Ensembl protein (in the configured species), or by a name STRING maps ("TP53", in the configured species); another base's identifier is refused before any call; null when STRING maps nothing.

StringSource::partners()

public function partners(Identifier|string $protein, int $limit = 10): array

A protein's interaction partners, the best first, at the configured score or more: a STRING id, or what entity() reads. Outside the contract (an interaction is two things and a score, not an entity).

StringSource::network()

public function network(array $proteins): array

The interactions among proteins (two or more, of one species: STRING ids, or names in the configured species), at the configured score or more. Outside the contract.

StringSource::enrichment()

public function enrichment(array $proteins): array

The functional enrichment of a set of proteins against their genome (GO processes, functions and components, KEGG and Reactome pathways, Pfam and InterPro domains, diseases, tissues...): every term STRING finds at a false discovery rate under 5 %, the most significant first in each category. Outside the contract.

StringSourceFactory class

final class StringSourceFactory extends SourceFactory StringSourceFactory.php:23

STRING: a protein and its interaction partners, the network among proteins and their enrichment - no key needed.

options: mailto: 'support@glitchr.io' # in the User-Agent caller_identity: 'omnilab' # sent with every call, as STRING asks species: '9606' # the NCBI taxon a name or an accession is looked up in partners: 10 # how many partners entity() asks for (0: none, one call) required_score: 400 # the lowest combined score, in thousandths (400 medium, 700 high, 900 highest) throttle: 1 # seconds between two calls: STRING asks for one a second base_uri: 'https://string-db.org/api/json/'

Options

OptionDefault
caller_identity'omnilab'
species'9606'
partners10
required_score400
throttle1.0
base_uriStringSource::BASE_URI