| Title: | Clients for Biological Database Web Services |
|---|---|
| Description: | Look up genes, variants and proteins from R, without writing a client for every biological web service. Each service gets one client that makes the request and returns a table. Parsing is a separate function that needs no network, so it can run on a saved response and be tested offline. Transport, retries, caching and error handling are left to the 'biohttp' package. Dependencies for single services are optional, so you do not install what you will not use. The services covered include 'Ensembl', described in Dyer et al. (2025) <doi:10.1093/nar/gkae1071>, 'UniProt', in The UniProt Consortium (2025) <doi:10.1093/nar/gkae1010>, 'gnomAD', in Chen et al. (2024) <doi:10.1038/s41586-023-06045-0>, 'Open Targets', in Buniello et al. (2025) <doi:10.1093/nar/gkae1128>, and the 'AlphaFold' Protein Structure Database, in Varadi et al. (2024) <doi:10.1093/nar/gkad1011>. Each client's help page cites the service it calls. |
| Authors: | Samuel Bharti [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-4190-7058>), Barret Schloerke [ths] (ORCID: <https://orcid.org/0000-0001-9986-114X>), Carson Sievert [ths] (ORCID: <https://orcid.org/0000-0002-4958-2844>), Posit Software, PBC [cph, fnd] (ROR: <https://ror.org/03wc8by49>) |
| Maintainer: | Samuel Bharti <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1.9000 |
| Built: | 2026-10-08 16:48:19 UTC |
| Source: | https://github.com/samuelbharti/bioclients |
Metadata only. No coordinates are downloaded; use pdb_url from the result
for that, and only when something is actually going to render it.
alphafold_model(accession, ...)alphafold_model(accession, ...)
accession |
A UniProt accession, for example |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble. See
alphafold_parse_model().
Varadi et al. (2024). AlphaFold Protein Structure Database in 2024: providing structure coverage for over 214 million protein sequences. Nucleic Acids Research 52(D1), D368-D375. doi:10.1093/nar/gkad1011
Service documentation: https://alphafold.ebi.ac.uk/
biohttp::body_or_null(alphafold_model("P15056"))biohttp::body_or_null(alphafold_model("P15056"))
Pure.
alphafold_parse_model(body, accession = NA_character_)alphafold_parse_model(body, accession = NA_character_)
body |
A parsed AlphaFold prediction response. |
accession |
The UniProt accession that was queried. |
A one-row tibble of accession, pdb_url, cif_url, version,
mean_plddt, and source_url. NULL when there is no model.
The API returns a JSON array of model records, not an object, even for a
single accession. Reading it as an object yields NULL for every field while
looking like a successful parse. This handles either shape.
Varadi et al. (2024). AlphaFold Protein Structure Database in 2024: providing structure coverage for over 214 million protein sequences. Nucleic Acids Research 52(D1), D368-D375. doi:10.1093/nar/gkad1011
Service documentation: https://alphafold.ebi.ac.uk/
body <- list(list( pdbUrl = "https://alphafold.ebi.ac.uk/files/AF-P15056-F1-model_v6.pdb", latestVersion = 6, globalMetricValue = 66.38 )) alphafold_parse_model(body, "P15056")body <- list(list( pdbUrl = "https://alphafold.ebi.ac.uk/files/AF-P15056-F1-model_v6.pdb", latestVersion = 6, globalMetricValue = 66.38 )) alphafold_parse_model(body, "P15056")
Curated clinical evidence counts for a gene
civic_gene(symbol, ...)civic_gene(symbol, ...)
symbol |
A HUGO gene symbol. |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble. See
civic_parse_gene().
CIViC's gene query takes the symbol as an inline string rather than a
GraphQL variable, so the symbol is substituted into the query text. It is run
through this package's internal clean_symbol() first, which strips
everything outside [A-Za-z0-9._-]. That is what stops a crafted symbol
closing the string and appending its own query. Do not remove it, and do not
switch to paste0() without it.
Griffith et al. (2017). CIViC is a community knowledgebase for expert crowdsourcing the clinical interpretation of variants in cancer. Nature Genetics 49(2), 170-174. doi:10.1038/ng.3774
Service documentation: https://civicdb.org/
biohttp::body_or_null(civic_gene("NF1"))biohttp::body_or_null(civic_gene("NF1"))
Pure.
civic_parse_gene(body)civic_parse_gene(body)
body |
A parsed CIViC GraphQL response body. |
A one-row tibble of id, symbol, entrez_id, evidence_items,
assertions, variants, and source_url. NULL when CIViC does not track
the gene, which it reports as data.gene = null.
Griffith et al. (2017). CIViC is a community knowledgebase for expert crowdsourcing the clinical interpretation of variants in cancer. Nature Genetics 49(2), 170-174. doi:10.1038/ng.3774
Service documentation: https://civicdb.org/
body <- list(data = list(gene = list( id = 3867, name = "NF1", entrezId = 4763, link = "/features/3867", stats = list(evidenceItemCount = 56, assertionCount = 0, variantCount = 37) ))) civic_parse_gene(body)body <- list(data = list(gene = list( id = 3867, name = "NF1", entrezId = 4763, link = "/features/3867", stats = list(evidenceItemCount = 56, assertionCount = 0, variantCount = 37) ))) civic_parse_gene(body)
One batched POST. The response comes back in input order.
clingen_alleles(hgvs, throttle = CLINGEN_THROTTLE, ...)clingen_alleles(hgvs, throttle = CLINGEN_THROTTLE, ...)
hgvs |
HGVS strings. |
throttle |
A throttle spec. Defaults to the documented 3 per second. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
clingen_parse_allele().
Pawliczek et al. (2018). ClinGen Allele Registry links information about genetic variants. Human Mutation 39(11), 1690-1701. doi:10.1002/humu.23637
Service documentation: https://reg.clinicalgenome.org/
biohttp::body_or_null(clingen_alleles("NM_000546.6:c.215C>G"))biohttp::body_or_null(clingen_alleles("NM_000546.6:c.215C>G"))
Fetches the whole published CSV. See the note in the file header on why this
is one download rather than a request per gene, and use
clingen_validity_for() to narrow the result.
clingen_gene_validity(...)clingen_gene_validity(...)
... |
Passed to |
A biohttp envelope whose data is the tibble described in
clingen_parse_validity().
Strande et al. (2017). Evaluating the clinical validity of gene-disease associations: an evidence-based framework developed by the Clinical Genome Resource. The American Journal of Human Genetics 100(6), 895-906. doi:10.1016/j.ajhg.2017.04.015
Service documentation: https://search.clinicalgenome.org/
table <- biohttp::body_or_null(clingen_gene_validity()) clingen_validity_for(table, c("NF1", "TP53"))table <- biohttp::body_or_null(clingen_gene_validity()) clingen_validity_for(table, c("NF1", "TP53"))
Pure.
clingen_parse_allele(element)clingen_parse_allele(element)
element |
One parsed Allele Registry element. |
A one-row tibble.
ClinGen answers an input it could not resolve with an object carrying no
@id, and an errorType/message instead. That becomes a row with
resolved = FALSE and the reason, rather than being dropped. Dropping it
would shift every later row onto the wrong variant, and would lose the reason
the input was rejected.
Pawliczek et al. (2018). ClinGen Allele Registry links information about genetic variants. Human Mutation 39(11), 1690-1701. doi:10.1002/humu.23637
Service documentation: https://reg.clinicalgenome.org/
clingen_parse_allele(list(errorType = "IncorrectHgvsPosition"))clingen_parse_allele(list(errorType = "IncorrectHgvsPosition"))
Pure. One row per element, in the order returned, which is the order asked.
clingen_parse_batch(body)clingen_parse_batch(body)
body |
A parsed Allele Registry response, an array. |
A tibble with one row per element.
Pawliczek et al. (2018). ClinGen Allele Registry links information about genetic variants. Human Mutation 39(11), 1690-1701. doi:10.1002/humu.23637
Service documentation: https://reg.clinicalgenome.org/
Pure. Takes the file as a single string, the way biohttp::get_text()
returns it.
clingen_parse_validity(text)clingen_parse_validity(text)
text |
The CSV file contents. |
A tibble of gene, hgnc, disease, mondo, moi,
classification, sop, panel, date, and source_url, one row per
curation. A gene appears once per disease it has been curated against.
NULL when the file is empty or carries no header.
Strande et al. (2017). Evaluating the clinical validity of gene-disease associations: an evidence-based framework developed by the Clinical Genome Resource. The American Journal of Human Genetics 100(6), 895-906. doi:10.1016/j.ajhg.2017.04.015
Service documentation: https://search.clinicalgenome.org/
text <- paste( '"CLINGEN GENE DISEASE VALIDITY CURATIONS","",""', '"+++","+++","+++"', '"GENE SYMBOL","DISEASE LABEL","CLASSIFICATION"', '"+++","+++","+++"', '"NF1","neurofibromatosis type 1","Definitive"', sep = "\n" ) clingen_parse_validity(text)text <- paste( '"CLINGEN GENE DISEASE VALIDITY CURATIONS","",""', '"+++","+++","+++"', '"GENE SYMBOL","DISEASE LABEL","CLASSIFICATION"', '"+++","+++","+++"', '"NF1","neurofibromatosis type 1","Definitive"', sep = "\n" ) clingen_parse_validity(text)
Pure. Matching is case-insensitive on the symbol.
clingen_validity_for(table, symbols)clingen_validity_for(table, symbols)
table |
A tibble from |
symbols |
Gene symbols. |
The matching rows, or NULL when none match.
Strande et al. (2017). Evaluating the clinical validity of gene-disease associations: an evidence-based framework developed by the Clinical Genome Resource. The American Journal of Human Genetics 100(6), 895-906. doi:10.1016/j.ajhg.2017.04.015
Service documentation: https://search.clinicalgenome.org/
table <- tibble::tibble( gene = c("NF1", "TP53"), classification = c("Definitive", "Definitive") ) clingen_validity_for(table, "nf1")table <- tibble::tibble( gene = c("NF1", "TP53"), classification = c("Definitive", "Definitive") ) clingen_validity_for(table, "nf1")
Pure. For colouring and grouping, where the full free-text significance is too granular to plot.
clinvar_category(significance)clinvar_category(significance)
significance |
A ClinVar clinical significance string. |
The order of the checks matters. A conflicting record usually contains the word "pathogenic" too, so conflicting has to be tested first or every conflicting record reads as pathogenic.
One of "Conflicting", "Pathogenic / likely",
"Benign / likely", "Uncertain", or "Other".
Landrum et al. (2018). ClinVar: improving access to variant interpretations and supporting evidence. Nucleic Acids Research 46(D1), D1062-D1067. doi:10.1093/nar/gkx1153
Service documentation: https://www.ncbi.nlm.nih.gov/clinvar/
clinvar_category("Pathogenic") clinvar_category("Conflicting interpretations of pathogenicity")clinvar_category("Pathogenic") clinvar_category("Conflicting interpretations of pathogenicity")
Searches ClinVar for term and returns the classification of one record.
clinvar_classification(term, throttle = clinvar_throttle(), allele = NULL, ...)clinvar_classification(term, throttle = clinvar_throttle(), allele = NULL, ...)
term |
A search term. An SPDI or a VCV accession matches one record; an rsID or an HGVS name can match several. |
throttle |
A throttle spec, see |
allele |
Optional. The protein change you mean, such as |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble with the columns
of clinvar_parse_record() and n_matches, the number of records that fit
the request. no_data when nothing matches, including when no record has
the protein change in allele.
ClinVar's search is a text search, and an rsID or an HGVS name often matches
more than one record. rs113488022 matches BRAF V600G and V600E, and ClinVar
lists V600G first. NM_004333.6:c.1799T>A, the HGVS name of V600E, lists
BRAF I208V first, a different variant at a different position.
There are two ways to get the record you mean:
Pass a precise term. An SPDI such as NC_000007.14:140753335:A:T, or a
VCV accession such as VCV000013961, matches one record.
Pass allele, the protein change you mean, such as "V600E" or
"p.Val600Glu". It is checked against each record's own list of protein
changes, and the first record that has it is returned.
Without either, the first record ClinVar lists is returned, and n_matches
says how many records the term matched. A value above 1 means the row may be
for a different variant from the one you meant.
Only the first 20 records ClinVar lists are fetched, so allele is checked
against those. An rsID or an HGVS name matches far fewer.
Set NCBI_API_KEY and both requests carry it, which raises the rate limit
from 3 to 10 requests a second. It is passed as a secret_query, so it stays
out of the cache key and out of every message. Without one the client works
at the lower limit, and the default throttle follows: 3 a second without
a key, 10 with one.
NCBI asks every client to send tool and email. They are read from
BIOHTTP_CALLER_IDENTITY and BIOHTTP_CONTACT_EMAIL, the same variables
biohttp builds its User-Agent from, and a blank one is omitted. They are
ordinary query parameters, so they are part of the cache key.
Landrum et al. (2018). ClinVar: improving access to variant interpretations and supporting evidence. Nucleic Acids Research 46(D1), D1062-D1067. doi:10.1093/nar/gkx1153
Service documentation: https://www.ncbi.nlm.nih.gov/clinvar/
biohttp::body_or_null(clinvar_classification("NC_000007.14:140753335:A:T")) biohttp::body_or_null(clinvar_classification("rs113488022", allele = "V600E"))biohttp::body_or_null(clinvar_classification("NC_000007.14:140753335:A:T")) biohttp::body_or_null(clinvar_classification("rs113488022", allele = "V600E"))
Pure.
clinvar_conditions(germline)clinvar_conditions(germline)
germline |
The |
A single semicolon-separated string, or NA_character_.
Landrum et al. (2018). ClinVar: improving access to variant interpretations and supporting evidence. Nucleic Acids Research 46(D1), D1062-D1067. doi:10.1093/nar/gkx1153
Service documentation: https://www.ncbi.nlm.nih.gov/clinvar/
clinvar_conditions(list(trait_set = list(list(trait_name = "RASopathy"))))clinvar_conditions(list(trait_set = list(list(trait_name = "RASopathy"))))
Pure. Takes one record from the result block of an esummary response, not
the whole response, because the record is keyed by UID and the caller already
knows which UID it asked for.
clinvar_parse_record(record, uid = NA_character_)clinvar_parse_record(record, uid = NA_character_)
record |
A parsed ClinVar esummary record. |
uid |
The ClinVar UID the record came from. |
A one-row tibble with uid, accession, title, significance,
review_status, last_evaluated, and conditions. NULL when record
is absent.
Landrum et al. (2018). ClinVar: improving access to variant interpretations and supporting evidence. Nucleic Acids Research 46(D1), D1062-D1067. doi:10.1093/nar/gkx1153
Service documentation: https://www.ncbi.nlm.nih.gov/clinvar/
record <- list( accession = "VCV000040389", title = "NM_004333.6(BRAF):c.1799T>G (p.Val600Gly)", germline_classification = list( description = "Pathogenic", review_status = "reviewed by expert panel" ) ) clinvar_parse_record(record, "40389")record <- list( accession = "VCV000040389", title = "NM_004333.6(BRAF):c.1799T>G (p.Val600Gly)", germline_classification = list( description = "Pathogenic", review_status = "reviewed by expert panel" ) ) clinvar_parse_record(record, "40389")
A thin wrapper over dgidb_genes().
dgidb_gene(symbol, ...)dgidb_gene(symbol, ...)
symbol |
A gene symbol. |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble.
Cannon et al. (2024). DGIdb 5.0: rebuilding the drug-gene interaction database for precision medicine and drug discovery platforms. Nucleic Acids Research 52(D1), D1227-D1235. doi:10.1093/nar/gkad1040
Service documentation: https://dgidb.org/
biohttp::body_or_null(dgidb_gene("NF1"))biohttp::body_or_null(dgidb_gene("NF1"))
One request for the whole list, because DGIdb's genes query already takes an
array.
dgidb_genes(symbols, ...)dgidb_genes(symbols, ...)
symbols |
Gene symbols. |
... |
Passed to |
A biohttp envelope whose data is a tibble with one row per entry in
symbols, in the same order. See dgidb_parse_genes() for the columns and
for why an unknown gene is NA rather than 0.
Cannon et al. (2024). DGIdb 5.0: rebuilding the drug-gene interaction database for precision medicine and drug discovery platforms. Nucleic Acids Research 52(D1), D1227-D1235. doi:10.1093/nar/gkad1040
Service documentation: https://dgidb.org/
biohttp::body_or_null(dgidb_genes(c("NF1", "BRAF")))biohttp::body_or_null(dgidb_genes(c("NF1", "BRAF")))
Pure. Rows come back in symbols order, one per input.
dgidb_parse_genes(body, symbols)dgidb_parse_genes(body, symbols)
body |
A parsed DGIdb GraphQL response body. |
symbols |
The gene symbols that were queried, in the order asked. |
A tibble of symbol, concept_id, interaction_count, and
source_url, one row per entry in symbols.
The distinction this parser exists to preserve. A gene DGIdb knows about with
no recorded interactions has interaction_count = 0: that is an answer, and
it means the gene is not currently druggable. A gene DGIdb has never heard of
has interaction_count = NA: that is an absence of evidence.
Collapsing the two would tell a caller that an unknown gene is known not to be druggable, which is a different and much stronger claim than the data supports.
Cannon et al. (2024). DGIdb 5.0: rebuilding the drug-gene interaction database for precision medicine and drug discovery platforms. Nucleic Acids Research 52(D1), D1227-D1235. doi:10.1093/nar/gkad1040
Service documentation: https://dgidb.org/
body <- list(data = list(genes = list(nodes = list( list(name = "NF1", conceptId = "hgnc:7765", interactions = list(list(), list())) )))) dgidb_parse_genes(body, "NF1")body <- list(data = list(genes = list(nodes = list( list(name = "NF1", conceptId = "hgnc:7765", interactions = list(list(), list())) )))) dgidb_parse_genes(body, "NF1")
Genes DISEASES associates with a disease, from one channel
diseases_channel( doid, channel = c("Knowledge", "Textmining"), limit = 300, ... )diseases_channel( doid, channel = c("Knowledge", "Textmining"), limit = 300, ... )
doid |
A Disease Ontology id, for example |
channel |
|
limit |
Maximum genes to ask for. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
diseases_parse_channel().
Pletscher-Frankild et al. (2015). DISEASES: text mining and data integration of disease-gene associations. Methods 74, 83-89. doi:10.1016/j.ymeth.2014.11.020
Service documentation: https://diseases.jensenlab.org/
biohttp::body_or_null(diseases_channel("DOID:0060293", "Knowledge"))biohttp::body_or_null(diseases_channel("DOID:0060293", "Knowledge"))
Queries Knowledge and Textmining together and keeps the strongest score
per gene. Read the note on diseases_merge_channels() before relying on the
combined score.
diseases_gene_associations(doid, limit = 300, ...)diseases_gene_associations(doid, limit = 300, ...)
doid |
A Disease Ontology id, for example |
limit |
Maximum genes to ask for. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
diseases_merge_channels(), with source_url added.
If either channel errors, its envelope is returned rather than a combined
score built from the other one. A result that silently dropped the curated
channel would look like a weaker association rather than a partial answer,
and the envelope has no status that says "half of this is missing". Call
diseases_channel() per channel to handle the halves separately.
Pletscher-Frankild et al. (2015). DISEASES: text mining and data integration of disease-gene associations. Methods 74, 83-89. doi:10.1016/j.ymeth.2014.11.020
Service documentation: https://diseases.jensenlab.org/
biohttp::body_or_null(diseases_gene_associations("DOID:0060293"))biohttp::body_or_null(diseases_gene_associations("DOID:0060293"))
Pure.
diseases_merge_channels(tables)diseases_merge_channels(tables)
tables |
A list of tibbles from |
A tibble of symbol, score, and channel, ordered by score,
highest first. channel names the channel the winning score came from.
NULL when there is nothing to combine.
DISEASES scores each channel separately and does not publish a combined
figure. Taking the maximum treats curated and mined evidence as
interchangeable, which suits a screen looking for any support at all and
suits nothing that cares where the support came from. Use
diseases_channel() and keep the channels apart if that distinction
matters.
Pletscher-Frankild et al. (2015). DISEASES: text mining and data integration of disease-gene associations. Methods 74, 83-89. doi:10.1016/j.ymeth.2014.11.020
Service documentation: https://diseases.jensenlab.org/
diseases_merge_channels(list( tibble::tibble(symbol = "NF1", protein = NA, score = 5, channel = "Knowledge"), tibble::tibble(symbol = "NF1", protein = NA, score = 2, channel = "Textmining") ))diseases_merge_channels(list( tibble::tibble(symbol = "NF1", protein = NA, score = 5, channel = "Knowledge"), tibble::tibble(symbol = "NF1", protein = NA, score = 2, channel = "Textmining") ))
Pure.
diseases_parse_channel(body, channel = NA_character_)diseases_parse_channel(body, channel = NA_character_)
body |
A parsed response from one DISEASES channel. |
channel |
The channel the body came from, recorded in the result. |
A tibble of symbol, protein, score, and channel, one row per
associated gene. NULL when the channel has no associations. Rows with no
symbol or a non-finite score are dropped, because neither is usable.
Pletscher-Frankild et al. (2015). DISEASES: text mining and data integration of disease-gene associations. Methods 74, 83-89. doi:10.1016/j.ymeth.2014.11.020
Service documentation: https://diseases.jensenlab.org/
body <- list( list(ENSP00000351015 = list(name = "NF1", score = 5)), list() ) diseases_parse_channel(body, "Knowledge")body <- list( list(ENSP00000351015 = list(name = "NF1", score = 5)), list() ) diseases_parse_channel(body, "Knowledge")
The exon model for a gene
ensembl_gene_model(gene_id, ...)ensembl_gene_model(gene_id, ...)
gene_id |
An Ensembl gene id, for example |
... |
Passed to |
A biohttp envelope whose data is the list described in
ensembl_parse_gene_model().
Dyer et al. (2025). Ensembl 2025. Nucleic Acids Research 53(D1), D948-D957. doi:10.1093/nar/gkae1071
Service documentation: https://rest.ensembl.org/
biohttp::body_or_null(ensembl_gene_model("ENSG00000157764"))$exonsbiohttp::body_or_null(ensembl_gene_model("ENSG00000157764"))$exons
Pure.
ensembl_parse_consequences(consequences)ensembl_parse_consequences(consequences)
consequences |
The |
Every consequence is returned, with its biotype, rather than only the
protein-coding ones. Which biotypes are worth showing is the caller's call,
and a filter here would hide the non-coding rows from a caller that wanted
them.
A tibble of gene, gene_id, transcript, biotype,
consequence, impact, sift, and polyphen. NULL when there are
none.
Dyer et al. (2025). Ensembl 2025. Nucleic Acids Research 53(D1), D948-D957. doi:10.1093/nar/gkae1071
Service documentation: https://rest.ensembl.org/
ensembl_parse_consequences(list(list( gene_symbol = "BRAF", transcript_id = "ENST00000646891", biotype = "protein_coding", consequence_terms = list("missense_variant"), impact = "MODERATE" )))ensembl_parse_consequences(list(list( gene_symbol = "BRAF", transcript_id = "ENST00000646891", biotype = "protein_coding", consequence_terms = list("missense_variant"), impact = "MODERATE" )))
Pure.
ensembl_parse_gene_model(record)ensembl_parse_gene_model(record)
record |
A parsed |
A list of transcript, strand, region, gene_start,
gene_end, and exons, a tibble of start, end, and number sorted by
start. NULL when the record carries no transcript with exons.
Exons are sorted by genomic coordinate and then numbered in transcription order. On the minus strand that means the highest-coordinate exon is exon 1. Numbering by coordinate alone would put exon 1 at the wrong end of every minus-strand gene.
Dyer et al. (2025). Ensembl 2025. Nucleic Acids Research 53(D1), D948-D957. doi:10.1093/nar/gkae1071
Service documentation: https://rest.ensembl.org/
record <- list( seq_region_name = "17", start = 1, end = 900, Transcript = list(list( id = "ENST1", is_canonical = 1, strand = -1, Exon = list(list(start = 800, end = 900), list(start = 1, end = 100)) )) ) ensembl_parse_gene_model(record)$exonsrecord <- list( seq_region_name = "17", start = 1, end = 900, Transcript = list(list( id = "ENST1", is_canonical = 1, strand = -1, Exon = list(list(start = 800, end = 900), list(start = 1, end = 100)) )) ) ensembl_parse_gene_model(record)$exons
Pure.
ensembl_parse_vep(record)ensembl_parse_vep(record)
record |
One element of a VEP response. |
A list of most_severe, assembly, and consequences (the tibble
from ensembl_parse_consequences()). NULL when the record is empty.
Dyer et al. (2025). Ensembl 2025. Nucleic Acids Research 53(D1), D948-D957. doi:10.1093/nar/gkae1071
Service documentation: https://rest.ensembl.org/
ensembl_parse_vep(list( most_severe_consequence = "missense_variant", assembly_name = "GRCh38" ))ensembl_parse_vep(list( most_severe_consequence = "missense_variant", assembly_name = "GRCh38" ))
Run VEP for a variant id
ensembl_vep_id(rsid, ...)ensembl_vep_id(rsid, ...)
rsid |
A variant id, for example |
... |
Passed to |
A biohttp envelope whose data is the list described in
ensembl_parse_vep().
The same caveat as gnomad_frequency() and clinvar_classification().
7:g.140753336A>T and 7:g.140753336A>C share rs113488022, so Ensembl may
answer for more than one allele. The first record is used. Post coordinates
with vep_variants() when the allele matters.
Dyer et al. (2025). Ensembl 2025. Nucleic Acids Research 53(D1), D948-D957. doi:10.1093/nar/gkae1071
Service documentation: https://rest.ensembl.org/
biohttp::body_or_null(ensembl_vep_id("rs113488022"))$consequencesbiohttp::body_or_null(ensembl_vep_id("rs113488022"))$consequences
Asks for one row with resultType = "idlist", because only the count is
wanted. Read the note in the file header: a count of 0 comes back as ok,
not as no_data.
europepmc_count(query, ...)europepmc_count(query, ...)
query |
A query string. Build one with |
... |
Passed to |
A biohttp envelope whose data is a list of count, query, and
source_url.
Ferguson et al. (2021). Europe PMC in 2020. Nucleic Acids Research 49(D1), D1507-D1514. doi:10.1093/nar/gkaa994
Service documentation: https://europepmc.org/
biohttp::body_or_null(europepmc_count(europepmc_query("NF1")))$countbiohttp::body_or_null(europepmc_count(europepmc_query("NF1")))$count
Pure. 0 is a real count and comes back as 0L; only an absent hitCount
is NA.
europepmc_parse_count(body)europepmc_parse_count(body)
body |
A parsed Europe PMC |
A single integer, or NA_integer_.
Ferguson et al. (2021). Europe PMC in 2020. Nucleic Acids Research 49(D1), D1507-D1514. doi:10.1093/nar/gkaa994
Service documentation: https://europepmc.org/
europepmc_parse_count(list(hitCount = 2530)) europepmc_parse_count(list(hitCount = 0))europepmc_parse_count(list(hitCount = 2530)) europepmc_parse_count(list(hitCount = 0))
Pure.
europepmc_parse_results(body)europepmc_parse_results(body)
body |
A parsed Europe PMC |
source_id is the citable identifier: PMID:<n> where there is a PMID, and
<source>:<id> otherwise, because a preprint or a patent record has no PMID
but is still groundable.
A tibble of title, authors, year, journal, pmid, doi,
cited_by, source, source_id, and source_url, newest first, which is
the order Europe PMC returns. NULL when nothing matched.
Ferguson et al. (2021). Europe PMC in 2020. Nucleic Acids Research 49(D1), D1507-D1514. doi:10.1093/nar/gkaa994
Service documentation: https://europepmc.org/
body <- list(resultList = list(result = list(list( id = "36197410", source = "MED", pmid = "36197410", title = "TP53 or Not TP53", authorString = "Green SD.", journalTitle = "Clin Cancer Res", pubYear = "2022" )))) europepmc_parse_results(body)body <- list(resultList = list(result = list(list( id = "36197410", source = "MED", pmid = "36197410", title = "TP53 or Not TP53", authorString = "Green SD.", journalTitle = "Clin Cancer Res", pubYear = "2022" )))) europepmc_parse_results(body)
Each term is quoted so a multi-word term matches as a phrase rather than as loose words, and the terms are ANDed. Quoting also stops a term containing a space or a colon from being read as query syntax.
europepmc_query(...)europepmc_query(...)
... |
Terms, for example a gene symbol and an rsID. Blank terms are dropped. |
A single query string, or NULL when nothing usable was given.
Ferguson et al. (2021). Europe PMC in 2020. Nucleic Acids Research 49(D1), D1507-D1514. doi:10.1093/nar/gkaa994
Service documentation: https://europepmc.org/
europepmc_query("BRAF") europepmc_query("BRAF", "V600E")europepmc_query("BRAF") europepmc_query("BRAF", "V600E")
Search Europe PMC
europepmc_search(query, limit = 15, ...)europepmc_search(query, limit = 15, ...)
query |
A query string. Build one with |
limit |
Maximum results to return. |
... |
Passed to |
A biohttp envelope whose data is a list of results (the tibble
from europepmc_parse_results()), count (Europe PMC's total, not the
page size), and query.
Ferguson et al. (2021). Europe PMC in 2020. Nucleic Acids Research 49(D1), D1507-D1514. doi:10.1093/nar/gkaa994
Service documentation: https://europepmc.org/
biohttp::body_or_null(europepmc_search(europepmc_query("BRAF", "V600E")))biohttp::body_or_null(europepmc_search(europepmc_query("BRAF", "V600E")))
How intolerant a gene is to variation. pli and loeuf summarize
loss-of-function intolerance; the Z-scores summarize missense and synonymous
depletion.
gnomad_constraint(symbol, reference_genome = "GRCh38", ...)gnomad_constraint(symbol, reference_genome = "GRCh38", ...)
symbol |
A gene symbol. |
reference_genome |
|
... |
Passed to |
A biohttp envelope whose data is a one-row tibble. See
gnomad_parse_constraint().
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
biohttp::body_or_null(gnomad_constraint("BRAF"))biohttp::body_or_null(gnomad_constraint("BRAF"))
Batched through GraphQL aliases, so a gene list costs a handful of requests
rather than one per gene. Chunked at chunk_size to stay under gnomAD's
query cost cap of 25. See GNOMAD_CHUNK.
gnomad_constraints( symbols, reference_genome = "GRCh38", chunk_size = GNOMAD_CHUNK, ... )gnomad_constraints( symbols, reference_genome = "GRCh38", chunk_size = GNOMAD_CHUNK, ... )
symbols |
Gene symbols. |
reference_genome |
|
chunk_size |
Genes per request. |
... |
Passed to |
A biohttp envelope whose data is a tibble with one row per entry in
symbols, in the same order.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
biohttp::body_or_null(gnomad_constraints(c("BRAF", "TP53", "EGFR")))biohttp::body_or_null(gnomad_constraints(c("BRAF", "TP53", "EGFR")))
Batched through GraphQL aliases and chunked at chunk_size to stay under
gnomAD's query cost cap of 25, which was verified for this query. See
GNOMAD_CHUNK. Dispatched through biohttp::post_json_many(), so only
the chunks the cache is missing go over the wire.
gnomad_frequencies( variant_ids, dataset = GNOMAD_DATASET, reference_genome = "GRCh38", chunk_size = GNOMAD_CHUNK, ... )gnomad_frequencies( variant_ids, dataset = GNOMAD_DATASET, reference_genome = "GRCh38", chunk_size = GNOMAD_CHUNK, ... )
variant_ids |
gnomAD variant ids, see |
dataset |
The gnomAD dataset. |
reference_genome |
The assembly the id is on. The variant query is
keyed by dataset alone, so this is checked against |
chunk_size |
Variants per request. |
... |
Passed to |
A failed chunk yields a row of NA per variant rather than taking the
whole call down, following gnomad_constraints(). A variant gnomAD has no
record of is a row of NA too, because that is an answer.
A biohttp envelope whose data is a tibble with one row per entry
in variant_ids, in the same order. See gnomad_parse_variant().
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
biohttp::body_or_null(gnomad_frequencies( c("17-7676154-G-C", "7-117559590-ATCT-A") ))biohttp::body_or_null(gnomad_frequencies( c("17-7676154-G-C", "7-117559590-ATCT-A") ))
Looked up by rsID, which is what gnomAD's variant query takes.
gnomad_frequency(rsid, dataset = GNOMAD_DATASET, ...)gnomad_frequency(rsid, dataset = GNOMAD_DATASET, ...)
rsid |
A dbSNP rsID. |
dataset |
The gnomAD dataset. |
... |
Passed to |
A biohttp envelope whose data is the list described in
gnomad_parse_frequency().
7:g.140753336A>T and 7:g.140753336A>C both map to rs113488022. Any
lookup routed through an rsID is therefore lossy, and it fails silently
while looking entirely plausible. The canonical key is
(assembly, chromosome, position, ref, alt).
This function is faithful to what gnomAD's variant query accepts, so the limitation is gnomAD's rather than this package's. Know about it before you rely on the answer for a multi-allelic site.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
biohttp::body_or_null(gnomad_frequency("rs113488022"))biohttp::body_or_null(gnomad_frequency("rs113488022"))
Looked up by chrom-pos-ref-alt, which names one allele exactly. This is
the lookup gnomad_frequency() cannot do, because an rsID is shared by
every allele at a site.
gnomad_frequency_by_id( variant_id, dataset = GNOMAD_DATASET, reference_genome = "GRCh38", ... )gnomad_frequency_by_id( variant_id, dataset = GNOMAD_DATASET, reference_genome = "GRCh38", ... )
variant_id |
A gnomAD variant id, see |
dataset |
The gnomAD dataset. |
reference_genome |
The assembly the id is on. The variant query is
keyed by dataset alone, so this is checked against |
... |
Passed to |
A biohttp envelope whose data is the one-row tibble described in
gnomad_parse_variant(). no_data when gnomAD has no record of the
variant.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
biohttp::body_or_null(gnomad_frequency_by_id("17-7676154-G-C"))biohttp::body_or_null(gnomad_frequency_by_id("17-7676154-G-C"))
Pure. Takes an already-parsed response body and never touches the network.
gnomad_parse_constraint(body, symbol = NA_character_)gnomad_parse_constraint(body, symbol = NA_character_)
body |
A parsed gnomAD GraphQL response body. |
symbol |
The gene symbol that was queried. |
loeuf is gnomAD's oe_lof_upper. The two names are the same number, and
the field is called oe_lof_upper in the API but LOEUF everywhere else,
including in the ranking models that consume it. Both names appear here so a
reader of either can find it.
A one-row tibble with symbol, pli, loeuf, oe_lof, oe_mis,
mis_z, syn_z, and lof_z. NULL when the gene has no constraint
block, which is common and is an answer rather than a fault.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
body <- list(data = list(gene = list( gnomad_constraint = list(pli = 1, oe_lof_upper = 0.23) ))) gnomad_parse_constraint(body, "BRAF")body <- list(data = list(gene = list( gnomad_constraint = list(pli = 1, oe_lof_upper = 0.23) ))) gnomad_parse_constraint(body, "BRAF")
Pure. The batched query uses GraphQL aliases g1, g2, and so on, so the
response is keyed by alias rather than by symbol. Rows are mapped back by
alias index rather than by the echoed symbol, so the result stays aligned
even for a gene gnomAD does not return a symbol for.
gnomad_parse_constraints(body, symbols)gnomad_parse_constraints(body, symbols)
body |
A parsed gnomAD GraphQL response body. |
symbols |
The gene symbols that were queried, in the order asked. |
A tibble with one row per entry in symbols, same order. A gene with
no constraint block gets a row of NA rather than being dropped.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
body <- list(data = list( g1 = list(symbol = "BRAF", gnomad_constraint = list(oe_lof_upper = 0.23)), g2 = list(symbol = "TP53", gnomad_constraint = NULL) )) gnomad_parse_constraints(body, c("BRAF", "TP53"))body <- list(data = list( g1 = list(symbol = "BRAF", gnomad_constraint = list(oe_lof_upper = 0.23)), g2 = list(symbol = "TP53", gnomad_constraint = NULL) )) gnomad_parse_constraints(body, c("BRAF", "TP53"))
Pure.
gnomad_parse_frequency(body, dataset = GNOMAD_DATASET)gnomad_parse_frequency(body, dataset = GNOMAD_DATASET)
body |
A parsed gnomAD GraphQL response body. |
dataset |
The dataset that was queried, carried through to the result. |
A list of variant_id, dataset, exome, genome, and
populations, or NULL when the body carries no variant.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
body <- list(data = list(variant = list( variant_id = "7-140753336-A-T", exome = list(af = 0.001, ac = 2, an = 2000) ))) gnomad_parse_frequency(body)$variant_idbody <- list(data = list(variant = list( variant_id = "7-140753336-A-T", exome = list(af = 0.001, ac = 2, an = 2000) ))) gnomad_parse_frequency(body)$variant_id
Pure. Sums the exome and genome sample sets per ancestry group.
gnomad_parse_populations(exome_pops, genome_pops)gnomad_parse_populations(exome_pops, genome_pops)
exome_pops, genome_pops
|
The |
Sex-split ids such as nfe_XX and the bare XX/XY breakdowns are dropped,
by keeping only the known ancestry codes, so the result is one row per
ancestry rather than a mix of ancestries and sexes.
A tibble of pop, label, ac, an, af, sorted by frequency
descending. NULL when there is nothing to report.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
gnomad_parse_populations( list(list(id = "nfe", ac = 3, an = 1000)), list(list(id = "nfe", ac = 1, an = 500)) )gnomad_parse_populations( list(list(id = "nfe", ac = 3, an = 1000)), list(list(id = "nfe", ac = 1, an = 500)) )
Pure. The flat, one-row form of a variant record, for a variant table that
wants a frequency per row. gnomad_parse_frequency() is the nested form
with the per-ancestry table.
gnomad_parse_variant(body, variant_id = NA_character_)gnomad_parse_variant(body, variant_id = NA_character_)
body |
A parsed gnomAD GraphQL response body. |
variant_id |
The id that was queried, carried through to the row. |
A one-row tibble of variant_id, rsid, exome_af, exome_ac,
exome_an, exome_nhomalt, genome_af, genome_ac, genome_an,
genome_nhomalt, grpmax_af, grpmax_an, grpmax_id, faf95,
faf95_pop, and filters. NULL when the body carries no variant,
which is how gnomAD answers for a variant it has never seen.
The API does not serve a group maximum. It is computed here from the
per-group counts, exome and genome summed, leaving out the bottlenecked
groups and the remaining bucket the same way gnomAD does. See
GNOMAD_GRPMAX_EXCLUDED.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
body <- list(data = list(variant = list( variant_id = "17-7676154-G-C", rsids = list("rs1042522"), exome = list(af = 0.72, ac = 1046941, an = 1461558, homozygote_count = 380188) ))) gnomad_parse_variant(body, "17-7676154-G-C")body <- list(data = list(variant = list( variant_id = "17-7676154-G-C", rsids = list("rs1042522"), exome = list(af = 0.72, ac = 1046941, an = 1461558, homozygote_count = 380188) ))) gnomad_parse_variant(body, "17-7676154-G-C")
Pure. The batched query uses aliases v1, v2, and so on, so rows are
mapped back by alias index rather than by the echoed id. A variant gnomAD
has not seen comes back as null under its alias, with a
"Variant not found" entry in errors, and becomes a row of NA.
gnomad_parse_variants(body, variant_ids)gnomad_parse_variants(body, variant_ids)
body |
A parsed gnomAD GraphQL response body. |
variant_ids |
The ids that were queried, in the order asked. |
A tibble with one row per entry in variant_ids, same order. See
gnomad_parse_variant() for the columns.
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
body <- list(data = list( v1 = list(variant_id = "17-7676154-G-C", exome = list(af = 0.72)), v2 = NULL )) gnomad_parse_variants(body, c("17-7676154-G-C", "17-7676154-G-GTTTTT"))body <- list(data = list( v1 = list(variant_id = "17-7676154-G-C", exome = list(af = 0.72)), v2 = NULL )) gnomad_parse_variants(body, c("17-7676154-G-C", "17-7676154-G-GTTTTT"))
Pure. gnomAD's variant query takes chrom-pos-ref-alt, with no chr
prefix and the alleles in upper case. Vectorised over its arguments.
gnomad_variant_id(chrom, pos, ref, alt)gnomad_variant_id(chrom, pos, ref, alt)
chrom |
A chromosome, with or without a |
pos |
A 1-based position. |
ref, alt
|
Reference and alternate alleles. |
A character vector of ids such as "1-55516888-G-GA".
Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0
Service documentation: https://gnomad.broadinstitute.org/
gnomad_variant_id("chr1", 55516888, "g", "ga")gnomad_variant_id("chr1", 55516888, "g", "ga")
Resolve a gene to GTEx's versioned GENCODE id
gtex_gene_reference(gene, ...)gtex_gene_reference(gene, ...)
gene |
A gene symbol or an Ensembl gene id. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
gtex_parse_reference().
GTEx expression queries need a versioned GENCODE id such as
ENSG00000141510.16. MyGene and most other sources return the unversioned
ENSG00000141510, and GTEx returns nothing for it. There is no way to derive
the version, so it has to be looked up here first.
This is the reason a GTEx expression lookup costs two requests.
The GTEx Consortium (2020). The GTEx Consortium atlas of genetic regulatory effects across human tissues. Science 369(6509), 1318-1330. doi:10.1126/science.aaz1776
Service documentation: https://gtexportal.org/home/
biohttp::body_or_null(gtex_gene_reference("TP53"))$gencode_idbiohttp::body_or_null(gtex_gene_reference("TP53"))$gencode_id
Two requests: one to resolve the versioned GENCODE id, one for the expression.
See gtex_gene_reference() for why the first is unavoidable.
gtex_median_expression( gene = NULL, gencode_id = NULL, dataset = GTEX_DATASET, ... )gtex_median_expression( gene = NULL, gencode_id = NULL, dataset = GTEX_DATASET, ... )
gene |
A gene symbol or an Ensembl gene id. Ignored when |
gencode_id |
A versioned GENCODE id, for example |
dataset |
The GTEx dataset. Must match the reference the id came from. |
... |
Passed to |
Pass gencode_id directly to skip the lookup when you already have a
versioned id.
A biohttp envelope whose data is the tibble described in
gtex_parse_expression().
The GTEx Consortium (2020). The GTEx Consortium atlas of genetic regulatory effects across human tissues. Science 369(6509), 1318-1330. doi:10.1126/science.aaz1776
Service documentation: https://gtexportal.org/home/
biohttp::body_or_null(gtex_median_expression("TP53"))biohttp::body_or_null(gtex_median_expression("TP53"))
Pure. Tissue ids arrive underscore-separated (Adipose_Subcutaneous) and are
returned both raw and as a readable label.
gtex_parse_expression(body)gtex_parse_expression(body)
body |
A parsed GTEx |
A tibble of tissue_id, tissue, median_tpm, and gencode_id.
Rows with no median are dropped. NULL when there is nothing usable.
The GTEx Consortium (2020). The GTEx Consortium atlas of genetic regulatory effects across human tissues. Science 369(6509), 1318-1330. doi:10.1126/science.aaz1776
Service documentation: https://gtexportal.org/home/
body <- list(data = list(list( median = 22.459, tissueSiteDetailId = "Adipose_Subcutaneous", gencodeId = "ENSG00000141510.16", unit = "TPM" ))) gtex_parse_expression(body)body <- list(data = list(list( median = 22.459, tissueSiteDetailId = "Adipose_Subcutaneous", gencodeId = "ENSG00000141510.16", unit = "TPM" ))) gtex_parse_expression(body)
Pure.
gtex_parse_reference(body)gtex_parse_reference(body)
body |
A parsed GTEx |
A tibble of symbol, gencode_id, entrez, chromosome, and
gene_type. NULL when the gene is not in the reference.
The GTEx Consortium (2020). The GTEx Consortium atlas of genetic regulatory effects across human tissues. Science 369(6509), 1318-1330. doi:10.1126/science.aaz1776
Service documentation: https://gtexportal.org/home/
body <- list(data = list(list( geneSymbol = "TP53", gencodeId = "ENSG00000141510.16", entrezGeneId = 7157 ))) gtex_parse_reference(body)body <- list(data = list(list( geneSymbol = "TP53", gencodeId = "ENSG00000141510.16", entrezGeneId = 7157 ))) gtex_parse_reference(body)
Keyed by Ensembl gene id, which is what HPA's per-gene JSON path takes.
Resolve a symbol first with mygene_gene().
hpa_gene(ensembl, ...)hpa_gene(ensembl, ...)
ensembl |
An Ensembl gene id, for example |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble. See
hpa_parse_gene().
Uhlén et al. (2015). Tissue-based map of the human proteome. Science 347(6220), 1260419. doi:10.1126/science.1260419
Service documentation: https://www.proteinatlas.org/
biohttp::body_or_null(hpa_gene("ENSG00000141510"))biohttp::body_or_null(hpa_gene("ENSG00000141510"))
Pure.
hpa_parse_gene(body, ensembl = NA_character_)hpa_parse_gene(body, ensembl = NA_character_)
body |
A parsed HPA gene record. |
ensembl |
The Ensembl gene id that was queried. |
protein_class and disease_involvement are list columns, because a gene
carries any number of tags and flattening them to one string would make them
unusable without re-splitting.
A one-row tibble of symbol, ensembl, uniprot, protein_class,
disease_involvement, and source_url. NULL when the record is empty.
Uhlén et al. (2015). Tissue-based map of the human proteome. Science 347(6220), 1260419. doi:10.1126/science.1260419
Service documentation: https://www.proteinatlas.org/
body <- list( Gene = "TP53", Ensembl = "ENSG00000141510", Uniprot = list("P04637"), `Protein class` = list("Cancer-related genes", "Transcription factors"), `Disease involvement` = list("Tumor suppressor") ) hpa_parse_gene(body, "ENSG00000141510")body <- list( Gene = "TP53", Ensembl = "ENSG00000141510", Uniprot = list("P04637"), `Protein class` = list("Cancer-related genes", "Transcription factors"), `Disease involvement` = list("Tumor suppressor") ) hpa_parse_gene(body, "ENSG00000141510")
HPO's annotation for a gene
hpo_gene_annotation(entrez, ...)hpo_gene_annotation(entrez, ...)
entrez |
An NCBI Gene id, for example |
... |
Passed to |
A biohttp envelope whose data is a list of two tibbles, diseases
and phenotypes, either of which may be NULL. Two tables rather than one,
because they are independent arrays in the response and joining them would
invent a disease-to-phenotype mapping the response does not carry. It also
carries source_url. See hpo_parse_diseases() and
hpo_parse_phenotypes().
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
biohttp::body_or_null(hpo_gene_annotation(7157))$diseasesbiohttp::body_or_null(hpo_gene_annotation(7157))$diseases
Pure.
hpo_parse_diseases(body)hpo_parse_diseases(body)
body |
A parsed HPO |
Every row is grounded by an OMIM, ORPHA, or DECIPHER id in id, and by a
MONDO id in mondo where HPO has one.
A tibble of id, name, mondo, and description, one row per
associated disease. NULL when there are none.
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
body <- list(diseases = list( list( id = "OMIM:151623", name = "Li-Fraumeni syndrome", mondoId = "MONDO:0018875", description = NULL ) )) hpo_parse_diseases(body)body <- list(diseases = list( list( id = "OMIM:151623", name = "Li-Fraumeni syndrome", mondoId = "MONDO:0018875", description = NULL ) )) hpo_parse_diseases(body)
Pure.
hpo_parse_phenotypes(body)hpo_parse_phenotypes(body)
body |
A parsed HPO |
These are the HPO terms observed in the diseases the gene is associated with, not a separate assertion about the gene.
A tibble of id and name, one row per phenotype term. NULL when
there are none.
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
body <- list(phenotypes = list(list(id = "HP:0003002", name = "Breast carcinoma"))) hpo_parse_phenotypes(body)body <- list(phenotypes = list(list(id = "HP:0003002", name = "Breast carcinoma"))) hpo_parse_phenotypes(body)
Pure.
hpo_parse_search(body)hpo_parse_search(body)
body |
A parsed HPO |
A tibble of id, name, definition, and descendant_count, best
match first, which is the order JAX returns. NULL when nothing matched.
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
body <- list(terms = list(list(id = "HP:0001250", name = "Seizure"))) hpo_parse_search(body)body <- list(terms = list(list(id = "HP:0001250", name = "Seizure"))) hpo_parse_search(body)
Pure.
hpo_parse_term(body)hpo_parse_term(body)
body |
A parsed HPO |
A one-row tibble of id, name, definition, comment,
descendant_count, and the list columns synonyms and xrefs. NULL
when the body carries no term.
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
body <- list(id = "HP:0001250", name = "Seizure", synonyms = list("Seizures")) hpo_parse_term(body)body <- list(id = "HP:0001250", name = "Seizure", synonyms = list("Seizures")) hpo_parse_term(body)
Search HPO terms by free text
hpo_search(query, limit = 10, ...)hpo_search(query, limit = 10, ...)
query |
Free text, for example |
limit |
Maximum terms to return. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
hpo_parse_search().
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
biohttp::body_or_null(hpo_search("seizure"))biohttp::body_or_null(hpo_search("seizure"))
Resolve one HP id to its term
hpo_term(id, ...)hpo_term(id, ...)
id |
An HP id, for example |
... |
Passed to |
A biohttp envelope whose data is the one-row tibble described in
hpo_parse_term().
Gargano et al. (2024). The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 52(D1), D1333-D1346. doi:10.1093/nar/gkad1005
Service documentation: https://hpo.jax.org/
biohttp::body_or_null(hpo_term("HP:0001250"))biohttp::body_or_null(hpo_term("HP:0001250"))
Resolves the mouse ortholog first, then queries the phenotype core by its MGI accession. See the note in the file header on why the second query cannot be made from the human symbol.
impc_gene_phenotypes(symbol, ...)impc_gene_phenotypes(symbol, ...)
symbol |
A human gene symbol, for example |
... |
Passed to |
A biohttp envelope whose data is a list of mgi, marker_symbol,
phenotypes (the tibble from impc_parse_phenotypes()), and source_url.
Groza et al. (2023). The International Mouse Phenotyping Consortium: comprehensive knockout phenotyping underpinning the study of human disease. Nucleic Acids Research 51(D1), D1038-D1045. doi:10.1093/nar/gkac972
Service documentation: https://www.mousephenotype.org/
biohttp::body_or_null(impc_gene_phenotypes("NF1"))$phenotypesbiohttp::body_or_null(impc_gene_phenotypes("NF1"))$phenotypes
The mouse ortholog IMPC holds for a human gene
impc_mouse_ortholog(symbol, ...)impc_mouse_ortholog(symbol, ...)
symbol |
A human gene symbol, for example |
... |
Passed to |
A biohttp envelope whose data is the one-row tibble described in
impc_parse_ortholog().
Groza et al. (2023). The International Mouse Phenotyping Consortium: comprehensive knockout phenotyping underpinning the study of human disease. Nucleic Acids Research 51(D1), D1038-D1045. doi:10.1093/nar/gkac972
Service documentation: https://www.mousephenotype.org/
biohttp::body_or_null(impc_mouse_ortholog("NF1"))biohttp::body_or_null(impc_mouse_ortholog("NF1"))
Pure.
impc_parse_ortholog(body)impc_parse_ortholog(body)
body |
A parsed IMPC |
A one-row tibble of mgi and marker_symbol. NULL when the gene
has no IMPC mouse ortholog, which includes a document carrying no usable
accession.
Groza et al. (2023). The International Mouse Phenotyping Consortium: comprehensive knockout phenotyping underpinning the study of human disease. Nucleic Acids Research 51(D1), D1038-D1045. doi:10.1093/nar/gkac972
Service documentation: https://www.mousephenotype.org/
body <- list(response = list(docs = list( list(mgi_accession_id = "MGI:97306", marker_symbol = "Nf1") ))) impc_parse_ortholog(body)body <- list(response = list(docs = list( list(mgi_accession_id = "MGI:97306", marker_symbol = "Nf1") ))) impc_parse_ortholog(body)
Pure.
impc_parse_phenotypes(body, mgi = NA_character_)impc_parse_phenotypes(body, mgi = NA_character_)
body |
A parsed IMPC |
mgi |
The MGI marker accession that was queried. |
A tibble of mp_id, mp_name, allele, allele_symbol,
zygosity, and source_url, one row per distinct phenotype term. NULL
when there are none.
IMPC reports a document per phenotype, sex, zygosity, and parameter
combination, so the same term recurs many times over. Rows are collapsed to
distinct mp_id, keeping the first occurrence. Counting the raw documents
would report a gene's phenotype breadth several times over.
mp_id is an MP term for most phenotypes and an MPATH term for pathology
findings. Both appear in the same field.
Groza et al. (2023). The International Mouse Phenotyping Consortium: comprehensive knockout phenotyping underpinning the study of human disease. Nucleic Acids Research 51(D1), D1038-D1045. doi:10.1093/nar/gkac972
Service documentation: https://www.mousephenotype.org/
body <- list(response = list(docs = list( list( mp_term_id = "MP:0011100", mp_term_name = "preweaning lethality, complete penetrance", allele_accession_id = "MGI:4364806", zygosity = "homozygote" ) ))) impc_parse_phenotypes(body, "MGI:97306")body <- list(response = list(docs = list( list( mp_term_id = "MP:0011100", mp_term_name = "preweaning lethality, complete penetrance", allele_accession_id = "MGI:4364806", zygosity = "homozygote" ) ))) impc_parse_phenotypes(body, "MGI:97306")
Associations with an entity on one end
monarch_associations(entity, end = c("subject", "object"), limit = 200, ...)monarch_associations(entity, end = c("subject", "object"), limit = 200, ...)
entity |
An entity CURIE, for example |
end |
|
limit |
Maximum associations to return. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
monarch_parse_associations().
end picks which end of the association the entity sits on. Both directions
are two calls, and concatenating them returns any association that has the
entity on both ends twice. Collapsing those, and deciding what to do with
the publications on each copy, is the caller's model rather than Monarch's
answer, so this function does neither.
Putman et al. (2024). The Monarch Initiative in 2024: an analytic platform integrating phenotypes, genes and diseases across species. Nucleic Acids Research 52(D1), D938-D949. doi:10.1093/nar/gkad1082
Service documentation: https://monarchinitiative.org/
biohttp::body_or_null(monarch_associations("MONDO:0007947"))biohttp::body_or_null(monarch_associations("MONDO:0007947"))
Keyed on the HGNC id, which mygene_gene() returns as hgnc. The rows come
back in the shape monarch_parse_associations() describes, so the phenotype
term is object and its label is object_label.
monarch_gene_phenotypes(hgnc, limit = 50, ...)monarch_gene_phenotypes(hgnc, limit = 50, ...)
hgnc |
An HGNC id, bare or prefixed. See |
limit |
Maximum associations to return. |
... |
Passed to |
A biohttp envelope whose data is a list of associations (the
tibble) and total.
Putman et al. (2024). The Monarch Initiative in 2024: an analytic platform integrating phenotypes, genes and diseases across species. Nucleic Acids Research 52(D1), D938-D949. doi:10.1093/nar/gkad1082
Service documentation: https://monarchinitiative.org/
biohttp::body_or_null(monarch_gene_phenotypes("11998"))$associationsbiohttp::body_or_null(monarch_gene_phenotypes("11998"))$associations
Monarch's entity route takes HGNC:11998. MyGene returns the bare digits.
Exported because a caller assembling its own entity id needs the same rule.
monarch_hgnc_id(hgnc)monarch_hgnc_id(hgnc)
hgnc |
An HGNC id, bare ( |
A single string, or NULL when there is nothing usable.
Putman et al. (2024). The Monarch Initiative in 2024: an analytic platform integrating phenotypes, genes and diseases across species. Nucleic Acids Research 52(D1), D938-D949. doi:10.1093/nar/gkad1082
Service documentation: https://monarchinitiative.org/
monarch_hgnc_id("11998") monarch_hgnc_id("hgnc:11998")monarch_hgnc_id("11998") monarch_hgnc_id("hgnc:11998")
Pure.
monarch_parse_associations(body)monarch_parse_associations(body)
body |
A parsed Monarch association response, or the |
One row per association, exactly as Monarch sent it. Nothing is dropped and
nothing is merged. publications is a list column because an association
carries any number of them, and null and an array both occur.
A tibble of subject, subject_label, subject_category,
predicate, object, object_label, object_category,
primary_knowledge_source, knowledge_level, and publications. NULL
when there are no associations.
Putman et al. (2024). The Monarch Initiative in 2024: an analytic platform integrating phenotypes, genes and diseases across species. Nucleic Acids Research 52(D1), D938-D949. doi:10.1093/nar/gkad1082
Service documentation: https://monarchinitiative.org/
body <- list(items = list(list( subject = "MONDO:0017309", subject_label = "neonatal Marfan syndrome", predicate = "biolink:has_phenotype", object = "HP:0001653", object_label = "Mitral regurgitation", publications = NULL ))) monarch_parse_associations(body)body <- list(items = list(list( subject = "MONDO:0017309", subject_label = "neonatal Marfan syndrome", predicate = "biolink:has_phenotype", object = "HP:0001653", object_label = "Mitral regurgitation", publications = NULL ))) monarch_parse_associations(body)
Pure.
monarch_parse_search(body)monarch_parse_search(body)
body |
A parsed Monarch |
A tibble of id, name, category, description, taxon, and
source_url, one row per match. NULL when there are none.
A gene symbol is not unique across species in Monarch, and a search returns
the orthologs alongside the human gene under the same name. taxon is the
only column that tells them apart. It is NA for a disease or a phenotype,
which are not species-scoped.
Putman et al. (2024). The Monarch Initiative in 2024: an analytic platform integrating phenotypes, genes and diseases across species. Nucleic Acids Research 52(D1), D938-D949. doi:10.1093/nar/gkad1082
Service documentation: https://monarchinitiative.org/
body <- list(items = list(list( id = "HGNC:3603", name = "FBN1", category = "biolink:Gene", full_name = "fibrillin 1", in_taxon_label = "Homo sapiens" ))) monarch_parse_search(body)body <- list(items = list(list( id = "HGNC:3603", name = "FBN1", category = "biolink:Gene", full_name = "fibrillin 1", in_taxon_label = "Homo sapiens" ))) monarch_parse_search(body)
Turns typed text into the entity id the other calls need.
monarch_search(text, limit = 10, ...)monarch_search(text, limit = 10, ...)
text |
Free text, for example a gene symbol or a disease name. |
limit |
Maximum matches to return. |
... |
Passed to |
A biohttp envelope whose data is a list of matches (the tibble
from monarch_parse_search()) and total. total is Monarch's own count,
not the page size, so a caller can say how much was left behind rather than
presenting the first few as everything.
Putman et al. (2024). The Monarch Initiative in 2024: an analytic platform integrating phenotypes, genes and diseases across species. Nucleic Acids Research 52(D1), D938-D949. doi:10.1093/nar/gkad1082
Service documentation: https://monarchinitiative.org/
biohttp::body_or_null(monarch_search("Marfan syndrome"))$matchesbiohttp::body_or_null(monarch_search("Marfan syndrome"))$matches
Look up one gene
mygene_gene(symbol, species = "human", ...)mygene_gene(symbol, species = "human", ...)
symbol |
A gene symbol, Ensembl gene id, or Entrez id. |
species |
Passed through to MyGene. |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble. See
mygene_parse_hits() for the columns.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://mygene.info/
res <- mygene_gene("TP53") biohttp::body_or_null(res)res <- mygene_gene("TP53") biohttp::body_or_null(res)
The batch POST, which is the reason this client is worth installing. An N-symbol list is one round trip rather than N, and the round trip is where essentially all the time goes.
mygene_genes(symbols, species = "human", chunk_size = MYGENE_BATCH, ...)mygene_genes(symbols, species = "human", chunk_size = MYGENE_BATCH, ...)
symbols |
Gene symbols, Ensembl gene ids, or Entrez ids. |
species |
Passed through to MyGene. |
chunk_size |
Identifiers per request, at most |
... |
Passed to |
MyGene takes at most 1000 identifiers per POST, see MYGENE_BATCH. A
longer list is chunked, the chunks are dispatched through
biohttp::post_json_many(), and the hits are merged back onto symbols
in input order. A chunk that failed yields a row of NA per identifier
rather than taking the whole call down, following gnomad_constraints();
only when every chunk failed is the failing envelope returned.
A biohttp envelope whose data is a tibble with one row per entry in
symbols, in the same order.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://mygene.info/
res <- mygene_genes(c("TP53", "BRCA1", "EGFR")) biohttp::body_or_null(res)res <- mygene_genes(c("TP53", "BRCA1", "EGFR")) biohttp::body_or_null(res)
Pure. The batch /query POST returns a flat array where each element echoes
its input query. An ambiguous query yields several elements, best _score
first, and an unmatched one yields an element with notfound = true.
mygene_parse_batch(body, symbols)mygene_parse_batch(body, symbols)
body |
A parsed MyGene batch response, a flat list of hit records. |
symbols |
The identifiers that were queried, in the order asked. |
Hits are grouped by the echoed query and resolved through mygene_pick_hit(),
then mapped back onto symbols in input order, so a caller zips the
result onto its input by position. An unmatched or invalid token yields a row
of NA rather than being dropped, because a shorter table would silently
shift every row after it.
A tibble with one row per entry in symbols, same order, with the
columns of mygene_parse_hits(). The note there on ensembl_gene and
genomic_pos applies here too.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://mygene.info/
body <- list( list(query = "TP53", symbol = "TP53", entrezgene = "7157"), list(query = "NOPE", notfound = TRUE) ) mygene_parse_batch(body, c("TP53", "NOPE"))body <- list( list(query = "TP53", symbol = "TP53", entrezgene = "7157"), list(query = "NOPE", notfound = TRUE) ) mygene_parse_batch(body, c("TP53", "NOPE"))
Pure. Takes an already-parsed response body and never touches the network, so it is tested directly against a stored response.
mygene_parse_hits(body, symbol = NA_character_)mygene_parse_hits(body, symbol = NA_character_)
body |
A parsed MyGene |
symbol |
The identifier that was queried, used to break the scoring tie
described in |
A one-row tibble with symbol, name, summary, entrez,
ensembl_gene, uniprot, hgnc, and type_of_gene. NULL when the body
carries no usable hit. When a gene has several Ensembl ids, ensembl_gene
is the one on a reference chromosome (1 to 22, X, Y or MT), and NA when
none of them is. Picking it needs genomic_pos in the body, which
mygene_gene() and mygene_genes() ask for. A body fetched without it
gives NA for any gene with several ids.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://mygene.info/
body <- list(hits = list(list( symbol = "TP53", name = "tumor protein p53", entrezgene = "7157" ))) mygene_parse_hits(body, "TP53")body <- list(hits = list(list( symbol = "TP53", name = "tumor protein p53", entrezgene = "7157" ))) mygene_parse_hits(body, "TP53")
MyGene's _score can rank a fuzzy alias or retired match to a different
gene above the exact symbol match. Querying "TTN" with the alias and retired
scopes returns TTR (entrez 7276, score 19.07) ahead of TTN (7273, score
18.29). Taking the top-scored hit therefore returns the wrong gene, quietly.
mygene_pick_hit(hits, token)mygene_pick_hit(hits, token)
hits |
A list of hit records from a MyGene response. |
token |
The identifier that was queried. |
So a hit whose official symbol equals the token wins, case-insensitively.
Only when none does, which is the case for a deliberate alias such as
"p53", does MyGene's own best-scored hit get used.
This is the single most important thing in this file. It is exported so a caller assembling its own hits can apply the same rule.
One hit record, or NULL when hits is empty.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://mygene.info/
hits <- list( list(symbol = "TTR", entrezgene = "7276"), list(symbol = "TTN", entrezgene = "7273") ) mygene_pick_hit(hits, "TTN")$entrezgenehits <- list( list(symbol = "TTR", entrezgene = "7276"), list(symbol = "TTN", entrezgene = "7273") ) mygene_pick_hit(hits, "TTN")$entrezgene
Pure. MyVariant indexes variants by an HGVS g. string, so a caller holding
chromosome, position, ref and alt needs this to ask about one.
myvariant_id(chrom, pos, ref, alt)myvariant_id(chrom, pos, ref, alt)
chrom |
A chromosome, with or without a |
pos |
A 1-based position. |
ref, alt
|
Reference and alternate alleles. |
A single string.
This formats a variant the way one service wants it written. It is not a
canonical variant key and it does not normalize anything. The canonical key
is (assembly, chromosome, position, ref, alt), and turning arbitrary input
into one is vcfcanon's job, not this package's.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://myvariant.info/
myvariant_id("17", 7676154, "G", "C") myvariant_id("chr1", 100, "AT", "A")myvariant_id("17", 7676154, "G", "C") myvariant_id("chr1", 100, "AT", "A")
Pure. One row per requested id, in the order asked.
myvariant_parse_batch(body, ids)myvariant_parse_batch(body, ids)
body |
A parsed MyVariant batch response, a flat array. |
ids |
The MyVariant ids that were requested, in order. |
A tibble with one row per entry in ids, plus an id column.
MyVariant reports an unknown variant as HTTP 200 with notfound: true. That
is the source saying it has nothing, which is different from the call
failing. Such rows come back as NA rather than being dropped, so a caller
zipping by position stays aligned.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://myvariant.info/
body <- list(list(query = "chr17:g.7676154G>C", dbnsfp = list( genename = list("TP53"), cadd = list(raw_rankscore = 0.17) ))) myvariant_parse_batch(body, "chr17:g.7676154G>C")body <- list(list(query = "chr17:g.7676154G>C", dbnsfp = list( genename = list("TP53"), cadd = list(raw_rankscore = 0.17) ))) myvariant_parse_batch(body, "chr17:g.7676154G>C")
Pure.
myvariant_parse_record(record)myvariant_parse_record(record)
record |
A parsed MyVariant record. |
A one-row tibble of gene, revel, cadd, clinpred,
alphamissense, and clinvar_sig.
Every other dbNSFP predictor exposes <name>.rankscore. CADD does not: it is
cadd.raw_rankscore, and there is no plain cadd.rankscore. Following the
pattern gives NA for CADD on every variant with nothing to indicate it.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://myvariant.info/
record <- list(dbnsfp = list( genename = list("TP53"), cadd = list(raw_rankscore = 0.17018), revel = list(rankscore = 0.4) )) myvariant_parse_record(record)record <- list(dbnsfp = list( genename = list("TP53"), cadd = list(raw_rankscore = 0.17018), revel = list(rankscore = 0.4) )) myvariant_parse_record(record)
Annotate many variants in one request
myvariant_variants(ids, assembly = "hg38", fields = MYVARIANT_FIELDS, ...)myvariant_variants(ids, assembly = "hg38", fields = MYVARIANT_FIELDS, ...)
ids |
MyVariant ids. Build them with |
assembly |
The genome assembly. Changing this from |
fields |
The MyVariant fields to request. |
... |
Passed to |
A biohttp envelope whose data is a tibble with one row per entry in
ids, in the same order. See myvariant_parse_batch().
assembly = "hg38" is always sent. Without it MyVariant answers 200 with
notfound for every GRCh38 variant, so a whole cohort disappears with no
error anywhere. There is no way to omit it through this function, and that is
deliberate.
Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9
Service documentation: https://myvariant.info/
ids <- myvariant_id("17", 7676154, "G", "C") biohttp::body_or_null(myvariant_variants(ids))ids <- myvariant_id("17", 7676154, "G", "C") biohttp::body_or_null(myvariant_variants(ids))
The discovery direction. disease_id is an Open Targets id in either
separator form; MONDO:0018975 and MONDO_0018975 both work.
opentargets_disease_targets(disease_id, size = 1000, ...)opentargets_disease_targets(disease_id, size = 1000, ...)
disease_id |
An EFO, MONDO, HP, or Orphanet id. |
size |
How many associations to ask for. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
opentargets_parse_targets().
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
biohttp::body_or_null(opentargets_disease_targets("MONDO_0018975"))biohttp::body_or_null(opentargets_disease_targets("MONDO_0018975"))
Takes an Ensembl gene id, the same as opentargets_gene_diseases().
opentargets_drugs(ensembl_id, ...)opentargets_drugs(ensembl_id, ...)
ensembl_id |
An Ensembl gene id, for example |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
opentargets_parse_drugs().
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
biohttp::body_or_null(opentargets_drugs("ENSG00000157764"))biohttp::body_or_null(opentargets_drugs("ENSG00000157764"))
Takes an Ensembl gene id, not a symbol, because that is what the Open
Targets target query accepts. Resolve a symbol first with mygene_gene()
and read its ensembl_gene column.
opentargets_gene_diseases(ensembl_id, size = 20, ...)opentargets_gene_diseases(ensembl_id, size = 20, ...)
ensembl_id |
An Ensembl gene id, for example |
size |
How many associations to ask for. |
... |
Passed to |
Keeping the resolution out of this function is deliberate. A client that silently made a second call to a different service would make one failure look like the other's, and a MyGene outage would read as an Open Targets outage.
A biohttp envelope whose data is the tibble described in
opentargets_parse_diseases().
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
biohttp::body_or_null(opentargets_gene_diseases("ENSG00000141510"))biohttp::body_or_null(opentargets_gene_diseases("ENSG00000141510"))
Open Targets takes an exact id for a direct lookup and free text for a search, and the two are different queries. This is what tells them apart.
opentargets_is_id(term)opentargets_is_id(term)
term |
A disease term. |
A single logical.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
opentargets_is_id("MONDO:0018975") opentargets_is_id("neurofibromatosis type 1")opentargets_is_id("MONDO:0018975") opentargets_is_id("neurofibromatosis type 1")
Pure. Rows arrive already sorted by score, best first, and that order is kept.
opentargets_parse_diseases(body, ensembl_id = NA_character_)opentargets_parse_diseases(body, ensembl_id = NA_character_)
body |
A parsed Open Targets GraphQL response body. |
ensembl_id |
The Ensembl gene id that was queried, used to build
|
A tibble of disease, disease_id, score, and source_url, or
NULL when the target is absent or has no associations.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
body <- list(data = list(target = list( approvedSymbol = "TP53", associatedDiseases = list(count = 1, rows = list( list(score = 0.88, disease = list(id = "MONDO_0018875", name = "LFS")) )) ))) opentargets_parse_diseases(body, "ENSG00000141510")body <- list(data = list(target = list( approvedSymbol = "TP53", associatedDiseases = list(count = 1, rows = list( list(score = 0.88, disease = list(id = "MONDO_0018875", name = "LFS")) )) ))) opentargets_parse_diseases(body, "ENSG00000141510")
Pure.
opentargets_parse_drugs(body)opentargets_parse_drugs(body)
body |
A parsed Open Targets GraphQL response body. |
A tibble of drug, drug_id, drug_type, max_phase, diseases,
disease_ids, and source_url. NULL when the target has no known drugs.
A drug row carries the whole list of diseases it has been tried against, and
the first entry is often the least useful one. In the stored BRAF response,
BELVARAFENIB lists five, and the first has no mapped disease at all. So the
diseases arrive as list columns rather than as one picked value.
diseases prefers the mapped disease name and falls back to
diseaseFromSource, which is the label the trial registry used. disease_ids
is NA in the positions Open Targets could not map.
max_phase is the raw maxClinicalStage, for example "PHASE_2". Turning
that into "Phase 2" is presentation and belongs to whatever is presenting it.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
body <- list(data = list(target = list( drugAndClinicalCandidates = list(count = 1, rows = list( list( maxClinicalStage = "PHASE_2", drug = list(id = "CHEMBL1", name = "DRUGX", drugType = "Small molecule"), diseases = list(list( diseaseFromSource = "melanoma", disease = list(id = "MONDO_0005105", name = "melanoma") )) ) )) ))) opentargets_parse_drugs(body)body <- list(data = list(target = list( drugAndClinicalCandidates = list(count = 1, rows = list( list( maxClinicalStage = "PHASE_2", drug = list(id = "CHEMBL1", name = "DRUGX", drugType = "Small molecule"), diseases = list(list( diseaseFromSource = "melanoma", disease = list(id = "MONDO_0005105", name = "melanoma") )) ) )) ))) opentargets_parse_drugs(body)
Pure, and it reads both response shapes on purpose: the search query
returns a hits array, the direct disease lookup returns a single record.
A caller resolving a term does not know in advance which query ran, so one
parser reads either and the difference stops mattering downstream.
opentargets_parse_matches(body)opentargets_parse_matches(body)
body |
A parsed Open Targets GraphQL response body. |
A tibble of id, name, score, description, and source_url,
best match first, or NULL when nothing matched. score is NA for a
direct lookup, which has no relevance score to report.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
hits <- list(data = list(search = list(hits = list( list(id = "MONDO_0018975", name = "neurofibromatosis type 1", score = 24.9) )))) opentargets_parse_matches(hits) single <- list(data = list(disease = list(id = "EFO_0000508", name = "neurofibroma"))) opentargets_parse_matches(single)hits <- list(data = list(search = list(hits = list( list(id = "MONDO_0018975", name = "neurofibromatosis type 1", score = 24.9) )))) opentargets_parse_matches(hits) single <- list(data = list(disease = list(id = "EFO_0000508", name = "neurofibroma"))) opentargets_parse_matches(single)
Pure.
opentargets_parse_pgx(body)opentargets_parse_pgx(body)
body |
A parsed Open Targets GraphQL response body. |
drugs is a list column because one annotation can name several. rsid is
NA where the annotation is keyed on a genotype rather than a variant, which
is common.
A tibble of rsid, genotype_id, drugs, phenotype,
annotation, and evidence_level. NULL when the target has none, which
is the normal case for most genes.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
body <- list(data = list(target = list(pharmacogenomics = list( list( variantRsId = "rs4244285", drugs = list(list(drugFromSource = "venlafaxine")), phenotypeText = "decreased metabolism of venlafaxine", evidenceLevel = "3" ) )))) opentargets_parse_pgx(body)body <- list(data = list(target = list(pharmacogenomics = list( list( variantRsId = "rs4244285", drugs = list(list(drugFromSource = "venlafaxine")), phenotypeText = "decreased metabolism of venlafaxine", evidenceLevel = "3" ) )))) opentargets_parse_pgx(body)
Pure. The discovery direction: the genes Open Targets associates with a disease, each with its overall association score.
opentargets_parse_targets(body, disease_id = NA_character_)opentargets_parse_targets(body, disease_id = NA_character_)
body |
A parsed Open Targets GraphQL response body. |
disease_id |
The disease id that was queried, used to build |
A tibble of symbol, ensembl_id, score, and source_url, or
NULL when the disease is absent or has no associations.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
body <- list(data = list(disease = list( name = "NF1", associatedTargets = list(count = 1, rows = list( list(score = 0.9, target = list(id = "ENSG00000196712", approvedSymbol = "NF1")) )) ))) opentargets_parse_targets(body, "MONDO_0018975")body <- list(data = list(disease = list( name = "NF1", associatedTargets = list(count = 1, rows = list( list(score = 0.9, target = list(id = "ENSG00000196712", approvedSymbol = "NF1")) )) ))) opentargets_parse_targets(body, "MONDO_0018975")
Takes an Ensembl gene id, the same as opentargets_gene_diseases().
opentargets_pgx(ensembl_id, ...)opentargets_pgx(ensembl_id, ...)
ensembl_id |
An Ensembl gene id, for example |
... |
Passed to |
Most genes have none, so no_data here is the ordinary answer rather than a
sign anything went wrong.
A biohttp envelope whose data is the tibble described in
opentargets_parse_pgx().
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
biohttp::body_or_null(opentargets_pgx("ENSG00000165841"))biohttp::body_or_null(opentargets_pgx("ENSG00000165841"))
Free text is searched; something that already looks like an ontology id is
looked up directly, which is both exact and cheaper. opentargets_is_id() is
what decides.
opentargets_resolve_disease(term, limit = 5, ...)opentargets_resolve_disease(term, limit = 5, ...)
term |
Free text, or an EFO/MONDO/HP/Orphanet id. |
limit |
How many candidates to return for a free-text search. |
... |
Passed to |
This is the resolve_disease that exists twice in the family, once in
genescout/R/tools/disease_resolver.R and once in a sibling app.
A biohttp envelope whose data is the tibble described in
opentargets_parse_matches(), best match first.
Buniello et al. (2025). Open Targets Platform: facilitating therapeutic hypotheses building in drug discovery. Nucleic Acids Research 53(D1), D1467-D1475. doi:10.1093/nar/gkae1128
Service documentation: https://platform.opentargets.org/
biohttp::body_or_null(opentargets_resolve_disease("neurofibromatosis type 1")) biohttp::body_or_null(opentargets_resolve_disease("MONDO:0018975"))biohttp::body_or_null(opentargets_resolve_disease("neurofibromatosis type 1")) biohttp::body_or_null(opentargets_resolve_disease("MONDO:0018975"))
Walks the paginated index and stacks the pages. Stops at max_pages, which
is a guard against an unbounded walk rather than a tuned number.
panelapp_all_panels(max_pages = 6, page_size = 100, ...)panelapp_all_panels(max_pages = 6, page_size = 100, ...)
max_pages |
Maximum pages to fetch. |
page_size |
Panels per page. |
... |
Passed to |
A biohttp envelope whose data is the tibble from
panelapp_parse_index(), stacked across pages. A page that fails after the
first is where the walk stops, keeping what was already collected; a
failure on the first page is returned as-is.
Martin et al. (2019). PanelApp crowdsources expert knowledge to establish consensus diagnostic gene panels. Nature Genetics 51(11), 1560-1565. doi:10.1038/s41588-019-0528-2
Service documentation: https://panelapp.genomicsengland.co.uk/
biohttp::body_or_null(panelapp_all_panels(max_pages = 2))biohttp::body_or_null(panelapp_all_panels(max_pages = 2))
The genes on one PanelApp panel
panelapp_panel(panel_id, ...)panelapp_panel(panel_id, ...)
panel_id |
A PanelApp panel id, for example |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
panelapp_parse_panel().
Martin et al. (2019). PanelApp crowdsources expert knowledge to establish consensus diagnostic gene panels. Nature Genetics 51(11), 1560-1565. doi:10.1038/s41588-019-0528-2
Service documentation: https://panelapp.genomicsengland.co.uk/
biohttp::body_or_null(panelapp_panel(255))biohttp::body_or_null(panelapp_panel(255))
One page of the PanelApp panel index
panelapp_panels(page = 1, page_size = 100, ...)panelapp_panels(page = 1, page_size = 100, ...)
page |
The 1-based page number. |
page_size |
Panels per page. |
... |
Passed to |
A biohttp envelope whose data is a list of panels (the tibble
from panelapp_parse_index()) and has_more, which is TRUE when
PanelApp sent a next link.
Martin et al. (2019). PanelApp crowdsources expert knowledge to establish consensus diagnostic gene panels. Nature Genetics 51(11), 1560-1565. doi:10.1038/s41588-019-0528-2
Service documentation: https://panelapp.genomicsengland.co.uk/
biohttp::body_or_null(panelapp_panels())$panelsbiohttp::body_or_null(panelapp_panels())$panels
Pure.
panelapp_parse_index(body)panelapp_parse_index(body)
body |
A parsed PanelApp |
A tibble of id, name, version, disorders (a list column, as a
panel carries any number), and source_url, one row per panel. NULL when
the page is empty.
Martin et al. (2019). PanelApp crowdsources expert knowledge to establish consensus diagnostic gene panels. Nature Genetics 51(11), 1560-1565. doi:10.1038/s41588-019-0528-2
Service documentation: https://panelapp.genomicsengland.co.uk/
body <- list(results = list( list(id = 255, name = "Neurofibromatosis Type 1", relevant_disorders = list("NF1")) )) panelapp_parse_index(body)body <- list(results = list( list(id = 255, name = "Neurofibromatosis Type 1", relevant_disorders = list("NF1")) )) panelapp_parse_index(body)
Pure.
panelapp_parse_panel(body)panelapp_parse_panel(body)
body |
A parsed PanelApp panel detail response. |
Every gene on the panel is returned, red included. See the note in the file header on why the confidence level is not converted to a weight here.
A tibble of symbol, confidence (the raw level PanelApp sent),
level ("green", "amber", "red", or NA for anything else),
hgnc_id, and source_url. NULL when the panel has no genes.
Martin et al. (2019). PanelApp crowdsources expert knowledge to establish consensus diagnostic gene panels. Nature Genetics 51(11), 1560-1565. doi:10.1038/s41588-019-0528-2
Service documentation: https://panelapp.genomicsengland.co.uk/
body <- list(id = 255, genes = list( list( entity_name = "NF1", gene_data = list(gene_symbol = "NF1", hgnc_id = "HGNC:7765"), confidence_level = "3" ) )) panelapp_parse_panel(body)body <- list(id = 255, genes = list( list( entity_name = "NF1", gene_data = list(gene_symbol = "NF1", hgnc_id = "HGNC:7765"), confidence_level = "3" ) )) panelapp_parse_panel(body)
Pure.
pdbe_parse_structures(body, accession = NA_character_)pdbe_parse_structures(body, accession = NA_character_)
body |
A parsed PDBe |
accession |
The UniProt accession that was queried. |
A tibble of pdb_id, method, resolution, coverage, and
source_url, one row per distinct structure. NULL when there are none.
The response is keyed by the accession, and each value is a list of per chain mappings. A single PDB entry therefore recurs once for every chain it resolved, so 3 structures across 12 chains arrive as 12 records. Counting them raw overstates structural coverage several-fold.
Rows are collapsed to distinct pdb_id, keeping the first occurrence, which
is PDBe's own best (highest coverage) chain for that entry.
Armstrong et al. (2020). PDBe: improved findability of macromolecular structure data in the PDB. Nucleic Acids Research 48(D1), D335-D343. doi:10.1093/nar/gkz990
Service documentation: https://www.ebi.ac.uk/pdbe/
body <- list(P21359 = list( list(pdb_id = "7pgp", chain_id = "F", experimental_method = "Electron Microscopy", resolution = 3.1, coverage = 1), list(pdb_id = "7pgp", chain_id = "N", experimental_method = "Electron Microscopy", resolution = 3.1, coverage = 1) )) pdbe_parse_structures(body, "P21359")body <- list(P21359 = list( list(pdb_id = "7pgp", chain_id = "F", experimental_method = "Electron Microscopy", resolution = 3.1, coverage = 1), list(pdb_id = "7pgp", chain_id = "N", experimental_method = "Electron Microscopy", resolution = 3.1, coverage = 1) )) pdbe_parse_structures(body, "P21359")
Experimental structures for a UniProt accession
pdbe_structures(accession, ...)pdbe_structures(accession, ...)
accession |
A UniProt accession, for example |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
pdbe_parse_structures().
Armstrong et al. (2020). PDBe: improved findability of macromolecular structure data in the PDB. Nucleic Acids Research 48(D1), D335-D343. doi:10.1093/nar/gkz990
Service documentation: https://www.ebi.ac.uk/pdbe/
biohttp::body_or_null(pdbe_structures("P21359"))biohttp::body_or_null(pdbe_structures("P21359"))
Pure. Rows come back in symbols order, one per input.
pharos_parse_targets(body, symbols)pharos_parse_targets(body, symbols)
body |
A parsed Pharos GraphQL response body. |
symbols |
The gene symbols that were queried, in the order asked. |
A TDL Pharos does not recognise is reported as NA rather than passed
through, so a caller never has to guess whether an unexpected string is a new
level or a typo.
A tibble of symbol, tdl, and source_url, one row per entry in
symbols. tdl is one of Tclin, Tchem, Tbio, Tdark, or NA.
Kelleher et al. (2023). Pharos 2023: an integrated resource for the understudied human proteome. Nucleic Acids Research 51(D1), D1405-D1416. doi:10.1093/nar/gkac1033
Service documentation: https://pharos.nih.gov/
body <- list(data = list(targets = list(targets = list( list(sym = "NF1", tdl = "Tbio") )))) pharos_parse_targets(body, "NF1")body <- list(data = list(targets = list(targets = list( list(sym = "NF1", tdl = "Tbio") )))) pharos_parse_targets(body, "NF1")
A thin wrapper over pharos_targets().
pharos_target(symbol, ...)pharos_target(symbol, ...)
symbol |
A gene symbol. |
... |
Passed to |
A biohttp envelope whose data is a one-row tibble.
Kelleher et al. (2023). Pharos 2023: an integrated resource for the understudied human proteome. Nucleic Acids Research 51(D1), D1405-D1416. doi:10.1093/nar/gkac1033
Service documentation: https://pharos.nih.gov/
biohttp::body_or_null(pharos_target("NF1"))biohttp::body_or_null(pharos_target("NF1"))
One request for the whole list, because Pharos's targets query already takes
an array.
pharos_targets(symbols, ...)pharos_targets(symbols, ...)
symbols |
Gene symbols. |
... |
Passed to |
A biohttp envelope whose data is a tibble with one row per entry in
symbols, in the same order. See pharos_parse_targets().
Kelleher et al. (2023). Pharos 2023: an integrated resource for the understudied human proteome. Nucleic Acids Research 51(D1), D1405-D1416. doi:10.1093/nar/gkac1033
Service documentation: https://pharos.nih.gov/
biohttp::body_or_null(pharos_targets(c("NF1", "EGFR")))biohttp::body_or_null(pharos_targets(c("NF1", "EGFR")))
Functional context for a residue
protvar_function(accession, position, ...)protvar_function(accession, position, ...)
accession |
A UniProt accession, for example |
position |
A protein position. Use |
... |
Passed to |
A biohttp envelope whose data is a single string. See
protvar_parse_function().
Stephenson et al. (2024). ProtVar: mapping and contextualizing human missense variation. Nucleic Acids Research 52(W1), W140-W147. doi:10.1093/nar/gkae413
Service documentation: https://www.ebi.ac.uk/ProtVar/
biohttp::body_or_null(protvar_function("P04637", 175))biohttp::body_or_null(protvar_function("P04637", 175))
Pure. Returns the first FUNCTION comment, with citations stripped.
protvar_parse_function(body)protvar_parse_function(body)
body |
A parsed ProtVar |
A single string, or NA_character_ when there is no function comment.
Stephenson et al. (2024). ProtVar: mapping and contextualizing human missense variation. Nucleic Acids Research 52(W1), W140-W147. doi:10.1093/nar/gkae413
Service documentation: https://www.ebi.ac.uk/ProtVar/
body <- list(comments = list(list( type = "FUNCTION", text = list(list(value = "Induces arrest (PubMed:11025664).")) ))) protvar_parse_function(body)body <- list(comments = list(list( type = "FUNCTION", text = list(list(value = "Induces arrest (PubMed:11025664).")) ))) protvar_parse_function(body)
Pure. Known variants at the residue.
protvar_parse_population(body)protvar_parse_population(body)
body |
A parsed ProtVar |
A tibble of change and sources, where sources is a
comma-separated list of distinct source names. NULL when there are no
variants.
A variant carries one cross-reference per supporting record, so the same
source name recurs many times: the TP53 175 fixture lists NCI-TCGA four
times for a single change. Reporting them raw makes a single database look
like corroboration from several.
Stephenson et al. (2024). ProtVar: mapping and contextualizing human missense variation. Nucleic Acids Research 52(W1), W140-W147. doi:10.1093/nar/gkae413
Service documentation: https://www.ebi.ac.uk/ProtVar/
body <- list(variants = list(list( alternativeSequence = "Cys", xrefs = list(list(name = "NCI-TCGA"), list(name = "NCI-TCGA")) ))) protvar_parse_population(body)body <- list(variants = list(list( alternativeSequence = "Cys", xrefs = list(list(name = "NCI-TCGA"), list(name = "NCI-TCGA")) ))) protvar_parse_population(body)
Known variants at a residue
protvar_population(accession, position, ...)protvar_population(accession, position, ...)
accession |
A UniProt accession, for example |
position |
A protein position. Use |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
protvar_parse_population().
Stephenson et al. (2024). ProtVar: mapping and contextualizing human missense variation. Nucleic Acids Research 52(W1), W140-W147. doi:10.1093/nar/gkae413
Service documentation: https://www.ebi.ac.uk/ProtVar/
biohttp::body_or_null(protvar_population("P04637", 175))biohttp::body_or_null(protvar_population("P04637", 175))
Pure. Accepts the several forms these arrive in: "R175H", "p.Arg175His",
"Arg175His", or a bare "175".
protvar_position(variant)protvar_position(variant)
variant |
A protein-change string. |
An integer position, or NULL when there is no number in it.
Stephenson et al. (2024). ProtVar: mapping and contextualizing human missense variation. Nucleic Acids Research 52(W1), W140-W147. doi:10.1093/nar/gkae413
Service documentation: https://www.ebi.ac.uk/ProtVar/
protvar_position("p.Arg175His") protvar_position("R175H") protvar_position("no digits here")protvar_position("p.Arg175His") protvar_position("R175H") protvar_position("no digits here")
Pure.
protvar_strip_citations(text)protvar_strip_citations(text)
text |
A function comment. |
UniProt FUNCTION comments carry their evidence inline, as
(PubMed:11025664, PubMed:12524540, ...). For a well-studied protein the
citations run longer than the prose they support. This drops the citation
groups and tidies the punctuation left behind, while keeping non-citation
parentheticals such as (By similarity).
The text with citation groups removed.
Stephenson et al. (2024). ProtVar: mapping and contextualizing human missense variation. Nucleic Acids Research 52(W1), W140-W147. doi:10.1093/nar/gkae413
Service documentation: https://www.ebi.ac.uk/ProtVar/
protvar_strip_citations("Induces arrest (PubMed:11025664, PubMed:12524540).") protvar_strip_citations("Binds DNA (By similarity).")protvar_strip_citations("Induces arrest (PubMed:11025664, PubMed:12524540).") protvar_strip_citations("Binds DNA (By similarity).")
Prefers the Entrez id, which names the gene exactly, and falls back to the
symbol. Exported because the token is what appears in source_id, so a
caller reconstructing a citation needs the same rule.
pubtator_entity(symbol = NULL, entrez = NULL)pubtator_entity(symbol = NULL, entrez = NULL)
symbol |
A gene symbol. |
entrez |
An NCBI Gene id. Used in preference to |
A single string such as "@GENE_7157", or NULL when neither
argument is usable.
Wei et al. (2024). PubTator 3.0: an AI-powered literature resource for unlocking biomedical knowledge. Nucleic Acids Research 52(W1), W540-W546. doi:10.1093/nar/gkae235
Service documentation: https://www.ncbi.nlm.nih.gov/research/pubtator3/
pubtator_entity("TP53", 7157) pubtator_entity("TP53")pubtator_entity("TP53", 7157) pubtator_entity("TP53")
Articles PubTator3 has tagged with a gene
pubtator_gene_literature(symbol = NULL, entrez = NULL, ...)pubtator_gene_literature(symbol = NULL, entrez = NULL, ...)
symbol |
A gene symbol. |
entrez |
An NCBI Gene id, preferred over |
... |
Passed to |
A biohttp envelope whose data is a list of count, entity,
results (the tibble from pubtator_parse_results(), which may be
NULL), and source_url. A count of 0 is ok, not no_data.
Wei et al. (2024). PubTator 3.0: an AI-powered literature resource for unlocking biomedical knowledge. Nucleic Acids Research 52(W1), W540-W546. doi:10.1093/nar/gkae235
Service documentation: https://www.ncbi.nlm.nih.gov/research/pubtator3/
biohttp::body_or_null(pubtator_gene_literature("TP53", 7157))$countbiohttp::body_or_null(pubtator_gene_literature("TP53", 7157))$count
Pure. 0 is a real count and comes back as 0L; only an absent count is
NA.
pubtator_parse_count(body)pubtator_parse_count(body)
body |
A parsed PubTator3 |
A single integer, or NA_integer_.
Wei et al. (2024). PubTator 3.0: an AI-powered literature resource for unlocking biomedical knowledge. Nucleic Acids Research 52(W1), W540-W546. doi:10.1093/nar/gkae235
Service documentation: https://www.ncbi.nlm.nih.gov/research/pubtator3/
pubtator_parse_count(list(count = 4180)) pubtator_parse_count(list(count = 0))pubtator_parse_count(list(count = 4180)) pubtator_parse_count(list(count = 0))
Pure.
pubtator_parse_results(body)pubtator_parse_results(body)
body |
A parsed PubTator3 |
A tibble of pmid, title, journal, authors (a list column, as
an article has any number), year, and source_url. NULL when there are
no results.
Wei et al. (2024). PubTator 3.0: an AI-powered literature resource for unlocking biomedical knowledge. Nucleic Acids Research 52(W1), W540-W546. doi:10.1093/nar/gkae235
Service documentation: https://www.ncbi.nlm.nih.gov/research/pubtator3/
body <- list(results = list(list( pmid = 36197410, title = "TP53 or Not TP53", journal = "Clin Cancer Res" ))) pubtator_parse_results(body)body <- list(results = list(list( pmid = 36197410, title = "TP53 or Not TP53", journal = "Clin Cancer Res" ))) pubtator_parse_results(body)
GO annotations for a UniProt accession
quickgo_annotations( accession, aspect = c("biological_process", "molecular_function", "cellular_component"), limit = 100, ... )quickgo_annotations( accession, aspect = c("biological_process", "molecular_function", "cellular_component"), limit = 100, ... )
accession |
A UniProt accession, for example |
aspect |
One of |
limit |
Maximum annotation rows to ask for. Remember these are evidence lines rather than terms, so this is not a term count. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
quickgo_parse_annotations().
Binns et al. (2009). QuickGO: a web-based tool for Gene Ontology searching. Bioinformatics 25(22), 3045-3046. doi:10.1093/bioinformatics/btp536
Service documentation: https://www.ebi.ac.uk/QuickGO/
biohttp::body_or_null(quickgo_annotations("P21359"))biohttp::body_or_null(quickgo_annotations("P21359"))
Pure.
quickgo_parse_annotations(body)quickgo_parse_annotations(body)
body |
A parsed QuickGO |
A tibble of go_id, go_name, evidence, reference, aspect,
and source_url, one row per distinct GO term. NULL when there are none.
Binns et al. (2009). QuickGO: a web-based tool for Gene Ontology searching. Bioinformatics 25(22), 3045-3046. doi:10.1093/bioinformatics/btp536
Service documentation: https://www.ebi.ac.uk/QuickGO/
body <- list(results = list(list( goId = "GO:0001937", goName = "negative regulation of endothelial cell proliferation", goEvidence = "IMP", reference = "PMID:16648142" ))) quickgo_parse_annotations(body)body <- list(results = list(list( goId = "GO:0001937", goName = "negative regulation of endothelial cell proliferation", goEvidence = "IMP", reference = "PMID:16648142" ))) quickgo_parse_annotations(body)
Pure.
reactome_parse_pathways(body)reactome_parse_pathways(body)
body |
A parsed Reactome pathways response, which is a bare array. |
A tibble of pathway_id, name, in_disease, and source_url, one
row per pathway. NULL when the gene has none.
Milacic et al. (2024). The Reactome Pathway Knowledgebase 2024. Nucleic Acids Research 52(D1), D672-D678. doi:10.1093/nar/gkad1025
Service documentation: https://reactome.org/
body <- list(list( stId = "R-HSA-5658442", displayName = "Regulation of RAS by GAPs", isInDisease = FALSE )) reactome_parse_pathways(body)body <- list(list( stId = "R-HSA-5658442", displayName = "Regulation of RAS by GAPs", isInDisease = FALSE )) reactome_parse_pathways(body)
Reactome pathways for a gene symbol
reactome_pathways(symbol, species = 9606, ...)reactome_pathways(symbol, species = 9606, ...)
symbol |
A gene symbol, for example |
species |
The NCBI taxon id. Defaults to human. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
reactome_parse_pathways().
Milacic et al. (2024). The Reactome Pathway Knowledgebase 2024. Nucleic Acids Research 52(D1), D672-D678. doi:10.1093/nar/gkad1025
Service documentation: https://reactome.org/
biohttp::body_or_null(reactome_pathways("NF1"))biohttp::body_or_null(reactome_pathways("NF1"))
Maps each queried symbol to STRING's own preferredName. Needed to interpret
network edges; see string_reconcile_edges().
string_map_ids(symbols, species = STRING_HUMAN, ...)string_map_ids(symbols, species = STRING_HUMAN, ...)
symbols |
Gene symbols. |
species |
An NCBI taxon id. Defaults to human. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
string_parse_ids().
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
biohttp::body_or_null(string_map_ids(c("SEPTIN9", "TP53")))biohttp::body_or_null(string_map_ids(c("SEPTIN9", "TP53")))
High-confidence edges among the genes you asked about, with the endpoints reconciled back to your symbols.
string_network( symbols, species = STRING_HUMAN, required_score = STRING_MIN_SCORE, reconcile = TRUE, ... )string_network( symbols, species = STRING_HUMAN, required_score = STRING_MIN_SCORE, reconcile = TRUE, ... )
symbols |
Gene symbols. At least two, since one gene has no network. |
species |
An NCBI taxon id. Defaults to human. |
required_score |
STRING's 0-1000 combined-score threshold. |
reconcile |
Whether to fetch the identifier map and translate edge endpoints back into your symbols. Costs one extra request and is skipped automatically when there are no edges to translate. |
... |
Passed to |
A biohttp envelope whose data is a list of edges (see
string_parse_network()), queried, n_query, truncated, and
n_dropped.
The result carries queried, the exact symbol set STRING was asked about
after the 500-identifier cap, plus truncated and n_dropped. That is
what lets a caller tell a gene measured to have no partners from a gene that
was never sent. Reporting the second as the first would invent a negative
result.
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
res <- string_network(c("TP53", "NF1", "EGFR")) biohttp::body_or_null(res)$edgesres <- string_network(c("TP53", "NF1", "EGFR")) biohttp::body_or_null(res)$edges
Pure. One row per queried identifier.
string_parse_ids(body)string_parse_ids(body)
body |
A parsed STRING |
A tibble of query, preferred, and string_id, with query and
preferred upper-cased.
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
body <- list(list( queryItem = "SEPTIN9", preferredName = "SEPT9", stringId = "9606.ENSP00000329125" )) string_parse_ids(body)body <- list(list( queryItem = "SEPTIN9", preferredName = "SEPT9", stringId = "9606.ENSP00000329125" )) string_parse_ids(body)
Pure. Edge endpoints come back in STRING's preferredName space; see
string_reconcile_edges() for why that matters.
string_parse_network(body)string_parse_network(body)
body |
A parsed STRING |
A tibble of gene_a, gene_b, and score, upper-cased. A zero-row
tibble when there are no edges, because "no high-confidence edges" is a real
answer about a set rather than an absence of one.
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
body <- list(list( preferredName_A = "TP53", preferredName_B = "NF1", score = 0.88 )) string_parse_network(body)body <- list(list( preferredName_A = "TP53", preferredName_B = "NF1", score = 0.88 )) string_parse_network(body)
Pure. Sorted by combined score, strongest first.
string_parse_partners(body)string_parse_partners(body)
body |
A parsed STRING |
A tibble of partner, score, and the four evidence channels
experimental, database, coexpression, and textmining. NULL when
there are no partners.
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
body <- list(list( preferredName_B = "SFN", score = 0.999, escore = 0.981, dscore = 0.75, ascore = 0, tscore = 0.859 )) string_parse_partners(body)body <- list(list( preferredName_B = "SFN", score = 0.999, escore = 0.981, dscore = 0.75, ascore = 0, tscore = 0.859 )) string_parse_partners(body)
Interaction partners for one gene
string_partners(symbol, species = STRING_HUMAN, limit = 25, ...)string_partners(symbol, species = STRING_HUMAN, limit = 25, ...)
symbol |
A gene symbol. |
species |
An NCBI taxon id. Defaults to human. |
limit |
How many partners to return. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
string_parse_partners().
STRING serves JSON as text/json rather than application/json. A client
that trusts the content-type header rejects a perfectly good body. biohttp
parses with check_type = FALSE, so this works, but it is the reason not to
"tidy" that up.
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
biohttp::body_or_null(string_partners("TP53"))biohttp::body_or_null(string_partners("TP53"))
Pure, and it exists because of a real and quiet failure.
string_reconcile_edges(edges, id_map)string_reconcile_edges(edges, id_map)
edges |
An edge tibble from |
id_map |
An identifier map from |
STRING's canonical preferredName lags HGNC. Query SEPTIN9 and the edges
come back naming SEPT9, and the network endpoint does not echo the
query term. A caller matching edges against the symbols it asked about
therefore finds nothing for that gene and records it as having no partners,
which is indistinguishable from a real isolate.
Passing the map from string_map_ids() through here translates the endpoints
back. An endpoint with no mapping is left alone, and an empty map leaves the
edges untouched, so reconciliation can never turn a good answer into a worse
one.
The edge tibble, with endpoints translated where a mapping existed.
Szklarczyk et al. (2023). The STRING database in 2023: protein-protein association networks and functional enrichment analyses for any sequenced genome of interest. Nucleic Acids Research 51(D1), D638-D646. doi:10.1093/nar/gkac1000
Service documentation: https://string-db.org/
edges <- tibble::tibble(gene_a = "SEPT9", gene_b = "TP53", score = 0.9) map <- tibble::tibble( query = "SEPTIN9", preferred = "SEPT9", string_id = "9606.ENSP00000329125" ) string_reconcile_edges(edges, map)edges <- tibble::tibble(gene_a = "SEPT9", gene_b = "TP53", score = 0.9) map <- tibble::tibble( query = "SEPTIN9", preferred = "SEPT9", string_id = "9606.ENSP00000329125" ) string_reconcile_edges(edges, map)
Diseases UniProt curates for an accession
uniprot_diseases(accession, ...)uniprot_diseases(accession, ...)
accession |
A UniProt accession, for example |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
uniprot_parse_diseases().
The UniProt Consortium (2025). UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 53(D1), D609-D617. doi:10.1093/nar/gkae1010
Service documentation: https://www.uniprot.org/
biohttp::body_or_null(uniprot_diseases("P04637"))biohttp::body_or_null(uniprot_diseases("P04637"))
From the EBI Proteins API, which is a different host to uniprot_diseases().
uniprot_features(accession, types = UNIPROT_FEATURE_TYPES, ...)uniprot_features(accession, types = UNIPROT_FEATURE_TYPES, ...)
accession |
A UniProt accession. |
types |
Feature types to request. Defaults to the set worth showing when placing a variant in a protein's architecture. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
uniprot_parse_features().
Nightingale et al. (2017). The Proteins API: accessing key integrated protein and genome information. Nucleic Acids Research 45(W1), W539-W544. doi:10.1093/nar/gkx237
The data it serves is UniProt's. The UniProt Consortium (2025). UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 53(D1), D609-D617. doi:10.1093/nar/gkae1010
Service documentation: https://www.ebi.ac.uk/proteins/api/doc/
biohttp::body_or_null(uniprot_features("P15056"))biohttp::body_or_null(uniprot_features("P15056"))
Pure. Which annotated domains, sites, or regions contain a given residue, which is the question a variant reviewer actually asks.
uniprot_features_at(features, position)uniprot_features_at(features, position)
features |
A feature tibble from |
position |
A residue position. |
The rows of features whose begin/end span position.
Nightingale et al. (2017). The Proteins API: accessing key integrated protein and genome information. Nucleic Acids Research 45(W1), W539-W544. doi:10.1093/nar/gkx237
The data it serves is UniProt's. The UniProt Consortium (2025). UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 53(D1), D609-D617. doi:10.1093/nar/gkae1010
Service documentation: https://www.ebi.ac.uk/proteins/api/doc/
features <- uniprot_parse_features(list(features = list( list(type = "DOMAIN", description = "Kinase", begin = "457", end = "717") ))) uniprot_features_at(features, 600) uniprot_features_at(features, 100)features <- uniprot_parse_features(list(features = list( list(type = "DOMAIN", description = "Kinase", begin = "457", end = "717") ))) uniprot_features_at(features, 600) uniprot_features_at(features, 100)
Pure. Reads the DISEASE comments of an entry.
uniprot_parse_diseases(body)uniprot_parse_diseases(body)
body |
A parsed UniProtKB entry. |
A tibble of id, name, acronym, mim, causal, and
source_url. NULL when the entry curates no disease involvement.
UniProt's disease notes separate two very different claims. "The disease is
caused by variants affecting the gene" is a Mendelian statement; "may be
involved in the pathogenesis" is far weaker. Both arrive as DISEASE
comments, so treating them alike would promote a speculative association to a
causal one. causal carries the distinction, read from the note text.
The UniProt Consortium (2025). UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 53(D1), D609-D617. doi:10.1093/nar/gkae1010
Service documentation: https://www.uniprot.org/
body <- list(comments = list(list( commentType = "DISEASE", disease = list( diseaseAccession = "DI-00218", diseaseId = "Li-Fraumeni syndrome", acronym = "LFS", diseaseCrossReference = list(database = "MIM", id = "151623") ), note = list(texts = list(list(value = "The disease is caused by variants"))) ))) uniprot_parse_diseases(body)body <- list(comments = list(list( commentType = "DISEASE", disease = list( diseaseAccession = "DI-00218", diseaseId = "Li-Fraumeni syndrome", acronym = "LFS", diseaseCrossReference = list(database = "MIM", id = "151623") ), note = list(texts = list(list(value = "The disease is caused by variants"))) ))) uniprot_parse_diseases(body)
Pure. Sorted by start position.
uniprot_parse_features(body)uniprot_parse_features(body)
body |
A parsed EBI Proteins |
A tibble of type, label, description, begin, and end. A
zero-row tibble when the entry has no features of the requested types,
because "this protein has no annotated domains" is a real answer.
Nightingale et al. (2017). The Proteins API: accessing key integrated protein and genome information. Nucleic Acids Research 45(W1), W539-W544. doi:10.1093/nar/gkx237
The data it serves is UniProt's. The UniProt Consortium (2025). UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 53(D1), D609-D617. doi:10.1093/nar/gkae1010
Service documentation: https://www.ebi.ac.uk/proteins/api/doc/
body <- list(features = list( list(type = "DOMAIN", description = "Protein kinase", begin = "457", end = "717") )) uniprot_parse_features(body)body <- list(features = list( list(type = "DOMAIN", description = "Protein kinase", begin = "457", end = "717") )) uniprot_parse_features(body)
Validate and normalize one HGVS variant
variantvalidator_normalize( hgvs, build = "GRCh38", throttle = VARIANTVALIDATOR_THROTTLE, ... )variantvalidator_normalize( hgvs, build = "GRCh38", throttle = VARIANTVALIDATOR_THROTTLE, ... )
hgvs |
An HGVS transcript variant. |
build |
A genome build. |
throttle |
A throttle spec. Defaults to the documented 4 per second. |
... |
Passed to |
A biohttp envelope whose data is the tibble described in
variantvalidator_parse().
Freeman et al. (2018). VariantValidator: accurate validation, mapping, and formatting of sequence variation descriptions. Human Mutation 39(1), 61-68. doi:10.1002/humu.23348
Service documentation: https://variantvalidator.org/
biohttp::body_or_null(variantvalidator_normalize("NM_000546.6:c.215C>G"))biohttp::body_or_null(variantvalidator_normalize("NM_000546.6:c.215C>G"))
Pure.
variantvalidator_parse(body, submitted = NA_character_)variantvalidator_parse(body, submitted = NA_character_)
body |
A parsed VariantValidator response. |
submitted |
The HGVS string that was sent. |
A one-row tibble of resolved, submitted, normalized, gene,
protein, chrom, pos, ref, alt, and warnings, where warnings is
a list column. NULL when there is no record at all.
VariantValidator returns an object whose key is the normalized variant,
which is not known before the call. flag and metadata are the only fixed
keys, so the record is found by removing those rather than by looking up a
name. A parser expecting a fixed key finds nothing.
Freeman et al. (2018). VariantValidator: accurate validation, mapping, and formatting of sequence variation descriptions. Human Mutation 39(1), 61-68. doi:10.1002/humu.23348
Service documentation: https://variantvalidator.org/
body <- list( flag = "gene_variant", metadata = list(), `NM_000546.6:c.215C>G` = list(gene_symbol = "TP53") ) variantvalidator_parse(body, "NM_000546.6:c.215C>G")body <- list( flag = "gene_variant", metadata = list(), `NM_000546.6:c.215C>G` = list(gene_symbol = "TP53") ) variantvalidator_parse(body, "NM_000546.6:c.215C>G")
Pure. The default for the options argument of vep_variants() and
vep_variants_all(). Start from this and add to it rather than replacing
it, because vcf_string is one of the identities results are matched on
and mane is what vep_pick_transcript() chooses by.
vep_default_options()vep_default_options()
A named list of flags.
Every entry is a VEP request parameter, sent as name=value on the query
string. TRUE and 1 send name=1; FALSE, 0 and NULL omit the flag.
Names are case sensitive, exactly as VEP spells them. The flags this package
parses are:
AlphaMissense, mane, numbers, vcf_string: the defaults.
af, af_gnomade, af_gnomadg: colocated variant frequencies, read by
vep_parse_colocated().
CADD, SpliceAI, REVEL: per-transcript predictor scores, read by
vep_parse_element().
hgvs: hgvsc and hgvsp notation per transcript.
canonical: marks the canonical transcript.
pick, pick_allele_gene: ask VEP to return one transcript per variant
or per allele and gene, rather than all of them.
protein, domains, variant_class: extra transcript annotation, carried
through untouched in the response for a caller parsing it directly.
LoF: LOFTEE, read into the lof column.
dbNSFP is refused. It returns comma-joined multi-transcript strings in
dbNSFP's own order, not aligned to the transcript being reported, so the
values silently belong to a different transcript than the rest of the row.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
vep_default_options() c(vep_default_options(), list(CADD = 1, REVEL = 1))vep_default_options() c(vep_default_options(), list(CADD = 1, REVEL = 1))
Ensembl publishes no formal limit for the REST service, but an unpaced
burst of the 100 or so requests one case's coding lane needs reliably
trips a 429 partway through. One request per second is conservative
enough to avoid that while still finishing a typical chunk count in a
few minutes; vep_variants_all() applies it by default.
vep_default_throttle()vep_default_throttle()
A throttle spec, see biohttp::req_defaults()'s throttle
argument.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
vep_default_throttle()vep_default_throttle()
Pure. vep_variants() returns a key column built this way, so this is what
a caller uses to join the result back onto its own variant table.
vep_key(chrom, pos, ref, alt)vep_key(chrom, pos, ref, alt)
chrom |
A chromosome, with or without a |
pos |
A 1-based position. |
ref, alt
|
Reference and alternate alleles. |
A single string, chrom-pos-ref-alt.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
vep_key("7", 140753336, "A", "T") vep_key("chr7", 140753336, "a", "t")vep_key("7", 140753336, "A", "T") vep_key("chr7", 140753336, "a", "t")
Pure. One row per requested variant, in the order asked.
vep_parse_batch(body, keys)vep_parse_batch(body, keys)
body |
A parsed VEP response, an array of elements. |
keys |
Variant keys from |
A tibble with one row per entry in keys: a key column, the
columns of vep_parse_element(), then those of vep_parse_colocated().
VEP does not promise that results come back in the order they were sent.
Zipping the response onto the input by index therefore assigns consequences
to the wrong variants, silently. Elements are matched on the key built from
the echoed input line, which is the exact string that was sent.
VEP left-trims and renumbers an indel, so the start and allele_string it
reports do not rebuild the key the caller asked with. An insertion sent as
1 55516888 . T TA . . . comes back as start 55516889 and -/A, and a
delins can come back re-anchored in vcf_string too. The echoed input is
the identity that survives, so it is matched first, then vcf_string, and
the rebuilt key only for a response carrying neither.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
Pure. A VEP element lists the known variants at the same site under
colocated_variants: the dbSNP record, and COSMIC and HGMD entries beside
it. The dbSNP record is the one carrying population frequencies and
clinical significance, so that is the record read. When several dbSNP
records are listed, the one with frequencies wins.
vep_parse_colocated(element)vep_parse_colocated(element)
element |
One parsed VEP result element. |
Frequencies are only present when af, af_gnomade or af_gnomadg was
requested, see vep_default_options(). gnomadg_af_max and
gnomade_af_max are the largest per-population frequency of that source,
which is what a rarity filter wants rather than the overall frequency.
clin_sig is the significance of the element's own allele where VEP
reports it per allele, so the alleles of a multi-allelic site do not share
one answer.
A one-row tibble of rsid, gnomadg_af, gnomade_af,
gnomadg_af_max, gnomade_af_max, and clin_sig, all NA when the
element has no dbSNP record.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
element <- list( allele_string = "G/C", colocated_variants = list(list( id = "rs1042522", frequencies = list(C = list(gnomadg = 0.62, gnomadg_afr = 0.38)), clin_sig = list("benign") )) ) vep_parse_colocated(element)element <- list( allele_string = "G/C", colocated_variants = list(list( id = "rs1042522", frequencies = list(C = list(gnomadg = 0.62, gnomadg_afr = 0.38)), clin_sig = list("benign") )) ) vep_parse_colocated(element)
Pure.
vep_parse_element(element)vep_parse_element(element)
element |
One parsed VEP result element. |
A one-row tibble.
It is at transcript_consequences[].alphamissense$am_pathogenicity, per
transcript. There is nothing at the top level. Hoisting the read out of the
transcript is the single easiest way to get NA everywhere and conclude the
API does not serve it.
hgvsc, hgvsp, canonical, cadd_phred, cadd_raw, revel, the
spliceai_* scores and lof are only populated when the matching flag was
requested, see vep_default_options(). Otherwise they are NA. VEP marks
only the canonical transcript, so canonical is TRUE on that transcript
and NA everywhere else, including when the flag was never asked.
spliceai_max is the largest of the four SpliceAI delta scores.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
element <- list( most_severe_consequence = "missense_variant", transcript_consequences = list(list( gene_symbol = "BRAF", consequence_terms = list("missense_variant"), alphamissense = list(am_pathogenicity = 0.99, am_class = "pathogenic") )) ) vep_parse_element(element)element <- list( most_severe_consequence = "missense_variant", transcript_consequences = list(list( gene_symbol = "BRAF", consequence_terms = list("missense_variant"), alphamissense = list(am_pathogenicity = 0.99, am_class = "pathogenic") )) ) vep_parse_element(element)
Pure. A variant hits many transcripts and only one row can be reported.
vep_pick_transcript(element)vep_pick_transcript(element)
element |
One parsed VEP result element. |
The order is MANE Select first, because that is the community's designated representative transcript; then whichever transcript carries the variant's most severe consequence; then the first VEP listed. Taking the first outright reports an arbitrary transcript, often a non-coding one, which makes the consequence look milder than it is.
One transcript consequence, or NULL when there are none.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
element <- list( most_severe_consequence = "missense_variant", transcript_consequences = list( list(consequence_terms = list("intron_variant")), list(consequence_terms = list("missense_variant"), mane_select = "NM_1") ) ) vep_pick_transcript(element)$mane_selectelement <- list( most_severe_consequence = "missense_variant", transcript_consequences = list( list(consequence_terms = list("intron_variant")), list(consequence_terms = list("missense_variant"), mane_select = "NM_1") ) ) vep_pick_transcript(element)$mane_select
Pure. VEP's region endpoint takes a VCF-like string.
vep_region(chrom, pos, ref, alt)vep_region(chrom, pos, ref, alt)
chrom |
A chromosome, with or without a |
pos |
A 1-based position. |
ref, alt
|
Reference and alternate alleles. |
A single string.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
vep_region("7", 140753336, "A", "T")vep_region("7", 140753336, "A", "T")
Consequence predictions for many variants
vep_variants(chrom, pos, ref, alt, options = vep_default_options(), ...)vep_variants(chrom, pos, ref, alt, options = vep_default_options(), ...)
chrom, pos, ref, alt
|
Variant components, all the same length. |
options |
A named list of VEP request flags. See
|
... |
Passed to |
A biohttp envelope whose data is a tibble with one row per variant,
in the order asked. See vep_parse_batch().
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
biohttp::body_or_null(vep_variants("7", 140753336, "A", "T")) biohttp::body_or_null(vep_variants( "7", 140753336, "A", "T", options = c(vep_default_options(), list(af_gnomadg = 1, CADD = 1)) ))biohttp::body_or_null(vep_variants("7", 140753336, "A", "T")) biohttp::body_or_null(vep_variants( "7", 140753336, "A", "T", options = c(vep_default_options(), list(af_gnomadg = 1, CADD = 1)) ))
vep_variants() refuses more than the 200 VEP accepts per POST. This
chunks the input at chunk_size and dispatches the chunks through
biohttp::post_json_many(), so a variant table of any length is a handful
of requests rather than a loop written at every call site.
vep_variants_all( chrom, pos, ref, alt, chunk_size = VEP_BATCH, options = vep_default_options(), throttle = vep_default_throttle(), ... )vep_variants_all( chrom, pos, ref, alt, chunk_size = VEP_BATCH, options = vep_default_options(), throttle = vep_default_throttle(), ... )
chrom, pos, ref, alt
|
Variant components, all the same length. |
chunk_size |
Variants per request, at most |
options |
A named list of VEP request flags. See
|
throttle |
A throttle spec passed to |
... |
Passed to |
A biohttp envelope whose data is a tibble with one row per
variant, in the order asked: the columns of vep_parse_batch() plus
status, which is "ok" for a row whose chunk was answered and the
failing envelope's status otherwise.
Following gnomad_constraints(). Each chunk's envelope is inspected on its
own; a chunk that failed yields a row of NA per variant carrying the
envelope status in status, while the chunks that succeeded are parsed as
usual. Partial failure is the normal case across many requests, and taking
the whole call down would throw away the answers that did arrive. Only
when every chunk failed is the first failing envelope returned, so an
outage still reads as one.
The input is put in genome order and a repeated variant is sent once, not
once per occurrence, before it is split into chunks. Neither changes the
contract: the return is still one row per input, in input order, and a
repeated variant's positions all carry the same answer (which they did
not necessarily do before, when duplicates could land in different
chunks and see different transient failures). What it does change is how
many requests go out: a coding lane's ~1500 multiallelic-split duplicates
stop costing a request each, and a stable chunk order gives
biohttp's per-chunk cache a real chance to hit between two calls that
share a background.
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
biohttp::body_or_null(vep_variants_all( c("7", "17"), c(140753336, 7676154), c("A", "G"), c("T", "C") ))biohttp::body_or_null(vep_variants_all( c("7", "17"), c(140753336, 7676154), c("A", "G"), c("T", "C") ))