From 6605851665dc31cd51c4007cd6cbd713d9f66817 Mon Sep 17 00:00:00 2001 From: rmgpanw Date: Sun, 23 Jun 2024 10:18:50 +0100 Subject: [PATCH] update get_clustered_median_exon_expression() --- R/get_clustered_median_exon_expression.R | 17 ++++++++++------- man/get_clustered_median_exon_expression.Rd | 10 +++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/R/get_clustered_median_exon_expression.R b/R/get_clustered_median_exon_expression.R index b29ee92..30ca54c 100644 --- a/R/get_clustered_median_exon_expression.R +++ b/R/get_clustered_median_exon_expression.R @@ -1,17 +1,18 @@ #' Get Clustered Median Exon Expression #' -#' @description -#' Find median transcript expression data along with hierarchical clusters. +#' @description Find median transcript expression data along with hierarchical +#' clusters. #' #' - Returns median normalized transcript expression in tissues of all known transcripts of a given gene along with the hierarchical clustering results of tissues and transcripts, based on exon expression, in Newick format. #' - The hierarchical clustering is performed by calculating Euclidean distances and using the average linkage method. #' - **This endpoint is not paginated.** -#' - By default, this endpoint queries the latest GTEx release. +#' +#' By default, this endpoint queries the latest GTEx release. #' #' [GTEx Portal API -#'documentation](https://gtexportal.org/api/v2/redoc#tag/Expression-Data-Endpoints/operation/get_clustered_median_exon_expression_api_v2_expression_clusteredMedianExonExpression_get) +#' documentation](https://gtexportal.org/api/v2/redoc#tag/Expression-Data-Endpoints/operation/get_clustered_median_exon_expression_api_v2_expression_clusteredMedianExonExpression_get) #' -#'@inheritParams gtexr_arguments +#' @inheritParams gtexr_arguments #' #' @return A tibble, with clustering data stored as an attribute, "clusters". #' @export @@ -23,7 +24,9 @@ #' "ENSG00000132693.12")) #' #' # clustering data is stored as an attribute "clusters" -#' attributes(result)$cluster +#' result <- get_clustered_median_exon_expression(c("ENSG00000203782.5", +#' "ENSG00000132693.12")) +#' attr(result, "clusters") #' } get_clustered_median_exon_expression <- function(gencodeIds, datasetId = "gtex_v8", @@ -38,7 +41,7 @@ get_clustered_median_exon_expression <- function(gencodeIds, attr(result, "clusters") <- response$clusters - cli::cli_alert_info("Retrieve clustering data with `attrbutes()$clusters`") + cli::cli_alert_info("Retrieve clustering data with `attr(, 'clusters')`") return(result) } diff --git a/man/get_clustered_median_exon_expression.Rd b/man/get_clustered_median_exon_expression.Rd index 4eece6e..c6b89c8 100644 --- a/man/get_clustered_median_exon_expression.Rd +++ b/man/get_clustered_median_exon_expression.Rd @@ -25,14 +25,16 @@ Can be GTEx specific IDs (e.g. "Whole_Blood"; use A tibble, with clustering data stored as an attribute, "clusters". } \description{ -Find median transcript expression data along with hierarchical clusters. +Find median transcript expression data along with hierarchical +clusters. \itemize{ \item Returns median normalized transcript expression in tissues of all known transcripts of a given gene along with the hierarchical clustering results of tissues and transcripts, based on exon expression, in Newick format. \item The hierarchical clustering is performed by calculating Euclidean distances and using the average linkage method. \item \strong{This endpoint is not paginated.} -\item By default, this endpoint queries the latest GTEx release. } +By default, this endpoint queries the latest GTEx release. + \href{https://gtexportal.org/api/v2/redoc#tag/Expression-Data-Endpoints/operation/get_clustered_median_exon_expression_api_v2_expression_clusteredMedianExonExpression_get}{GTEx Portal API documentation} } \examples{ @@ -41,7 +43,9 @@ get_clustered_median_exon_expression(c("ENSG00000203782.5", "ENSG00000132693.12")) # clustering data is stored as an attribute "clusters" -attributes(result)$cluster +result <- get_clustered_median_exon_expression(c("ENSG00000203782.5", + "ENSG00000132693.12")) +attr(result, "clusters") } } \seealso{