Skip to content

IGVF-DACC/igvf-r-client

Repository files navigation

IGVF API R client

The R client is autogenerated based on this IGVF OpenAPI specification, which exposes search, collection, and other read endpoints from the IGVF Data Portal.

Note while the API endpoints are relatively stable, the underlying data model is still evolving, and changing fields/types can cause breaking changes. The latest version of the client reflects the latest version of the schema used by the API.

  • API version: 57.0.4
  • Package version: 57.0.4
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.RClientCodegen

Installation

Prerequisites

Install the dependencies

install.packages("jsonlite")
install.packages("httr")
install.packages("base64enc")

Install the package

To install directly from Github, use remotes:

install.packages("remotes")
library(remotes)
install_github("IGVF-DACC/igvf-r-client@v57.0.4")

Or clone the repo and build:

git clone https://github.com/IGVF-DACC/igvf-r-client
cd igvf-r-client
R CMD build .
R CMD check igvfclient_57.0.4.tar.gz --no-manual
R CMD INSTALL --preclean igvfclient_57.0.4.tar.gz

To install the package from a local file:

install.packages("igvfclient_57.0.4.tar.gz", repos = NULL, type = "source")

Examples

# Import client
library("igvfclient")

# Instantiate new API instance
api <- IgvfApi$new()

# Search for Software that matches query "abc".
r <- api$Search(query="abc", type=list("Software"))

# Print total number of results and list of results in `@graph`.
print(r$total)
print(r$`@graph`)

# Pull first item, unwrap to underlying Software item with `actual_instance`.
software_item <- r$`@graph`[[1]]$actual_instance

# Print Software item and specific fields.
print(software_item)
print(software_item$`@id`)
print(software_item$description)

# Get the Lab item based on the lab @id in the Software item.
lab <- api$GetById(software_item$lab)

# Print lab and specific field.
print(lab)
print(lab$title)

See other examples in examples.ipynb and test_endpoints.R.

Refer to the documentation for a full specification of endpoint inputs and outputs and model fields.

Documentation for API Endpoints

General Endpoints

All URIs are relative to https://api.data.igvf.org

Class Method HTTP request Description
IgvfApi Search GET /search Search for items on the IGVF Data Portal.
IgvfApi Schemas GET /profiles Retrieve JSON schemas for all item types
IgvfApi SchemaForItemType GET /profiles/{item_type} Retrieve JSON schema for item type
IgvfApi Report GET /multireport.tsv Generate a TSV file report based on search query. All results are returned.
IgvfApi GetById GET /{resource_id} Get item information
IgvfApi Download GET /{file_id}/@@download Download file.
IgvfApi BatchDownload GET /batch-download List files to download based on search query. All results are returned.

Collection Endpoints

All URIs are relative to https://api.data.igvf.org

Class Method HTTP request Description
IgvfApi AccessKeys GET /access-keys/@@listing List items in the AccessKey collection.
IgvfApi AlignmentFiles GET /alignment-files/@@listing List items in the AlignmentFile collection.
IgvfApi AnalysisSets GET /analysis-sets/@@listing List items in the AnalysisSet collection.
IgvfApi AnalysisStepVersions GET /analysis-step-versions/@@listing List items in the AnalysisStepVersion collection.
IgvfApi AnalysisSteps GET /analysis-steps/@@listing List items in the AnalysisStep collection.
IgvfApi AssayTerms GET /assay-terms/@@listing List items in the AssayTerm collection.
IgvfApi AuxiliarySets GET /auxiliary-sets/@@listing List items in the AuxiliarySet collection.
IgvfApi Awards GET /awards/@@listing List items in the Award collection.
IgvfApi Biomarkers GET /biomarkers/@@listing List items in the Biomarker collection.
IgvfApi ConfigurationFiles GET /configuration-files/@@listing List items in the ConfigurationFile collection.
IgvfApi ConstructLibrarySets GET /construct-library-sets/@@listing List items in the ConstructLibrarySet collection.
IgvfApi CrisprModifications GET /crispr-modifications/@@listing List items in the CrisprModification collection.
IgvfApi CuratedSets GET /curated-sets/@@listing List items in the CuratedSet collection.
IgvfApi DegronModifications GET /degron-modifications/@@listing List items in the DegronModification collection.
IgvfApi Documents GET /documents/@@listing List items in the Document collection.
IgvfApi Genes GET /genes/@@listing List items in the Gene collection.
IgvfApi GenomeBrowserAnnotationFiles GET /genome-browser-annotation-files/@@listing List items in the GenomeBrowserAnnotationFile collection.
IgvfApi HumanDonors GET /human-donors/@@listing List items in the HumanDonor collection.
IgvfApi ImageFiles GET /image-files/@@listing List items in the ImageFile collection.
IgvfApi Images GET /images/@@listing List items in the Image collection.
IgvfApi InVitroSystems GET /in-vitro-systems/@@listing List items in the InVitroSystem collection.
IgvfApi InstitutionalCertificates GET /institutional-certificates/@@listing List items in the InstitutionalCertificate collection.
IgvfApi Labs GET /labs/@@listing List items in the Lab collection.
IgvfApi MatrixFiles GET /matrix-files/@@listing List items in the MatrixFile collection.
IgvfApi MeasurementSets GET /measurement-sets/@@listing List items in the MeasurementSet collection.
IgvfApi ModelFiles GET /model-files/@@listing List items in the ModelFile collection.
IgvfApi ModelSets GET /model-sets/@@listing List items in the ModelSet collection.
IgvfApi MultiplexedSamples GET /multiplexed-samples/@@listing List items in the MultiplexedSample collection.
IgvfApi OpenReadingFrames GET /open-reading-frames/@@listing List items in the OpenReadingFrame collection.
IgvfApi Pages GET /pages/@@listing List items in the Page collection.
IgvfApi PhenotypeTerms GET /phenotype-terms/@@listing List items in the PhenotypeTerm collection.
IgvfApi PhenotypicFeatures GET /phenotypic-features/@@listing List items in the PhenotypicFeature collection.
IgvfApi PlatformTerms GET /platform-terms/@@listing List items in the PlatformTerm collection.
IgvfApi PredictionSets GET /prediction-sets/@@listing List items in the PredictionSet collection.
IgvfApi PrimaryCells GET /primary-cells/@@listing List items in the PrimaryCell collection.
IgvfApi Publications GET /publications/@@listing List items in the Publication collection.
IgvfApi ReferenceFiles GET /reference-files/@@listing List items in the ReferenceFile collection.
IgvfApi RodentDonors GET /rodent-donors/@@listing List items in the RodentDonor collection.
IgvfApi SampleTerms GET /sample-terms/@@listing List items in the SampleTerm collection.
IgvfApi SequenceFiles GET /sequence-files/@@listing List items in the SequenceFile collection.
IgvfApi SignalFiles GET /signal-files/@@listing List items in the SignalFile collection.
IgvfApi Software GET /software/@@listing List items in the Software collection.
IgvfApi SoftwareVersions GET /software-versions/@@listing List items in the SoftwareVersion collection.
IgvfApi Sources GET /sources/@@listing List items in the Source collection.
IgvfApi TabularFiles GET /tabular-files/@@listing List items in the TabularFile collection.
IgvfApi TechnicalSamples GET /technical-samples/@@listing List items in the TechnicalSample collection.
IgvfApi Tissues GET /tissues/@@listing List items in the Tissue collection.
IgvfApi Treatments GET /treatments/@@listing List items in the Treatment collection.
IgvfApi Users GET /users/@@listing List items in the User collection.
IgvfApi WholeOrganisms GET /whole-organisms/@@listing List items in the WholeOrganism collection.
IgvfApi Workflows GET /workflows/@@listing List items in the Workflow collection.

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication