Skip to content

Commit

Permalink
update get_clustered_median_exon_expression()
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgpanw committed Jun 23, 2024
1 parent cfa0a38 commit 6605851
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
17 changes: 10 additions & 7 deletions R/get_clustered_median_exon_expression.R
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
Expand All @@ -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(<df>)$clusters`")
cli::cli_alert_info("Retrieve clustering data with `attr(<df>, 'clusters')`")

return(result)
}
10 changes: 7 additions & 3 deletions man/get_clustered_median_exon_expression.Rd

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

0 comments on commit 6605851

Please sign in to comment.