From 2f24812c903040aece28550a96286a5f5cef3f53 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Wed, 30 Nov 2022 15:27:00 +0100 Subject: [PATCH] Export plot functions --- NAMESPACE | 3 +++ R/plots.R | 9 ++++++--- man/box_plot.Rd | 19 +++++++++++++++++++ man/overview_plot.Rd | 21 +++++++++++++++++++++ man/scores_plot.Rd | 22 ++++++++++++++++++++++ 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 man/box_plot.Rd create mode 100644 man/overview_plot.Rd create mode 100644 man/scores_plot.Rd diff --git a/NAMESPACE b/NAMESPACE index 41009d9..9233be5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,10 @@ # Generated by roxygen2: do not edit by hand export(analyze) +export(box_plot) +export(overview_plot) export(rank_genes) export(run_app) +export(scores_plot) import(data.table) import(shiny) diff --git a/R/plots.R b/R/plots.R index 06f2705..c4d664d 100644 --- a/R/plots.R +++ b/R/plots.R @@ -5,7 +5,8 @@ #' @param sample_proportion Proportion of rows to use as the shown sample. #' #' @return A `plotly` figure. -#' @noRd +#' +#' @export overview_plot <- function(ranked_data, highlighted_genes = NULL, sample_proportion = 0.05) { @@ -67,7 +68,8 @@ overview_plot <- function(ranked_data, #' @param highlighted_genes Genes that will be compared. #' #' @return A `plotly` figure. -#' @noRd +#' +#' @export box_plot <- function(ranked_data, highlighted_genes) { data <- data.table::copy(ranked_data) data[, group := data.table::fifelse( @@ -96,7 +98,8 @@ box_plot <- function(ranked_data, highlighted_genes) { #' `NULL`, all ranks will be shown. #' #' @return A `plotly` figure for rendering. -#' @noRd +#' +#' @export scores_plot <- function(ranked_data, highlighted_genes = NULL, ranks = 1000) { data <- if (is.null(ranks)) { ranked_data diff --git a/man/box_plot.Rd b/man/box_plot.Rd new file mode 100644 index 0000000..0ad6510 --- /dev/null +++ b/man/box_plot.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plots.R +\name{box_plot} +\alias{box_plot} +\title{Create a plot comparing some genes with the overall ranking.} +\usage{ +box_plot(ranked_data, highlighted_genes) +} +\arguments{ +\item{ranked_data}{The ranking to visualize.} + +\item{highlighted_genes}{Genes that will be compared.} +} +\value{ +A \code{plotly} figure. +} +\description{ +Create a plot comparing some genes with the overall ranking. +} diff --git a/man/overview_plot.Rd b/man/overview_plot.Rd new file mode 100644 index 0000000..bf3bad8 --- /dev/null +++ b/man/overview_plot.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plots.R +\name{overview_plot} +\alias{overview_plot} +\title{Create a plot showing an overview over the provided ranking.} +\usage{ +overview_plot(ranked_data, highlighted_genes = NULL, sample_proportion = 0.05) +} +\arguments{ +\item{ranked_data}{The ranking to visualize.} + +\item{highlighted_genes}{Genes that will be marked.} + +\item{sample_proportion}{Proportion of rows to use as the shown sample.} +} +\value{ +A \code{plotly} figure. +} +\description{ +Create a plot showing an overview over the provided ranking. +} diff --git a/man/scores_plot.Rd b/man/scores_plot.Rd new file mode 100644 index 0000000..d484043 --- /dev/null +++ b/man/scores_plot.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plots.R +\name{scores_plot} +\alias{scores_plot} +\title{Create plot showing the distribution of scores using \code{plotly}.} +\usage{ +scores_plot(ranked_data, highlighted_genes = NULL, ranks = 1000) +} +\arguments{ +\item{ranked_data}{Data on genes with precomputed ranks.} + +\item{highlighted_genes}{Genes that will be marked.} + +\item{ranks}{How may ranks the x-axis should include. If this parameter is +\code{NULL}, all ranks will be shown.} +} +\value{ +A \code{plotly} figure for rendering. +} +\description{ +Create plot showing the distribution of scores using \code{plotly}. +}