Read from the package's own PHP files at the commit b14711f7d20e: 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.
AssociationclassOne association of the GWAS Catalog: a variant's risk allele tied to a trait by a study, with its p-value (as the catalogue writes it, its mantissa and exponent: a float underflows past 1e-308), its odds ratio or beta and its confidence interval, the risk allele's frequency, where it lies and the genes mapped to it.
3 methods · 16 properties
GwasSourceclassThe NHGRI-EBI GWAS Catalog through its REST API v2: a study by its accession ("GCST000854") - its reported trait, its traits in EFO, Mondo or HPO, its samples and ancestries, platforms, SNP count, publication, summary statistics -; a variant by its rs id ("rs334") - its functional class, alleles, location, mapped genes -; a trait by its EFO, Mondo or HPO id ("MONDO_0011382") - its name and its studies -; each with its strongest associations (the smallest p-values first) as properties and the studies, variants and traits they tie it to as related things; a search of traits by name; the associations themselves, paged (associations(), outside the contract).
7 methods · 2 constants
GwasSourceFactoryclassThe GWAS Catalog: studies, variants and traits with their strongest associations, a search of traits, the associations paged - no key needed.
3 options
Omnilab\Gwas
Association class
final readonly class Association implements Stringable Association.php:15
One association of the GWAS Catalog: a variant's risk allele tied to a trait by a study, with its p-value (as the catalogue writes it, its mantissa and exponent: a float underflows past 1e-308), its odds ratio or beta and its confidence interval, the risk allele's frequency, where it lies and the genes mapped to it.
public string $idpublic ?Identifier $studypublic Identifiers $variantspublic array $riskAlleles"rs334-T"
public ?float $pValuepublic ?string $pValueTextpublic Identifiers $traitspublic array $reportedthe traits as the study reported them
public ?float $oddsRatiopublic ?string $betapublic ?string $rangepublic ?string $riskFrequencypublic array $genesthe mapped genes' symbols
public array $locations"11:5227002"
public ?string $pubmed
Association::__construct()
public function __construct(public string $id, public ?Identifier $study, public Identifiers $variants, public array $riskAlleles, public ?float $pValue, public ?string $pValueText, public Identifiers $traits, public array $reported = [], public ?float $oddsRatio = null, public ?string $beta = null, public ?string $range = null, public ?string $riskFrequency = null, public array $genes = [], public array $locations = [], public ?string $pubmed = null, public ?string $firstAuthor = null)$riskAlleles"rs334-T"
$genesthe mapped genes' symbols
$locations"11:5227002"
$reportedthe traits as the study reported them
Association::fromRow()
public static function fromRow(array $row): ?self$rowan association of the v2 API
Association::__toString()
public function __toString(): string"rs334-T (HBB): p = 1e-323, Hereditary hemolytic anemias (PheCode 282)"
GwasSource class
final class GwasSource extends HttpSource GwasSource.php:34
The NHGRI-EBI GWAS Catalog through its REST API v2: a study by its accession ("GCST000854") - its reported trait, its traits in EFO, Mondo or HPO, its samples and ancestries, platforms, SNP count, publication, summary statistics -; a variant by its rs id ("rs334") - its functional class, alleles, location, mapped genes -; a trait by its EFO, Mondo or HPO id ("MONDO_0011382") - its name and its studies -; each with its strongest associations (the smallest p-values first) as properties and the studies, variants and traits they tie it to as related things; a search of traits by name; the associations themselves, paged (associations(), outside the contract).
No key, no account, no published rate: no throttle by default. Two calls an entity (the thing, its associations or its studies), one a search page. The v1 API answers 410 since its retirement.
const BASE_URI = 'https://www.ebi.ac.uk/gwas/rest/api/v2/'const MAX_LIMIT = 100The most items a page holds (the API's own cap is higher).
GwasSource::__construct()
public function __construct(HttpClientInterface $http, readonly int $associations = 10, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)$associationshow many associations (or a trait's studies) an entity holds, the strongest first (0: none, one call)
GwasSource::getName()
public function getName(): stringGwasSource::capabilities()
public function capabilities(): arrayGwasSource::entity()
public function entity(Identifier|string $id): ?EntityA study ("GCST000854", its page), a variant ("rs334", "dbsnp:rs334", its dbSNP page) or a trait ("EFO_0004321", "MONDO:0011382", "HP_0001878"); another base's identifier is refused before any call; null when the catalogue has no such thing.
GwasSource::search()
public function search(Query $query): PageThe traits whose name holds the text (the catalogue's EFO, Mondo and HPO terms), in its order; a domain other than biology answers nothing.
An entity of a page holds the trait's name: entity() adds its studies.
GwasSource::associations()
public function associations(Identifier|string $id, int $limit = 25, ?string $cursor = null): PageThe associations of a study, a variant or a trait, the smallest p-value first, one page at a time (the cursor is the page's number).
Outside the contract: an association ties a variant, a trait and a study, with its statistics.
GwasSource::traitOf()
public static function traitOf(string $id): ?IdentifierA trait's id as the catalogue writes it (EFO_0004321, MONDO_0011382) in a scheme of the core; null for the others.
GwasSourceFactory class
final class GwasSourceFactory extends SourceFactory GwasSourceFactory.php:21
The GWAS Catalog: studies, variants and traits with their strongest associations, a search of traits, the associations paged - no key needed.
options: mailto: 'support@glitchr.io' # in the User-Agent associations: 10 # associations (or a trait's studies) an entity holds (0: none, one call) throttle: 0 # seconds between two calls: the catalogue publishes no rate base_uri: 'https://www.ebi.ac.uk/gwas/rest/api/v2/'
Options
| Option | Default | |
|---|---|---|
associations | 10 | |
throttle | 0.0 | |
base_uri | GwasSource::BASE_URI |