Skip to content

Commit

Permalink
add gtexr-package.R, including globalVariables() for ".data"; update …
Browse files Browse the repository at this point in the history
…examples sectoin for get_file_list()
  • Loading branch information
rmgpanw committed Jun 15, 2024
1 parent f4db006 commit e654db7
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 4 deletions.
24 changes: 20 additions & 4 deletions R/get_file_list.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
#' Get File List
#'
#' @description
#' Get all the files in GTEx dataset for Download page
#' @description Get all the files in GTEx dataset for Download page
#'
#' [GTEx Portal API
#' documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_file_list_api_v2_dataset_fileList_get)
#' [GTEx Portal API
#' documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_file_list_api_v2_dataset_fileList_get)
#'
#' @details The returned tibble includes a nested list column, "filesets". This
#' details files, sub-categorised by fileset (see examples section).
#'
#' @return A tibble
#' @export
#' @family Datasets Endpoints
#'
#' @examples
#' \dontrun{
#' # Column "filesets" is a list column
#' get_file_list()
#'
#' # Get "GTEx Analysis V9" file list
#' gtex_v9_files <- get_file_list() |>
#' dplyr::filter(name == "GTEx Analysis V9") |>
#' dplyr::pull(filesets)
#'
#' # "GTEx Analysis V9" filesets
#' names(gtex_v9_files[[1]])
#'
#' # "GTEx Analysis V9", "snRNA-Seq Data" fileset files
#' names(gtex_v9_files[[1]][["snRNA-Seq Data"]]$files)
#' }
get_file_list <- function() {
result <- gtex_query(endpoint = "dataset/fileList", return_raw = TRUE)
result |>
Expand Down
10 changes: 10 additions & 0 deletions R/gtexr-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
globalVariables(
c(".data")
)

#' @keywords internal
"_PACKAGE"

## usethis namespace: start
## usethis namespace: end
NULL
18 changes: 18 additions & 0 deletions man/get_file_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/gtexr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e654db7

Please sign in to comment.