R/getDataset.R

Defines functions getDataset

Documented in getDataset

#' @title getDataset function
#' @description Get a dataset by its ID.
#' @details This function requests \code{GET host/datasets/datasetId}.
#' @param host URL of GA4GH API data server.
#' @param datasetId The ID of the dataset to be retrieved.
#' @return \code{\link{DataFrame}} object.
#' @references \href{https://ga4gh-schemas.readthedocs.io/en/latest/schemas/metadata_service.proto.html#GetDataset}{Official documentation}.
#' @examples
#' host <- "http://1kgenomes.ga4gh.org/"
#' \dontrun{
#' datasetId <- searchDatasets(host, nrows = 1)$id
#' getDataset(host, datasetId)
#' }
#' @seealso \code{\link{DataFrame}}, \code{\link{searchDatasets}}
#' @export getDataset
getDataset <- function(host, datasetId)
{
    response <- request.get(host, "datasets", datasetId)
    DataFrame(as.list(unlist(response)))
}

Try the GA4GHclient package in your browser

Any scripts or data that you put into this service are public.

GA4GHclient documentation built on Nov. 8, 2020, 5:47 p.m.