| Title: | BioThings Client (https://github.com/biothings/BioThingsClient.R) |
|---|---|
| Description: | This is a unified R client for all "BioThings APIs" (more at http://biothings.io). BioThings APIs are a collection of high-performance APIs for variety of aggregated entity-type specific annotations, such as genes, variants, chemicals, drugs etc. (so called "BioThings"). It also provides a SDK (BioThings SDK) for users to build their own BioThings API for any biological entity types. This client provides a generic R library for existing BioThings APIs as well as the new BioThings APIs will be created in the future, either by us or users. |
| Authors: | Thomas Johnson <[email protected]> |
| Maintainer: | Thomas Johnson <[email protected]> |
| License: | Apache License 2.0 |
| Version: | 0.99.1 |
| Built: | 2026-06-11 04:18:48 UTC |
| Source: | https://github.com/biothings/BioThingsClient.R |
This is a list that containts configuration information for each Biothings API:
biothings_clientsbiothings_clients
An object of class list of length 4.
BioThings APIs:
To integrate a new API into the package, be sure to update this in addition to generating the associated methods from getThing and getThings.
An S4 Class to access BioThings APIs.
BioThings APIs:
An S4 class object of the class Biothings.
clientA client configuration list.
versionThe version of the BioThings package.
verboselogical.
debuglogical.
biothings <- BioThingsClient("gene") slot(biothings, "verbose") <- FALSE # default is TRUE biothingsbiothings <- BioThingsClient("gene") slot(biothings, "verbose") <- FALSE # default is TRUE biothings
Get field metadata information from BioThings API field metadata endpoints
btFields(biothings, ...) ## S4 method for signature 'BioThingsClient' btFields(biothings, ...) ## S4 method for signature 'character' btFields(biothings, ...)btFields(biothings, ...) ## S4 method for signature 'BioThingsClient' btFields(biothings, ...) ## S4 method for signature 'character' btFields(biothings, ...)
biothings |
A BioThings class object |
... |
Additional API parameters. See API documentation. |
A list of results from the metadata fields endpoint
fields <- btFields("gene") head(fields)fields <- btFields("gene") head(fields)
Use gene, taxon, variant, chemical and other IDs to get annotation information from BioThings APIs.
btGet(biothings, ids, fields, ..., return.as = "records") ## S4 method for signature 'BioThingsClient' btGet(biothings, ids, fields, ..., return.as = "records") ## S4 method for signature 'character' btGet(biothings, ids, fields, ..., return.as = "records") ## S4 method for signature 'missing' btGet(biothings, ids, fields, ..., return.as = "records")btGet(biothings, ids, fields, ..., return.as = "records") ## S4 method for signature 'BioThingsClient' btGet(biothings, ids, fields, ..., return.as = "records") ## S4 method for signature 'character' btGet(biothings, ids, fields, ..., return.as = "records") ## S4 method for signature 'missing' btGet(biothings, ids, fields, ..., return.as = "records")
biothings |
BioThings object or character . |
ids |
character. |
fields |
Specify fields to receive from API |
... |
Other parameters to pass to API |
return.as |
character. |
The API response in the form of the provided argument return.as
#Equivalent: btGet("gene", "1017", fields = c("symbol","name","taxid","entrezgene"), return.as = "text")#Equivalent: btGet("gene", "1017", fields = c("symbol","name","taxid","entrezgene"), return.as = "text")
Get metadata information from BioThings API metadata endpoints
btMetadata(biothings, ...) ## S4 method for signature 'BioThingsClient' btMetadata(biothings, ...) ## S4 method for signature 'character' btMetadata(biothings, ...)btMetadata(biothings, ...) ## S4 method for signature 'BioThingsClient' btMetadata(biothings, ...) ## S4 method for signature 'character' btMetadata(biothings, ...)
biothings |
A BioThings class object |
... |
Additional API parameters. See API documentation. |
A list of results from the metadata endpoint
metadata <- btMetadata("gene") head(metadata)metadata <- btMetadata("gene") head(metadata)
Retrieve results from the query endpoint of BioThings APIs
btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records") ## S4 method for signature 'BioThingsClient' btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records") ## S4 method for signature 'missing' btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records") ## S4 method for signature 'character' btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records")btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records") ## S4 method for signature 'BioThingsClient' btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records") ## S4 method for signature 'missing' btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records") ## S4 method for signature 'character' btQuery(biothings, q, ..., fetch_all = FALSE, scopes, return.as = "records")
biothings |
An S4 class BioThings object |
q |
A query string |
... |
Any parameters to pass to API |
fetch_all |
This returns a list of _all_ results for a query,
regardless of |
scopes |
One or more fields (separated by comma) as the search "scopes" |
return.as |
Type of return value |
Returns the API result as the provided return.as type
btQuery("gene", q = "NM_013993") gene_client <- BioThingsClient("gene") btQuery(gene_client, "NM_013993")btQuery("gene", q = "NM_013993") gene_client <- BioThingsClient("gene") btQuery(gene_client, "NM_013993")