Skip to content

Commit

Permalink
WIP: unify param def (#140)
Browse files Browse the repository at this point in the history
Signed-off-by: Daena Rys <[email protected]>
  • Loading branch information
Daenarys8 authored Jul 23, 2024
1 parent 81f967c commit 9e72ffc
Show file tree
Hide file tree
Showing 26 changed files with 594 additions and 639 deletions.
4 changes: 2 additions & 2 deletions R/getNeatOrder.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#' entities being analyzed (e.g. features or samples). There should be 2 columns
#' only representing 2 PCs.
#'
#' @param centering A single \code{character} value specifying the method to
#' @param centering \code{Character scalar}. Specifies the method to
#' center the data. Options are \code{"mean"}, \code{"median"}, or \code{NULL}
#' if your data is already centered. (default: \code{"mean"})
#' if your data is already centered. (Default: \code{"mean"})
#'
#' @param ... Additional arguments passed to other methods.
#'
Expand Down
47 changes: 22 additions & 25 deletions R/plotAbundance.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,56 @@
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @param rank a single \code{character} value defining the taxonomic rank to
#' use. Must be a value of \code{taxonomyRanks(x)}.
#' @param rank \code{Character scalar}. Defines the taxonomic rank to
#' use. Must be a value of \code{taxonomyRanks(x)}. (Default: \code{NULL})
#'
#' @param assay.type a \code{character} value defining which assay data to
#' use. (default: \code{assay.type = "relabundance"})
#' @param assay.type \code{Character scalar} value defining which assay data to
#' use. (Default: \code{"relabundance"})
#'
#' @param assay_name a single \code{character} value for specifying which
#' assay to use for calculation.
#' (Please use \code{assay.type} instead. At some point \code{assay_name}
#' will be disabled.)
#' @param assay_name Deprecate. Use \code{assay.type} instead.
#'
#' @param col.var a single \code{character} value defining a column from
#' @param col.var \code{Character scalar}. Selects a column from
#' \code{colData} to be plotted below the abundance plot.
#' Continuous numeric values will be plotted as point, whereas factors and
#' character will be plotted as colour-code bar. (default: \code{col.var =
#' NULL})
#' character will be plotted as colour-code bar. (Default: \code{NULL})
#'
#' @param features Deprecated. Use \code{col.var} instead.
#'
#' @param order.row.by How to order abundance value: By name (\dQuote{name})
#' @param order.row.by \code{Character scalar}. How to order abundance value: By name (\dQuote{name})
#' for sorting the taxonomic labels alphabetically, by abundance (\dQuote{abund}) to
#' sort by abundance values or by a reverse order of abundance values (\dQuote{revabund}).
#'
#' @param order_rank_by Deprecated. Use \code{order.row.by} instead.
#'
#' @param order.col.by A single character value from the chosen rank of abundance
#' @param order.col.by \code{Character scalar}. from the chosen rank of abundance
#' data or from \code{colData} to select values to order the abundance
#' plot by. (default: \code{order.col.by = NULL})
#' plot by. (Default: \code{NULL})
#'
#' @param order_sample_by Deprecated. Use \code{order.col.by} instead.
#'
#' @param decreasing TRUE or FALSE: If the \code{order.col.by} is defined and the
#' @param decreasing \code{Logical scalar}. If the \code{order.col.by} is defined and the
#' values are numeric, should the values used to order in decreasing or
#' increasing fashion? (default: \code{decreasing = FALSE})
#' increasing fashion? (Default: \code{FALSE})
#'
#' @param layout Either \dQuote{bar} or \dQuote{point}.
#' @param layout \code{Character scalar}. Either \dQuote{bar} or \dQuote{point}.
#'
#' @param one.facet Should the plot be returned in on facet or split into
#' @param one.facet \code{Logical scalar}. Should the plot be returned in on facet or split into
#' different facet, one facet per different value detect in \code{rank}. If
#' \code{col.var} or \code{order.col.by} is not \code{NULL}, this setting will
#' be disregarded.
#' be disregarded. (Default: \code{TRUE})
#'
#' @param one_facet Deprecated. Use \code{one.facet} instead.
#'
#' @param ncol,scales if \code{one.facet = FALSE}, \code{ncol} defines many
#' columns should be for plotting the different facets and \code{scales} is
#' used to define the behavior of the scales of each facet. Both values are
#' passed onto \code{\link[ggplot2:facet_wrap]{facet_wrap}}.
#' @param ncol \code{Numeric scalar}. if \code{one.facet = FALSE}, \code{ncol} defines many
#' columns should be for plotting the different facets. (Default: \code{2})
#'
#' @param scales \code{Character scalar}. Defines the behavior of the scales of each facet. Both values are
#' passed onto \code{\link[ggplot2:facet_wrap]{facet_wrap}}. (Default: \code{"fixed"})
#'
#' @param ... additional parameters for plotting.
#' \itemize{
#' \item{as.relative}{ \code{TRUE} or \code{FALSE}: Should the relative values
#' be calculated? (default: \code{as.relative = FALSE} }
#' \item \code{as.relative} \code{Character scalar}. Should the relative values
#' be calculated? (Default: \code{FALSE})
#' }
#' See \code{\link{mia-plot-args}} for more details i.e. call \code{help("mia-plot-args")}
#'
Expand Down
72 changes: 30 additions & 42 deletions R/plotAbundanceDensity.R
Original file line number Diff line number Diff line change
@@ -1,48 +1,37 @@
#' Plot abundance density
#'
#' This function plots abundance of the most abundant taxa.
#'
#' @param x a
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @param layout a single character value for selecting the layout of the plot.
#' @inheritParams plotAbundance
#'
#' @param layout \code{Character scalar}. Selects the layout of the plot.
#' There are three different options: \code{jitter}, \code{density}, and
#' \code{point} plot. (default: \code{layout = "jitter"})
#'
#' @param assay.type a single character value for selecting the
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{assay}} to be
#' plotted. (default: \code{assay.type = "counts"})
#'
#' @param assay_name a single \code{character} value for specifying which
#' assay to use for calculation.
#' (Please use \code{assay.type} instead. At some point \code{assay_name}
#' will be disabled.)
#'
#' @param n a positive integer specifying the number of the most abundant taxa
#' to show. (default: \code{n = min(nrow(x), 25L)})
#' @param n \code{Integer scalar}. Specifies the number of the most abundant taxa
#' to show. (Default: \code{min(nrow(x), 25L)})
#'
#' @param colour.by a single character value defining a column from
#' @param colour.by \code{Character scalar}. Defines a column from
#' \code{colData}, that is used to color plot. Must be a value of
#' \code{colData()} function. (default: \code{colour.by = NULL})
#' \code{colData()} function. (Default: \code{NULL})
#'
#' @param colour_by Deprecated. Use \code{colour.by} instead.
#'
#' @param shape.by a single character value defining a column from
#' @param shape.by \code{Character scalar}. Defines a column from
#' \code{colData}, that is used to group observations to different point shape
#' groups. Must be a value of \code{colData()} function. \code{shape.by} is
#' disabled when \code{layout = "density"}. (default: \code{shape.by = NULL})
#' disabled when \code{layout = "density"}. (Default: \code{NULL})
#'
#' @param shape_by Deprecated. Use \code{shape.by} instead.
#'
#' @param size.by a single character value defining a column from
#' @param size.by \code{Character scalar}. Defines a column from
#' \code{colData}, that is used to group observations to different point size
#' groups. Must be a value of \code{colData()} function. \code{size.by} is
#' disabled when \code{layout = "density"}. (default: \code{size.by = NULL})
#' disabled when \code{layout = "density"}. (Default: \code{NULL})
#'
#' @param size_by Deprecated. Use \code{size.by} instead.
#'
#' @param decreasing \code{Boolean} indicating whether the results should be ordered
#' @param decreasing \code{Logical scalar}. Indicates whether the results should be ordered
#' in a descending order or not. If \code{NA} is given the order
#' as found in \code{x} for the \code{n} most abundant taxa is used.
#' (Default: \code{TRUE})
Expand All @@ -51,31 +40,30 @@
#'
#' @param ... additional parameters for plotting.
#' \itemize{
#' \item{xlab}{ a single character value for selecting the x-axis label.
#' (default: \code{xlab = assay.type}) }
#' \item \code{xlab} \code{Character scalar}. Selects the x-axis label.
#' (Default: \code{assay.type})
#'
#' \item{ylab}{ a single character value for selecting the y-axis label.
#' \item \code{ylab} \code{Character scalar}. Selects the y-axis label.
#' \code{ylab} is disabled when \code{layout = "density"}.
#' (default: \code{ylab = "Taxa")} }
#' (Default: \code{"Taxa"})
#'
#' \item{point_alpha}{ a numeric value from range 0 to 1 selecting the transparency of
#' colour in \code{jitter} and \code{point} plot. (default: \code{point_alpha = 0.6}) }
#' \item \code{point.alpha} \code{Numeric scalar}. From range 0 to 1. Selects the transparency of
#' colour in \code{jitter} and \code{point} plot. (Default: \code{0.6})
#'
#' \item{point_shape}{ a positive integer value selecting the shape of point in
#' \code{jitter} and \code{point} plot. (default: \code{point_shape = 21}) }
#' \item \code{point.shape} \code{Positive integer scalar}. Value selecting the shape of point in
#' \code{jitter} and \code{point} plot. (Default: \code{21})
#'
#' \item{point_size}{ a positive numeric value selecting the size of point in
#' \code{jitter} and \code{point} plot. (default: \code{point_size = 2}) }
#' \item \code{point.size} \code{Positive integer scalar}. Selects the size of point in
#' \code{jitter} and \code{point} plot. (Default: \code{2})
#'
#' \item{add_legend}{ a boolean value selecting if legend is added.
#' (default: \code{add_legend = TRUE}) }
#' \item \code{add_legend} \code{Logical scalar}. Determines if legend is added.
#' (Default: \code{TRUE})
#'
#' \item{flipped}{ a boolean value selecting if the orientation of plot is changed
#' so that x-axis and y-axis are swapped. (default \code{flipped = FALSE}) }
#' \item \code{flipped}: \code{Logical scalar}. Determines if the orientation of plot is changed
#' so that x-axis and y-axis are swapped. (Default: \code{FALSE})
#'
#' \item{add_x_text}{ a boolean value selecting if text that represents values is included
#' in x-axis. (default: \code{add_x_text = TRUE}) }
#'
#' \item \code{add_x_text} \code{Logical scalar}. Determines if text that represents values is included
#' in x-axis. (Default: \code{TRUE})
#' }
#' See \code{\link{mia-plot-args}} for more details i.e. call \code{help("mia-plot-args")}
#'
Expand Down Expand Up @@ -122,14 +110,14 @@
#' # Point shape is changed from default (21) to 41.
#' plotAbundanceDensity(
#' tse, layout = "point", assay.type = "relabundance", n = 10,
#' point_shape = 41)
#' point.shape = 41)
#'
#' # Plots the relative abundance of 10 most abundant taxa as a point plot.
#' # In addition to colour, groups can be visualized by size and shape in point plots,
#' # and adjusted for point size
#' plotAbundanceDensity(
#' tse, layout = "point", assay.type = "relabundance", n = 10,
#' shape.by = "Geographical_location", size.by = "Age", point_size=1)
#' shape.by = "Geographical_location", size.by = "Age", point.size=1)
#'
#' # Ordering via decreasing
#' plotAbundanceDensity(
Expand Down
72 changes: 36 additions & 36 deletions R/plotCCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,71 +8,71 @@
#' \code{\link[TreeSummarizedExperiment:TreeSummarizedExperiment-constructor]{TreeSummarizedExperiment}}
#' or a matrix of weights. The latter is returned as output from \code{\link[mia:runCCA]{getRDA}}.
#'
#' @param dimred A string or integer scalar indicating the reduced dimension to
#' @param dimred \code{Character scalar} or \code{integer scalar}. Determines the reduced dimension to
#' plot. This is the output of \code{\link[mia:runCCA]{addRDA}} and resides in
#' \code{reducedDim(tse, dimred)}.
#'
#' @param add.ellipse One of \code{c(TRUE, FALSE, "fill", "colour", "color")},
#' indicating whether ellipses should be present, absent, filled or colored.
#' (default: \code{ellipse.fill = TRUE})
#'
#' @param ellipse.alpha Number between 0 and 1 to adjust the opacity of ellipses.
#' (default: \code{ellipse.alpha = 0.2})
#' @param ellipse.alpha \code{Numeric scalar}. Between 0 and 1. Adjusts the opacity of ellipses.
#' (Default: \code{0.2})
#'
#' @param ellipse.linewidth Number specifying the size of ellipses.
#' (default: \code{ellipse.linewidth = 0.1})
#' @param ellipse.linewidth \code{Numeric scalar}. Specifies the size of ellipses.
#' (Default: \code{0.1})
#'
#' @param ellipse.linetype Discrete number specifying the style of ellipses.
#' (default: \code{ellipse.linetype = 1})
#' @param ellipse.linetype \code{Integer scalar}. Specifies the style of ellipses.
#' (Default: \code{1})
#'
#' @param confidence.level Number between 0 and 1 to adjust confidence level.
#' (default: \code{confidence.level = 0.95})
#' @param confidence.level \code{Numeric scalar}. Between 0 and 1. Adjusts confidence level.
#' (Default: \code{0.95})
#'
#' @param add.vectors TRUE or FALSE, should vectors appear in the plot.
#' (default: \code{add.vectors = TRUE})
#' @param add.vectors \code{Logical scalar}. Should vectors appear in the plot.
#' (Default: \code{TRUE})
#'
#' @param vec.size Number specifying the size of vectors.
#' (default: \code{vec.size = 0.5})
#' @param vec.size \code{Numeric scalar}. Specifies the size of vectors.
#' (Default: \code{0.5})
#'
#' @param vec.colour String specifying the colour of vectors.
#' (default: \code{vec.color = "black"})
#' @param vec.colour \code{Character scalar}. Specifies the colour of vectors.
#' (Default: \code{"black"})
#'
#' @param vec.color Alias for `vec.colour`.
#'
#' @param vec.linetype Discrete number specifying the style of vector lines.
#' (default: \code{vec.linetype = 1})
#' @param vec.linetype \code{Integer scalar}. Specifies the style of vector lines.
#' (Default: \code{1})
#'
#' @param arrow.size Number specifying the size of arrows.
#' @param arrow.size \code{Numeric scalar}. Specifies the size of arrows.
#' (defaults: \code{arrow.size = 0.25})
#'
#' @param label.size Number specifying the size of text and labels.
#' (default: \code{label.size = 4})
#' @param label.size \code{Numeric scalar}. Specifies the size of text and labels.
#' (Default: \code{4})
#'
#' @param label.colour String specifying the colour of text and labels.
#' (default: \code{label.color = "black"})
#' @param label.colour \code{Character scalar}. Specifies the colour of text and labels.
#' (Default: \code{"black"})
#'
#' @param label.color Alias for `label.colour`.
#'
#' @param sep.group String specifying the separator used in the labels.
#' (default: \code{sep.group = "\U2014"})
#' @param sep.group \code{Character scalar}. Specifies the separator used in the labels.
#' (Default: \code{"\U2014"})
#'
#' @param repl.underscore String used to replace underscores in the labels.
#' (default: \code{repl.underscore = " "})
#' @param repl.underscore \code{Character scalar}. Used to replace underscores in the labels.
#' (Default: \code{" "})
#'
#' @param vec.text TRUE or FALSE, should text instead of labels be used to label vectors.
#' (default: \code{vec.text = TRUE})
#' @param vec.text \code{Logical scalar}. Should text instead of labels be used to label vectors.
#' (Default: \code{TRUE})
#'
#' @param repel.labels TRUE or FALSE, should labels be repelled.
#' (default: \code{repel.labels = TRUE})
#' @param repel.labels \code{Logical scalar}. Should labels be repelled.
#' (Default: \code{TRUE})
#'
#' @param parse.labels TRUE or FALSE, should labels be parsed.
#' (default: \code{parse.labels = TRUE})
#' @param parse.labels \code{Logical scalar}. Should labels be parsed.
#' (Default: \code{TRUE})
#'
#' @param add.significance TRUE or FALSE, should explained variance and p-value
#' appear in the labels. (default: \code{add.significance = TRUE})
#' @param add.significance \code{Logical scalar}. Should explained variance and p-value
#' appear in the labels. (Default: \code{TRUE})
#'
#' @param add.expl.var TRUE or FALSE, should explained variance appear on the
#' coordinate axes. (default: \code{add.expl.var = TRUE})
#' @param add.expl.var \code{Logical scalar}. Should explained variance appear on the
#' coordinate axes. (Default: \code{TRUE})
#'
#' @param ... additional parameters for plotting, inherited from
#' \code{\link[scater:plotReducedDim]{plotReducedDim}},
Expand Down
4 changes: 2 additions & 2 deletions R/plotColTile.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @param x String specifying the column-level metadata field to show on the x-axis.
#' @param x \code{Character scalar}. Specifies the column-level metadata field to show on the x-axis.
#' Alternatively, an \link{AsIs} vector or data.frame, see
#' \code{?\link{retrieveFeatureInfo}} or \code{?\link{retrieveCellInfo}}. Must
#' result in a returned \code{character} or \code{factor} vector.
#'
#' @param y String specifying the column-level metadata to show on the y-axis.
#' @param y \code{Character scalar}. Specifies the column-level metadata to show on the y-axis.
#' Alternatively, an \link{AsIs} vector or data.frame, see
#' \code{?\link{retrieveFeatureInfo}} or \code{?\link{retrieveCellInfo}}. Must
#' result in a returned \code{character} or \code{factor} vector.
Expand Down
5 changes: 3 additions & 2 deletions R/plotDMN.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object contain the DMN data in \code{metadata}.
#'
#' @param type the type of measure for access the goodness of fit. One of
#' @param type \code{Character scalar}. The type of measure for access the goodness of fit. One of
#' \sQuote{laplace}, \sQuote{AIC} or \sQuote{BIC}.
#'
#' @param name the name to store the result in
#' @param name \code{Character scalar}. The name to store the result in
#' \code{\link[SummarizedExperiment:RangedSummarizedExperiment-class]{metadata}}
#' (Default: \code{"DMN"})
#'
#' @param ... optional arguments not used.
#'
Expand Down
Loading

0 comments on commit 9e72ffc

Please sign in to comment.