diff --git a/DESCRIPTION b/DESCRIPTION index 00b573e..2cd1972 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -54,6 +54,7 @@ VignetteBuilder: biocViews: Infrastructure, DataRepresentation Encoding: UTF-8 RoxygenNote: 7.3.1 +Roxygen: list(markdown = TRUE) Video: https://youtu.be/w6HWAHaDpyk, https://youtu.be/Vh0hVVUKKFM Collate: 'ExperimentList-class.R' diff --git a/R/ExperimentList-class.R b/R/ExperimentList-class.R index 99afc83..bd494f0 100644 --- a/R/ExperimentList-class.R +++ b/R/ExperimentList-class.R @@ -8,17 +8,17 @@ #' #' @title ExperimentList - A container for multi-experiment data #' -#' @description The \code{ExperimentList} class is a container that builds on -#' the \code{SimpleList} with additional checks for consistency in experiment -#' names and length. It contains a \code{SimpleList} of experiments with +#' @description The `ExperimentList` class is a container that builds on +#' the `SimpleList` with additional checks for consistency in experiment +#' names and length. It contains a `SimpleList` of experiments with #' sample identifiers. One element present per experiment performed. #' -#' Convert from \code{SimpleList} or \code{list} to the multi-experiment data -#' container. When using the \strong{mergeReplicates} method, additional -#' arguments are passed to the given \code{simplify} function argument (e.g., +#' Convert from `SimpleList` or `list` to the multi-experiment data +#' container. When using the **mergeReplicates** method, additional +#' arguments are passed to the given `simplify` function argument (e.g., #' \code{na.rm = TRUE}) #' -#' @return An \code{ExperimentList} class object +#' @return An `ExperimentList` class object #' #' @examples #' @@ -31,15 +31,15 @@ setClass("ExperimentList", contains = "SimpleList") ### Constructor ### -#' Represent multiple experiments as a List-derivative \code{ExperimentList} +#' Represent multiple experiments as a List-derivative `ExperimentList` #' -#' The \code{ExperimentList} class can contain several different types of data. -#' The only requirements for an \code{ExperimentList} class are that the -#' objects contained have the following set of methods: \code{dim}, \code{[}, -#' \code{dimnames} +#' The `ExperimentList` class can contain several different types of data. +#' The only requirements for an `ExperimentList` class are that the +#' objects contained have the following set of methods: `dim`, \code{[}, +#' `dimnames` #' -#' @param ... A named \code{list} class object -#' @return A \code{ExperimentList} class object of experiment data +#' @param ... A named `list` class object +#' @return A `ExperimentList` class object of experiment data #' #' @example inst/scripts/ExperimentList-Ex.R #' @export @@ -166,10 +166,9 @@ S4Vectors::setValidity2("ExperimentList", .validExperimentList) vapply(x, `[`, integer(1L), pos) } -#' @describeIn ExperimentList Show method for -#' \code{\linkS4class{ExperimentList}} class +#' @describeIn ExperimentList Show method for [`ExperimentList`] class #' -#' @param object,x An \code{\linkS4class{ExperimentList}} object +#' @param object,x An [`ExperimentList`] object setMethod("show", "ExperimentList", function(object) { o_class <- class(object) elem_cl <- vapply(object, function(o) { class(o)[[1L]] }, character(1L)) @@ -198,15 +197,13 @@ coerceToExperimentList <- function(from) { #' #' @section #' coercion: -#' Convert a \code{list} or S4 \code{List} to an ExperimentList using the +#' Convert a `list` or S4 `List` to an ExperimentList using the #' `as()` function. #' -#' In the following example, \code{x} is either a \code{list} or -#' \linkS4class{List}: +#' In the following example, `x` is either a `list` or +#' [`List`]: #' -#' \preformatted{ \code{as(x, "ExperimentList")}} -#' -#' @md +#' \preformatted{ as(x, "ExperimentList")} #' #' @exportMethod coerce diff --git a/R/MatchedAssayExperiment-class.R b/R/MatchedAssayExperiment-class.R index 8a34ae5..bc02497 100644 --- a/R/MatchedAssayExperiment-class.R +++ b/R/MatchedAssayExperiment-class.R @@ -11,10 +11,10 @@ NULL #' This class supports the use of matched samples where an equal number #' of observations per biological unit are present in all assays. #' -#' @return A \code{MatchedAssayExperiment} object +#' @return A `MatchedAssayExperiment` object #' #' @exportClass MatchedAssayExperiment -#' @seealso \link{MultiAssayExperiment} +#' @seealso [`MultiAssayExperiment`] #' setClass("MatchedAssayExperiment", contains="MultiAssayExperiment") @@ -65,7 +65,7 @@ S4Vectors::setValidity2("MatchedAssayExperiment", .validMatchedAssayExperiment) } #' @describeIn MatchedAssayExperiment-class Construct a -#' \code{MatchedAssayExperiment} class from \linkS4class{MultiAssayExperiment} +#' `MatchedAssayExperiment` class from [`MultiAssayExperiment`] #' #' @param ... Either a single MultiAssayExperiment or the components to create #' a valid MultiAssayExperiment diff --git a/R/MultiAssayExperiment-class.R b/R/MultiAssayExperiment-class.R index a2d0bba..f590ed2 100644 --- a/R/MultiAssayExperiment-class.R +++ b/R/MultiAssayExperiment-class.R @@ -23,42 +23,39 @@ NULL #' The `MultiAssayExperiment` class can be used to manage results of #' diverse assays on a collection of specimen. Currently, the class can handle #' assays that are organized instances of -#' \code{\linkS4class{SummarizedExperiment}}, -#' \code{\linkS4class{ExpressionSet}}, `matrix`, -#' \code{\link[RaggedExperiment:RaggedExperiment-class]{RaggedExperiment}} -#' (inherits from \code{\linkS4class{GRangesList}}), and `RangedVcfStack`. +#' [`SummarizedExperiment`], +#' [`ExpressionSet`], `matrix`, `RaggedExperiment` +#' (inherits from [`GRangesList`]), and `RangedVcfStack`. #' Create new `MultiAssayExperiment` instances with the homonymous -#' constructor, minimally with the argument \code{\link{ExperimentList}}, +#' constructor, minimally with the argument [`ExperimentList`], #' potentially also with the arguments `colData` (see section below) and -#' \code{\link{sampleMap}}. +#' [`sampleMap`]. #' #' @details -#' The dots (\code{\ldots}) argument allows the user to specify additional +#' The dots (`...`) argument allows the user to specify additional #' arguments in several instances. -#' \itemize{ -#' \item subsetting \strong{[}: additional arguments sent to -#' \link[GenomicRanges:findOverlaps-methods]{findOverlaps}. -#' \item mergeReplicates: used to specify arguments for the \code{simplify} -#' functional argument -#' \item assay: may contain withDimnames, which is forwarded to assays -#' \item combining \strong{c}: compatible \code{MultiAssayExperiment} classes -#' passed on to the \code{\linkS4class{ExperimentList}} constructor, -#' can be a \code{list}, \code{\linkS4class{List}}, or a series of -#' named arguments. See the examples below. -#' } +#' * subsetting **[**: additional arguments sent to +#' [`findOverlaps`][GenomicRanges::findOverlaps-methods]. +#' * mergeReplicates: used to specify arguments for the `simplify` +#' functional argument +#' * assay: may contain withDimnames, which is forwarded to assays +#' * combining **c**: compatible `MultiAssayExperiment` classes +#' passed on to the [`ExperimentList`] constructor, +#' can be a `list`, [`List`], or a series of +#' named arguments. See the examples below. #' #' @section colData: #' The `colData` slot is a collection of primary specimen data valid #' across all experiments. This slot is strictly of class -#' \code{\linkS4class{DataFrame}} but arguments for the constructor function +#' [`DataFrame`] but arguments for the constructor function #' allow arguments to be of class `data.frame` and subsequently coerced. #' #' @section ExperimentList: -#' The \code{\link{ExperimentList}} slot is designed to contain results from -#' each experiment/assay. It contains a \linkS4class{SimpleList}. +#' The [`ExperimentList`] slot is designed to contain results from +#' each experiment/assay. It contains a [`SimpleList`]. #' #' @section sampleMap: -#' The \code{\link{sampleMap}} contains a `DataFrame` of translatable +#' The [`sampleMap`] contains a `DataFrame` of translatable #' identifiers of samples and participants or biological units. The standard #' column names of the `sampleMap` are "assay", "primary", and "colname". #' Note that the "assay" column is a factor corresponding to the names of each @@ -73,7 +70,7 @@ NULL #' "assay" factor in the `sampleMap` do not match the names in the #' `ExperimentList`. #' -#' @slot ExperimentList A \code{\link{ExperimentList}} class object for +#' @slot ExperimentList A [`ExperimentList`] class object for #' each assay dataset #' #' @slot colData A `DataFrame` of all clinical/specimen data available @@ -93,8 +90,6 @@ NULL #' #' @return A `MultiAssayExperiment` object #' -#' @md -#' #' @examples #' example("MultiAssayExperiment") #' @@ -117,7 +112,7 @@ NULL #' #' @exportClass MultiAssayExperiment #' -#' @seealso \link{MultiAssayExperiment-methods} for slot modifying methods, +#' @seealso [MultiAssayExperiment-methods] for slot modifying methods, #' \href{https://github.com/waldronlab/MultiAssayExperiment/wiki/MultiAssayExperiment-API}{MultiAssayExperiment API} #' #' @include ExperimentList-class.R @@ -249,12 +244,12 @@ setClass( } #' Construct an integrative representation of multi-omic data with -#' \code{MultiAssayExperiment} +#' `MultiAssayExperiment` #' -#' The constructor function for the \link{MultiAssayExperiment-class} combines +#' The constructor function for the [MultiAssayExperiment-class] combines #' multiple data elements from the different hierarchies of data #' (study, experiments, and samples). It can create instances where neither -#' a \code{sampleMap} or a \code{colData} set is provided. Please see the +#' a `sampleMap` or a `colData` set is provided. Please see the #' MultiAssayExperiment API documentation for more information. #' #' @section colData: @@ -263,13 +258,13 @@ setClass( #' the colnames in the experiments if no sampleMap is provided. #' #' @section experiments: -#' The `experiments` input can be of class \linkS4class{SimpleList} or `list`. -#' This input becomes the \code{\link{ExperimentList}}. Each element of the +#' The `experiments` input can be of class [`SimpleList`] or `list`. +#' This input becomes the [`ExperimentList`]. Each element of the #' input `list` or `List` must be named, rectangular with two dimensions, and #' have `dimnames`. #' #' @section sampleMap: -#' The \code{\link{sampleMap}} can either be input as `DataFrame` or +#' The [`sampleMap`] can either be input as `DataFrame` or #' `data.frame` with eventual coercion to `DataFrame`. The `sampleMap` relates #' biological units and biological measurements within each assay. Each row in #' the `sampleMap` is a single such link. The standard column names of the @@ -285,28 +280,28 @@ setClass( #' experiments if the levels of the "assay" factor in the `sampleMap` do not #' match the names in the `ExperimentList`. #' -#' @param experiments A \code{list} or \link{ExperimentList} of all +#' @param experiments A `list` or [`ExperimentList`] of all #' combined experiments #' -#' @param colData A \code{\linkS4class{DataFrame}} or \code{data.frame} of +#' @param colData A [`DataFrame`] or \code{data.frame} of #' characteristics for all biological units #' -#' @param sampleMap A \code{DataFrame} or \code{data.frame} of assay names, +#' @param sampleMap A `DataFrame` or \code{data.frame} of assay names, #' sample identifiers, and colname samples #' #' @param metadata An optional argument of "ANY" class (usually list) for #' content describing the experiments #' -#' @param drops A \code{list} of unmatched information +#' @param drops A `list` of unmatched information #' (included after subsetting) #' -#' @return A \code{MultiAssayExperiment} object that can store +#' @return A `MultiAssayExperiment` object that can store #' experiment and phenotype data #' #' @example inst/scripts/MultiAssayExperiment-Ex.R #' #' @export MultiAssayExperiment -#' @seealso \link{MultiAssayExperiment-class} +#' @seealso [MultiAssayExperiment-class] MultiAssayExperiment <- function( experiments = ExperimentList(), @@ -462,7 +457,7 @@ S4Vectors::setValidity2("MultiAssayExperiment", .validMultiAssayExperiment) #' @exportMethod show #' @describeIn MultiAssayExperiment Show method for a -#' \code{MultiAssayExperiment} +#' `MultiAssayExperiment` setMethod("show", "MultiAssayExperiment", function(object) { if (.hasOldAPI(object)) { stop("MultiAssayExperiment is outdated, please run updateObject()") @@ -505,50 +500,46 @@ setMethod("show", "MultiAssayExperiment", function(object) { #' @title Accessing and modifying information in MultiAssayExperiment #' #' @description A set of accessor and setter generic functions to extract -#' either the \code{sampleMap}, the \code{\link{ExperimentList}}, -#' \code{colData}, or \code{metadata} slots of a -#' \code{\link{MultiAssayExperiment}} object +#' either the `sampleMap`, the [`ExperimentList`], +#' `colData`, or `metadata` slots of a +#' [`MultiAssayExperiment`] object #' #' @section Accessors: -#' Eponymous names for accessing \code{MultiAssayExperiment} slots with the -#' exception of the \link{ExperimentList} accessor named \code{experiments}. -#' \itemize{ -#' \item colData: Access the \code{colData} slot -#' \item sampleMap: Access the \code{sampleMap} slot -#' \item experiments: Access the \link{ExperimentList} slot -#' \item `[[`: Access the \link{ExperimentList} slot -#' \item `$`: Access a column in \code{colData} -#' \item `drops`: Get a vector of dropped \link{ExperimentList} names -#' } +#' Eponymous names for accessing `MultiAssayExperiment` slots with the +#' exception of the [`ExperimentList`] accessor named `experiments`. +#' * colData: Access the `colData` slot +#' * sampleMap: Access the `sampleMap` slot +#' * experiments: Access the [`ExperimentList`] slot +#' * `[[`: Access the [`ExperimentList`] slot +#' * `$`: Access a column in `colData` +#' * `drops`: Get a vector of dropped [`ExperimentList`] names #' #' @section Setters: #' Setter method values (i.e., '\code{function(x) <- value}'): -#' \itemize{ -#' \item experiments<-: An \code{\link{ExperimentList}} object +#' * experiments<-: An [`ExperimentList`] object #' containing experiment data of supported classes -#' \item sampleMap<-: A \code{\link{DataFrame}} object relating +#' * sampleMap<-: A [`DataFrame`] object relating #' samples to biological units and assays -#' \item colData<-: A \code{\link{DataFrame}} object describing the +#' * colData<-: A [`DataFrame`] object describing the #' biological units -#' \item metadata<-: A \code{list} object of metadata -#' \item `[[<-`: Equivalent to the \code{experiments<-} setter method for +#' * metadata<-: A `list` object of metadata +#' * `[[<-`: Equivalent to the \code{experiments<-} setter method for #' convenience -#' \item `$<-`: A vector to replace the indicated column in \code{colData} -#' \item `drops<-`: Trace \link{ExperimentList} names that have been +#' * `$<-`: A vector to replace the indicated column in `colData` +#' * `drops<-`: Trace [`ExperimentList`] names that have been #' removed -#' } #' -#' @param object,x A \code{MultiAssayExperiment} object +#' @param object,x A `MultiAssayExperiment` object #' -#' @param name A column in \code{colData} +#' @param name A column in `colData` #' #' @param value See details. #' #' @param ... Argument not in use #' -#' @return Accessors: Either a \code{sampleMap}, \code{ExperimentList}, or -#' \code{DataFrame} object -#' @return Setters: A \code{MultiAssayExperiment} object +#' @return Accessors: Either a `sampleMap`, `ExperimentList`, or +#' `DataFrame` object +#' @return Setters: A `MultiAssayExperiment` object #' #' @example inst/scripts/MultiAssayExperiment-methods-Ex.R #' @@ -912,21 +903,19 @@ setMethod("updateObject", "MultiAssayExperiment", #' @section #' coercion: #' Convert a `list` or S4 `List` to a MultiAssayExperiment object using the -#' \link[methods]{as} function. +#' [methods::as] function. #' -#' In the following example, `x` is either a `list` or \linkS4class{List}: +#' In the following example, `x` is either a `list` or [`List`]: #' #' `as(x, "MultiAssayExperiment")` #' #' Convert a `MultiAssayExperiment` to `MAF` class object using the -#' \link[methods]{as} function. +#' [methods::as] function. #' -#' In the following example, `x` is a \linkS4class{MultiAssayExperiment}: +#' In the following example, `x` is a `MultiAssayExperiment`: #' #' `MultiAssayExperimentToMAF(x)` #' -#' @md -#' #' @exportMethod coerce setAs("list", "MultiAssayExperiment", function(from) { diff --git a/R/MultiAssayExperiment-helpers.R b/R/MultiAssayExperiment-helpers.R index 876633a..2f50964 100644 --- a/R/MultiAssayExperiment-helpers.R +++ b/R/MultiAssayExperiment-helpers.R @@ -13,47 +13,45 @@ NULL #' manipulate a MultiAssayExperiment object. `intersectRows` also works #' for `ExperimentList` objects. #' -#' \itemize{ -#' \item complete.cases: Returns a logical vector corresponding to 'colData' +#' * complete.cases: Returns a logical vector corresponding to 'colData' #' rows that have data across all experiments -#' \item isEmpty: Returns a logical `TRUE` value for zero length +#' * isEmpty: Returns a logical `TRUE` value for zero length #' `MultiAssayExperiment` objects -#' \item intersectRows: Takes all common rows across experiments, +#' * intersectRows: Takes all common rows across experiments, #' excludes experiments with empty rownames -#' \item intersectColumns: A wrapper for `complete.cases` to return a +#' * intersectColumns: A wrapper for `complete.cases` to return a #' `MultiAssayExperiment` with only those biological units that have #' measurements across all experiments -#' \item replicated: Identifies, via logical vectors, `colname`s that +#' * replicated: Identifies, via logical vectors, `colname`s that #' originate from a single biological unit within each assay -#' \item replicates: Provides the replicate `colname`s found with +#' * replicates: Provides the replicate `colname`s found with #' the `replicated` function by their name, empty list if none -#' \item anyReplicated: Whether the assay has replicate measurements -#' \item showReplicated: Displays the actual columns that are replicated per -#' assay and biological unit, i.e., \code{primary} value (\code{colData} +#' * anyReplicated: Whether the assay has replicate measurements +#' * showReplicated: Displays the actual columns that are replicated per +#' assay and biological unit, i.e., `primary` value (`colData` #' rowname) in the `sampleMap` -#' \item mergeReplicates: A function that combines replicated / repeated +#' * mergeReplicates: A function that combines replicated / repeated #' measurements across all experiments and is guided by the replicated #' return value -#' \item longFormat: A `MultiAssayExperiment` method that -#' returns a small and skinny \link{DataFrame}. The `colDataCols` +#' * longFormat: A `MultiAssayExperiment` method that +#' returns a small and skinny [`DataFrame`]. The `colDataCols` #' arguments allows the user to append `colData` columns to the data. -#' \item wideFormat: A function to reshape the data in a -#' `MultiAssayExperiment` to a "wide" format \link{DataFrame}. Each row in +#' * wideFormat: A function to reshape the data in a +#' `MultiAssayExperiment` to a "wide" format [`DataFrame`]. Each row in #' the `DataFrame` represents an observation (corresponding to an entry in #' the `colData`). If replicates are present, their data will be appended at #' the end of the corresponding row and will generate additional `NA` data. #' It is recommended to remove or consolidate technical replicates with #' `mergeReplicates`. Optional `colDataCols` can be added when the #' original object is a `MultiAssayExperiment`. -#' \item hasRowRanges: A function that identifies ExperimentList elements -#' that have a \link[=RangedSummarizedExperiment-class]{rowRanges} method -#' \item getWithColData: A convenience function for extracting an assay +#' * hasRowRanges: A function that identifies ExperimentList elements +#' that have a [`rowRanges`][RangedSummarizedExperiment-class] method +#' * getWithColData: A convenience function for extracting an assay #' and associated colData -#' \item renamePrimary: A convenience function to rename the primary +#' * renamePrimary: A convenience function to rename the primary #' biological units as represented in the `rownames(colData)` -#' \item renameColname: A convenience function to rename the colnames +#' * renameColname: A convenience function to rename the colnames #' of a particular assay -#' } #' #' @param x A MultiAssayExperiment or ExperimentList #' @@ -61,8 +59,6 @@ NULL #' #' @return See the itemized list in the description section for details. #' -#' @md -#' #' @examples #' #' example(MultiAssayExperiment) @@ -115,9 +111,9 @@ setGeneric("replicated", function(x) standardGeneric("replicated")) #' @rdname MultiAssayExperiment-helpers #' #' @details The `replicated` function finds replicate measurements in each -#' assay and returns a list of \linkS4class{LogicalList}s. -#' Each element in a single \linkS4class{LogicalList} corresponds to a -#' biological or \emph{primary} unit as in the `sampleMap`. Below is a +#' assay and returns a list of [`LogicalList`]s. +#' Each element in a single [`LogicalList`] corresponds to a +#' biological or _primary_ unit as in the `sampleMap`. Below is a #' small graphic for one particular biological unit in one assay, where the #' logical vector corresponds to the number of measurements/samples in the #' assay: @@ -128,11 +124,11 @@ setGeneric("replicated", function(x) standardGeneric("replicated")) #' Replicated if sum(...) > 1 '-- TRUE TRUE FALSE FALSE #' } #' `anyReplicated` determines if any of the assays have at least one -#' replicate. \emph{Note}. These methods are not available for the -#' \code{ExperimentList} class due to a missing \code{sampleMap} structure +#' replicate. _Note_. These methods are not available for the +#' `ExperimentList` class due to a missing `sampleMap` structure #' (by design). -#' \code{showReplicated} returns a list of \linkS4class{CharacterList}s where -#' each element corresponds to the the biological or \emph{primary} units that +#' `showReplicated` returns a list of [`CharacterList`]s where +#' each element corresponds to the the biological or _primary_ units that #' are replicated in that assay element. The values in the inner list are #' the `colnames` in the assay that are technical replicates. #' @@ -190,9 +186,9 @@ setGeneric("replicates", function(x, ...) standardGeneric("replicates")) #' @rdname MultiAssayExperiment-helpers #' -#' @details The \code{replicates} function (noun) returns the \code{colname}s +#' @details The `replicates` function (noun) returns the `colname`s #' from the `sampleMap` that were identified as replicates. It returns a -#' list of \linkS4class{CharacterList}s for each assay present in the +#' list of [`CharacterList`]s for each assay present in the #' `MultiAssayExperiment` and an inner entry for each biological unit #' that has replicate observations in that assay. #' @@ -225,11 +221,11 @@ setGeneric("mergeReplicates", #' @rdname MultiAssayExperiment-helpers #' #' @details The `mergeReplicates` function is a house-keeping method -#' for a \code{MultiAssayExperiment} where only \code{complete.cases} are +#' for a `MultiAssayExperiment` where only `complete.cases` are #' returned. This by-assay operation averages replicate measurements #' (by default) and columns are aligned by the row order in `colData`. #' Users can provide their own function for merging replicates with the -#' \code{simplify} functional argument. Additional inputs \code{\ldots} are +#' `simplify` functional argument. Additional inputs `...` are #' sent to the 'simplify' function. #' #' @section mergeReplicates: @@ -238,17 +234,17 @@ setGeneric("mergeReplicates", #' biological unit in the `MultiAssayExperiment`. This function will #' return a `MultiAssayExperiment` with merged replicates. Additional #' arguments can be provided to the simplify argument via the ellipsis -#' (\ldots). For example, when replicates "TCGA-B" and "TCGA-A" are found in +#' (`...`). For example, when replicates "TCGA-B" and "TCGA-A" are found in #' the assay, the name of the first appearing replicate is taken (i.e., "B"). #' Note that a typical use case of merging replicates occurs when there are -#' multiple measurements on the \strong{same} sample (within the same assay) +#' multiple measurements on the **same** sample (within the same assay) #' and can therefore be averaged. #' -#' @param replicates A list of \linkS4class{LogicalList}s +#' @param replicates A list of [`LogicalList`]s #' indicating multiple / duplicate entries for each biological unit per assay, -#' see \code{replicated} (default \code{replicated(x)}). +#' see `replicated` (default `replicated(x)`). #' @param simplify A function for merging repeat measurements in experiments -#' as indicated by the \code{replicated} method for \code{MultiAssayExperiment} +#' as indicated by the `replicated` method for `MultiAssayExperiment` #' #' @exportMethod mergeReplicates setMethod("mergeReplicates", "MultiAssayExperiment", @@ -268,7 +264,7 @@ setMethod("mergeReplicates", "MultiAssayExperiment", #' @describeIn ExperimentList Apply the mergeReplicates method on the #' ExperimentList elements #' -#' @param replicates mergeReplicates: A \code{list} or \linkS4class{LogicalList} +#' @param replicates mergeReplicates: A `list` or [`LogicalList`] #' where each element represents a sample and a vector of repeated measurements #' for the sample #' @@ -295,7 +291,7 @@ setMethod("mergeReplicates", "ExperimentList", #' #' @details The `mergeReplicates` "ANY" method consolidates duplicate #' measurements for rectangular data structures, returns object of the same -#' class (endomorphic). The ellipsis or `\ldots` argument allows the +#' class (endomorphic). The ellipsis or `...` argument allows the #' user to provide additional arguments to the `simplify` functional #' argument. setMethod("mergeReplicates", "ANY", @@ -403,34 +399,34 @@ setMethod("mergeReplicates", "ANY", #' @aliases longFormat #' #' @details The `longFormat` "ANY" class method, works with classes such as -#' \link{ExpressionSet} and \link{SummarizedExperiment} as well as `matrix` -#' to provide a consistent long and skinny \link{DataFrame}. +#' [`ExpressionSet`] and [`SummarizedExperiment`] as well as `matrix` +#' to provide a consistent long and skinny [`DataFrame`]. #' #' @section longFormat: -#' The 'longFormat' method takes data from the \code{\link{ExperimentList}} -#' in a \code{\link{MultiAssayExperiment}} and returns a uniform -#' \code{\link{DataFrame}}. The resulting DataFrame has columns indicating +#' The 'longFormat' method takes data from the [`ExperimentList`] +#' in a `MultiAssayExperiment` and returns a uniform +#' `DataFrame`. The resulting DataFrame has columns indicating #' primary, rowname, colname and value. This method can optionally include #' columns of the MultiAssayExperiment colData named by `colDataCols` character -#' vector argument. (\code{MultiAssayExperiment} method only). The \code{i} argument +#' vector argument. (`MultiAssayExperiment` method only). The `i` argument #' allows the user to specify the assay value for the -#' \linkS4class{SummarizedExperiment} assay function's `i` argument. +#' `SummarizedExperiment` assay function's `i` argument. #' #' @param object Any supported class object #' -#' @param colDataCols A \code{character}, \code{logical}, or \code{numeric} +#' @param colDataCols A `character`, `logical`, or `numeric` #' index for `colData` columns to be included #' #' @param i longFormat: The i-th assay in -#' \linkS4class{SummarizedExperiment}-like objects. A vector input is -#' supported in the case that the SummarizedExperiment object(s) has more +#' `SummarizedExperiment`-like objects. A vector input is +#' supported in the case that the `SummarizedExperiment` object(s) has more #' than one assay (default 1L), -#' renameColname: Either a \code{numeric} or \code{character} index +#' renameColname: Either a `numeric` or `character` index #' indicating the assay whose colnames are to be renamed #' -#' @param mode String indicating how \linkS4class{MultiAssayExperiment} +#' @param mode String indicating how `MultiAssayExperiment` #' column-level metadata should be added to the -#' \linkS4class{SummarizedExperiment} `colData`. +#' `SummarizedExperiment` `colData`. #' #' @export longFormat longFormat <- function(object, colDataCols = NULL, i = 1L) { @@ -507,14 +503,14 @@ longFormat <- function(object, colDataCols = NULL, i = 1L) { #' @rdname MultiAssayExperiment-helpers #' #' @section wideFormat: -#' The \code{wideFormat} function returns standardized wide \link{DataFrame} +#' The `wideFormat` function returns standardized wide [`DataFrame`] #' where each row represents a biological unit as in the `colData`. #' Depending on the data and setup, biological units can be patients, tumors, #' specimens, etc. Metadata columns are #' generated based on the names produced in the wide format -#' \linkS4class{DataFrame}. These can be accessed via the -#' \link[=Vector-class]{mcols} function. -#' See the \code{wideFormat} section for description of the \code{colDataCols} and +#' `DataFrame`. These can be accessed via the +#' [`mcols()`][S4Vectors::Vector-class] function. +#' See the `wideFormat` section for description of the `colDataCols` and #' `i` arguments. #' #' @param check.names (logical default TRUE) Column names of the output @@ -610,7 +606,7 @@ wideFormat <- function(object, colDataCols = NULL, check.names = TRUE, #' @section hasRowRanges: #' The `hasRowRanges` method identifies assays with associated ranged #' row data by directly testing the method on the object. The result from the -#' test must be a \linkS4class{GRanges} class object to satisfy the test. +#' test must be a [`GRanges`] class object to satisfy the test. #' #' @export hasRowRanges setGeneric("hasRowRanges", function(x) standardGeneric("hasRowRanges")) @@ -618,8 +614,8 @@ setGeneric("hasRowRanges", function(x) standardGeneric("hasRowRanges")) #' @rdname MultiAssayExperiment-helpers #' #' @details The `hasRowRanges` method identifies assays that support -#' a \link[=RangedSummarizedExperiment-class]{rowRanges} method \emph{and} -#' return a \linkS4class{GRanges} object. +#' a [`rowRanges`][RangedSummarizedExperiment-class] method _and_ +#' return a [`GRanges`] object. setMethod("hasRowRanges", "MultiAssayExperiment", function(x) { hasRowRanges(experiments(x)) }) @@ -632,29 +628,28 @@ setMethod("hasRowRanges", "ExperimentList", function(x) { #' @rdname MultiAssayExperiment-helpers #' -#' @param verbose logical(1) Whether to `suppressMessages` on subsetting +#' @param verbose `logical(1)` Whether to `suppressMessages` on subsetting #' operations in `getWithColData` (default FALSE) #' #' @aliases getWithColData #' #' @section getWithColData: #' The `getWithColData` function allows the user to conveniently extract -#' a particular assay as indicated by the \strong{\code{i}} index argument. It +#' a particular assay as indicated by the **`i`** index argument. It #' will also attempt to provide the -#' \code{\link[=SummarizedExperiment-class]{colData}} along with the -#' extracted object using the `colData<-` replacement +#' [`colData`][SummarizedExperiment::SummarizedExperiment-class] +#' along with the extracted object using the `colData<-` replacement #' method when possible. Typically, this method is available for -#' \linkS4class{SummarizedExperiment} and `RaggedExperiment` -#' classes. +#' [`SummarizedExperiment`] and `RaggedExperiment` classes. #' -#' The setting of \code{mode} determines how the \code{\link{colData}} -#' is added. If \code{mode="append"}, the \linkS4class{MultiAssayExperiment} -#' metadata is appended onto that of the \linkS4class{SummarizedExperiment}. +#' The setting of `mode` determines how the `colData` +#' is added. If `mode="append"`, the `MultiAssayExperiment` +#' metadata is appended onto that of the `SummarizedExperiment`. #' If any fields are duplicated by name, the values in the -#' \linkS4class{SummarizedExperiment} are retained, with a warning emitted if +#' `SummarizedExperiment` are retained, with a warning emitted if #' the values are different. For `mode="replace"`, the -#' \linkS4class{MultiAssayExperiment} metadata replaces that of the -#' \linkS4class{SummarizedExperiment}, while for `mode="none"`, +#' `MultiAssayExperiment` metadata replaces that of the +#' `SummarizedExperiment`, while for `mode="none"`, #' no replacement or appending is performed. #' #' @export getWithColData @@ -790,16 +785,16 @@ renameColname <- function(x, i, value) { #' #' @section splitAssays: #' The `splitAssays` method separates columns in each of the assays based -#' on the \code{hitList} input. The \code{hitList} can be generated using -#' the \code{makeHitList} helper function. To use the \code{makeHitList} +#' on the `hitList` input. The `hitList` can be generated using +#' the `makeHitList` helper function. To use the `makeHitList` #' helper, the user should input a list of patterns that will match on the #' column names of each assay. These matches should be mutually exclusive as #' to avoid repetition of columns across assays. See the examples section. #' -#' @param hitList a named \code{list} or \code{List} of logical vectors that +#' @param hitList a named `list` or `List` of logical vectors that #' indicate groupings in the assays #' -#' @param patternList a named \code{list} or \code{List} of atomic character +#' @param patternList a named `list` or `List` of atomic character #' vectors that are the input to `grepl` for identifying groupings in #' the assays #' diff --git a/R/MultiAssayExperiment-methods.R b/R/MultiAssayExperiment-methods.R index 6886b63..4778a0c 100644 --- a/R/MultiAssayExperiment-methods.R +++ b/R/MultiAssayExperiment-methods.R @@ -56,7 +56,7 @@ NULL ### #' @describeIn ExperimentList Get the dimension names for -#' an \code{ExperimentList} using \code{\linkS4class{CharacterList}} +#' an `ExperimentList` using [`CharacterList`] #' @importFrom methods as #' @export setMethod("dimnames", "ExperimentList", function(x) { @@ -66,8 +66,8 @@ setMethod("dimnames", "ExperimentList", function(x) { ) }) -#' @describeIn ExperimentList Get the column names for an \code{ExperimentList} -#' as a \code{\linkS4class{CharacterList}} slightly more efficiently +#' @describeIn ExperimentList Get the column names for an `ExperimentList` +#' as a [`CharacterList`] slightly more efficiently #' #' @importFrom BiocGenerics colnames #' @inheritParams BiocGenerics::colnames @@ -79,8 +79,8 @@ setMethod("colnames", "ExperimentList", } ) -#' @describeIn ExperimentList Get the row names for an \code{ExperimentList} -#' as a \code{\linkS4class{CharacterList}} slightly more efficiently +#' @describeIn ExperimentList Get the row names for an `ExperimentList` +#' as a [`CharacterList`] slightly more efficiently #' #' @importFrom BiocGenerics rownames #' @export @@ -91,7 +91,7 @@ setMethod("rownames", "ExperimentList", ) #' @describeIn MultiAssayExperiment Get the dimension names -#' for a \code{MultiAssayExperiment} object +#' for a `MultiAssayExperiment` object setMethod("dimnames", "MultiAssayExperiment", function(x) { dimnames(experiments(x)) }) @@ -153,11 +153,11 @@ setReplaceMethod("metadata", c("MultiAssayExperiment", "ANY"), } #' @describeIn MultiAssayExperiment Add a supported data class to the -#' \code{ExperimentList} +#' `ExperimentList` #' -#' @param sampleMap \code{c} method: a \code{sampleMap} \code{list} or -#' \code{DataFrame} to guide merge -#' @param mapFrom Either a \code{logical}, \code{character}, or \code{integer} +#' @param sampleMap `c` method: a `sampleMap` `list` or +#' `DataFrame` to guide merge +#' @param mapFrom Either a `logical`, `character`, or `integer` #' vector indicating the experiment(s) that have an identical colname order as #' the experiment input(s). If using a character input, the name must match #' exactly. @@ -292,19 +292,19 @@ setGeneric( #' @describeIn MultiAssayExperiment Export data from class to a series #' of text files #' -#' @param dir character(1) A directory for saving exported data (default: +#' @param dir `character(1)` A directory for saving exported data (default: #' `tempdir()`) #' -#' @param fmt character(1) or function() Either a format character atomic as +#' @param fmt `character(1)` or function() Either a format character atomic as #' supported by `write.table` either ('csv', or 'tsv') or a function whose #' first two arguments are 'object to save' and 'file location' #' -#' @param ext character(1) A file extension supported by the format argument +#' @param ext `character(1)` A file extension supported by the format argument #' -#' @param match logical(1) Whether to coerce the current object to a +#' @param match `logical(1)` Whether to coerce the current object to a #' 'MatchedAssayExperiment' object (default: FALSE) #' -#' @param verbose logical(1) Whether to print additional information (default +#' @param verbose `logical(1)` Whether to print additional information (default #' TRUE) #' #' @aliases exportClass diff --git a/R/MultiAssayExperimentToMAF.R b/R/MultiAssayExperimentToMAF.R index a5c0bbd..9f57684 100644 --- a/R/MultiAssayExperimentToMAF.R +++ b/R/MultiAssayExperimentToMAF.R @@ -16,15 +16,13 @@ #' #' @param x A `MultiAssayExperiment` object #' -#' @param synAssay character(1) The name of the `ExperimentList` element in the +#' @param synAssay `character(1)` The name of the `ExperimentList` element in the #' `MultiAssayExperiment` that identifies synonymous variant classifications. #' -#' @param nonSynAssay character(1) The name of the `ExperimentList` element in +#' @param nonSynAssay `character(1)` The name of the `ExperimentList` element in #' the `MultiAssayExperiment` that identifies non-synonymous variant #' classifications. #' -#' @md -#' #' @export MultiAssayExperimentToMAF <- function(x, synAssay = "maf_syn", nonSynAssay = "maf_nonSyn") diff --git a/R/assay-methods.R b/R/assay-methods.R index 899275d..60cc5be 100644 --- a/R/assay-methods.R +++ b/R/assay-methods.R @@ -1,5 +1,5 @@ -#' @describeIn ExperimentList Obtain the specified assay with a \code{numeric} -#' or \code{character} reference +#' @describeIn ExperimentList Obtain the specified assay with a `numeric` +#' or `character` reference setMethod("assay", c("ANY", "missing"), function(x, i, withDimnames = TRUE, ...) { if (is(x, "ExpressionSet")) @@ -49,7 +49,7 @@ setReplaceMethod("assays", c("ExperimentList", "ANY"), #' @describeIn ExperimentList Get the assay data from each element in the -#' \link{ExperimentList} +#' [`ExperimentList`] #' @param withDimnames logical (default TRUE) whether to return dimension names #' @aliases assay,ExperimentList,missing-method setMethod("assays", "ExperimentList", function(x, withDimnames = TRUE, ...) { @@ -67,7 +67,7 @@ setMethod("assays", "ExperimentList", function(x, withDimnames = TRUE, ...) { }) #' @rdname ExperimentList-class -#' @param i A scalar \code{character} or \code{integer} index +#' @param i A scalar `character` or `integer` index setMethod("assay", c("ExperimentList", "missing"), function(x, i, withDimnames = TRUE, ...) { if (!length(x)) @@ -105,7 +105,7 @@ setMethod("assay", c("ExperimentList", "character"), } ) -#' @describeIn MultiAssayExperiment Obtain a \code{\link{SimpleList}} of assay +#' @describeIn MultiAssayExperiment Obtain a [`SimpleList`] of assay #' data for all available experiments in the object #' @param withDimnames logical (default TRUE) whether to return dimension names #' included in the object @@ -117,8 +117,9 @@ setMethod("assays", "MultiAssayExperiment", ) #' @describeIn MultiAssayExperiment Convenience function for extracting the -#' assay of the first element (default) in the \code{ExperimentList}. A -#' \code{numeric} or \code{character} index can also be provided +#' assay of the first element (default) in the `ExperimentList`. A `numeric` +#' or `character` index can also be provided +#' #' @exportMethod assay setMethod("assay", c("MultiAssayExperiment", "missing"), function(x, i, withDimnames = TRUE, ...) { diff --git a/R/data.R b/R/data.R index b12359d..a4bb011 100644 --- a/R/data.R +++ b/R/data.R @@ -8,7 +8,7 @@ #' Adrenocortical Carcinoma. Cancer Cell 2016, 29:723-736. #' #' @description -#' A \code{\link{MultiAssayExperiment}} object providing a reduced version of +#' A [`MultiAssayExperiment`] object providing a reduced version of #' the TCGA ACC dataset for all 92 patients. RNA-seq, copy number, and somatic #' mutations are included only for genes whose proteins are included in the #' reverse-phase protein array. The MicroRNA-seq dataset is also included, @@ -18,21 +18,21 @@ #' #' @keywords data #' -#' @format A \code{MultiAssayExperiment} with 5 experiments, providing: +#' @format A `MultiAssayExperiment` with 5 experiments, providing: #' \describe{ -#' \item{RNASeq2GeneNorm}{RNA-seq count data: an \code{ExpressionSet} +#' \item{RNASeq2GeneNorm}{RNA-seq count data: an `ExpressionSet` #' with 198 rows and 79 columns} #' \item{gistict}{Reccurent copy number lesions identified by GISTIC2: -#' a \code{SummarizedExperiment} with 198 rows and 90 columns} -#' \item{RPPAArray}{Reverse Phase Protein Array: an \code{ExpressionSet} +#' a `SummarizedExperiment` with 198 rows and 90 columns} +#' \item{RPPAArray}{Reverse Phase Protein Array: an `ExpressionSet` #' with 33 rows and 46 columns. Rows are indexed by genes, #' but protein annotations are available from #' \code{featureData(miniACC[["RPPAArray"]])}. The source of these #' annotations is noted in \code{abstract(miniACC[["RPPAArray"]])}} -#' \item{Mutations}{Somatic mutations: a \code{matrix} with 223 rows and +#' \item{Mutations}{Somatic mutations: a `matrix` with 223 rows and #' 90 columns. 1 for any kind of non-silent mutation, zero for silent #' (synonymous) or no mutation.} -#' \item{miRNASeqGene}{microRNA sequencing: an \code{ExpressionSet} with +#' \item{miRNASeqGene}{microRNA sequencing: an `ExpressionSet` with #' 471 rows and 80 columns. Rows not having at least 5 counts in at least #' 5 samples were removed.} #' } diff --git a/R/hasAssay.R b/R/hasAssay.R index ee59613..30336d1 100644 --- a/R/hasAssay.R +++ b/R/hasAssay.R @@ -1,13 +1,13 @@ #' Checking assay method for any class #' -#' The \code{hasAssay} function is intended for developers who would like to -#' include new classes into a \code{MultiAssayExperiment} instance. -#' It checks the methods tables of the \code{assay} function for the +#' The `hasAssay` function is intended for developers who would like to +#' include new classes into a `MultiAssayExperiment` instance. +#' It checks the methods tables of the `assay` function for the #' specified class of the argument. #' -#' @param object A \code{MultiAssayExperiment} or \code{named list} +#' @param object A `MultiAssayExperiment` or \code{named list} #' object instance -#' @return A \code{logical} value indicating method availability +#' @return A `logical` value indicating method availability #' #' @examples #' lst <- structure(list(), .Names=character()) diff --git a/R/listToMap.R b/R/listToMap.R index e21cad7..5b1873e 100644 --- a/R/listToMap.R +++ b/R/listToMap.R @@ -1,10 +1,10 @@ -#' @param listmap A named \code{list} object containing \code{DataFrame}s +#' @param listmap A named `list` object containing `DataFrame`s #' with "primary" and "colname" columns #' -#' @param fill logical(1) Whether to fill the map with an empty \code{DataFrame} +#' @param fill `logical(1)` Whether to fill the map with an empty `DataFrame` #' when empty elements are present in the input list #' -#' @return A \linkS4class{DataFrame} class object of names +#' @return A [`DataFrame`] class object of names #' @describeIn mapToList The inverse of the listToMap operation #' @export listToMap listToMap <- function(listmap, fill = TRUE) { diff --git a/R/mapToList.R b/R/mapToList.R index 49d7f4b..1510469 100644 --- a/R/mapToList.R +++ b/R/mapToList.R @@ -1,14 +1,14 @@ #' Convert map from data.frame or DataFrame to list and vice versa #' -#' The \code{mapToList} function provides a convenient way of reordering a -#' \code{data.frame} to a \code{list}. The \code{listToMap} function does the -#' opposite by taking a \code{list} and converting it to \code{DataFrame}. +#' The `mapToList` function provides a convenient way of reordering a +#' \code{data.frame} to a `list`. The `listToMap` function does the +#' opposite by taking a `list` and converting it to `DataFrame`. #' -#' @param dfmap A \code{data.frame} or \code{DataFrame} object with +#' @param dfmap A \code{data.frame} or `DataFrame` object with #' identifiers in the first column #' @param assayCol A character vector of length one indicating the assay #' names column -#' @return A \code{list} object of DataFrames for each assay +#' @return A `list` object of DataFrames for each assay #' @example inst/scripts/listToMap-Ex.R #' @export mapToList mapToList <- function(dfmap, assayCol = "assay") { diff --git a/R/prepMultiAssay.R b/R/prepMultiAssay.R index 3887970..a9435d2 100644 --- a/R/prepMultiAssay.R +++ b/R/prepMultiAssay.R @@ -1,44 +1,44 @@ -#' Prepare a \code{MultiAssayExperiment} instance +#' Prepare a `MultiAssayExperiment` instance #' #' The purpose of this helper function is to faciltate the creation of a -#' \code{\link{MultiAssayExperiment}} object by detecting any inconsistencies -#' with all types of names in either the \code{\link{ExperimentList}}, -#' the \code{colData}, or \code{\link{sampleMap}}. +#' [`MultiAssayExperiment`] object by detecting any inconsistencies +#' with all types of names in either the [`ExperimentList`], +#' the `colData`, or [`sampleMap`]. #' #' @section Checks: -#' The \code{prepMultiAssay} function checks that all columns in the sampleMap -#' are \code{character}. +#' The `prepMultiAssay` function checks that all columns in the sampleMap +#' are `character`. #' #' It checks that all names and lengths match in both the -#' \code{\link{ExperimentList}} and in the unique assay names of the -#' \code{\link{sampleMap}}. +#' [`ExperimentList`] and in the unique assay names of the +#' [`sampleMap`]. #' -#' If \code{\link{ExperimentList}} names and assay names only differ by case +#' If [`ExperimentList`] names and assay names only differ by case #' and are not duplicated, the function will standardize all names to #' lowercase. #' #' If names cannot be matched between the colname column of the -#' \code{\link{sampleMap}} and the colnames of the \code{ExperimentList}, those +#' [`sampleMap`] and the colnames of the `ExperimentList`, those #' unmatched will be dropped and found in the "drops" element of the -#' resulting \code{list}. +#' resulting `list`. #' -#' Names in the "primary" column of the \code{\link{sampleMap}}, will be -#' matched to those in the \code{colData}. Unmatched "primary" column rows will -#' be dropped from the \code{\link{sampleMap}}. Suggestions for name fixes in -#' either the \code{\link{ExperimentList}} or colnames will be made when +#' Names in the "primary" column of the [`sampleMap`], will be +#' matched to those in the `colData`. Unmatched "primary" column rows will +#' be dropped from the [`sampleMap`]. Suggestions for name fixes in +#' either the [`ExperimentList`] or colnames will be made when #' necessary. #' -#' @param ExperimentList A \code{list} of all combined experiments -#' @param colData A \linkS4class{DataFrame} of the phenotype +#' @param ExperimentList A `list` of all combined experiments +#' @param colData A [`DataFrame`] of the phenotype #' data for all participants -#' @param sampleMap A \linkS4class{DataFrame} of sample identifiers, assay +#' @param sampleMap A [`DataFrame`] of sample identifiers, assay #' samples, and assay names -#' @param ... Optional arguments for the \code{MultiAssayExperiment} constructor -#' function such as \code{metadata} and \code{drops}. -#' @return A \code{list} containing all the essential components of a -#' \code{\link{MultiAssayExperiment}} as well as a "drops" metadata element that +#' @param ... Optional arguments for the `MultiAssayExperiment` constructor +#' function such as `metadata` and `drops`. +#' @return A `list` containing all the essential components of a +#' [`MultiAssayExperiment`] as well as a "drops" metadata element that #' indicates non-matched names. The names of the resulting list correspond to -#' the arguments of the \code{MultiAssayExperiment} constructor function. +#' the arguments of the `MultiAssayExperiment` constructor function. #' #' @examples #' ## Run example diff --git a/R/reexports.R b/R/reexports.R index df25bf3..a74144b 100644 --- a/R/reexports.R +++ b/R/reexports.R @@ -7,7 +7,7 @@ #' #' \itemize{ #' \item { -#' S4Vectors: \linkS4class{DataFrame} +#' S4Vectors: [`DataFrame`] #' } #' } #' diff --git a/R/saveHDF5MultiAssayExperiment.R b/R/saveHDF5MultiAssayExperiment.R index f67f758..b44969e 100644 --- a/R/saveHDF5MultiAssayExperiment.R +++ b/R/saveHDF5MultiAssayExperiment.R @@ -79,7 +79,7 @@ #' then saved into the `.h5` file format. This function relies heavily on #' the `HDF5Array` package whose installation is required before use. #' `saveHDF5MultiAssayExpeirment` preserves the classes contained in the -#' \linkS4class{ExperimentList} with the exception of `matrix` which is +#' [`ExperimentList`] with the exception of `matrix` which is #' converted to `HDF5Matrix`. Internal `SummarizedExperiment` assays are #' converted to HDF5-backed assays as in #' `HDF5Array::saveHDF5SummarizedExperiment`. `SummarizedExperiment` @@ -91,10 +91,10 @@ #' #' @inheritParams HDF5Array::saveHDF5SummarizedExperiment #' -#' @param x A \linkS4class{MultiAssayExperiment} object or derivative +#' @param x A [`MultiAssayExperiment`] object or derivative #' #' @param dir The path (as a single string) to the directory where to save the -#' HDF5-based \linkS4class{MultiAssayExperiment} object or to load it from. +#' HDF5-based [`MultiAssayExperiment`] object or to load it from. #' #' When saving, the directory will be created if it doesn't already exist. #' If the directory already exists and no prefix is specified and @@ -116,8 +116,6 @@ #' by `DelayedArray.verbose.block.processing` option. Setting #' `verbose` to `TRUE` or `FALSE` overrides the option. #' -#' @md -#' #' @examples #' #' data("miniACC") diff --git a/R/subsetBy-methods.R b/R/subsetBy-methods.R index 2378d72..64b8421 100644 --- a/R/subsetBy-methods.R +++ b/R/subsetBy-methods.R @@ -56,36 +56,36 @@ NULL #' @title Subsetting a MultiAssayExperiment object #' #' @description A set of functions for extracting and dividing a -#' \code{MultiAssayExperiment} +#' `MultiAssayExperiment` #' -#' @param x A \code{MultiAssayExperiment} or \code{ExperimentList} +#' @param x A `MultiAssayExperiment` or `ExperimentList` #' -#' @param i Either a \code{character}, \code{integer}, \code{logical} or -#' \code{GRanges} object for subsetting by rows +#' @param i Either a `character`, `integer`, `logical` or +#' `GRanges` object for subsetting by rows #' -#' @param j Either a \code{character}, \code{logical}, or \code{numeric} vector -#' for subsetting by \code{colData} rows. See details for more information. +#' @param j Either a `character`, `logical`, or `numeric` vector +#' for subsetting by `colData` rows. See details for more information. #' -#' @param k Either a \code{character}, \code{logical}, or \code{numeric} vector +#' @param k Either a `character`, `logical`, or `numeric` vector #' for subsetting by assays #' #' @param ... Additional arguments passed on to lower level functions. #' #' @param drop logical (default FALSE) whether to drop all empty assay elements -#' in the \code{ExperimentList} +#' in the `ExperimentList` #' #' @aliases [,MultiAssayExperiment,ANY-method subsetByColData subsetByRow #' subsetByColumn subsetByAssay subset subsetBy #' #' @details -#' Subsetting a MultiAssayExperiment by the \strong{j} index can yield a call -#' to either \code{subsetByColData} or \code{subsetByColumn}. For vector inputs, -#' the subset will be applied to the \code{colData} rows. For \code{List}-type +#' Subsetting a MultiAssayExperiment by the **j** index can yield a call +#' to either `subsetByColData` or `subsetByColumn`. For vector inputs, +#' the subset will be applied to the `colData` rows. For `List`-type #' inputs, the List will be applied to each of the elements in the -#' \code{ExperimentList}. +#' `ExperimentList`. #' The order of the subsetting elements in the -#' \code{List} must match that of the \code{ExperimentList} in the -#' \code{MultiAssayExperiment}. +#' `List` must match that of the `ExperimentList` in the +#' `MultiAssayExperiment`. #' #' \itemize{ #' \item subsetBycolData: Select biological units by vector input types @@ -95,7 +95,7 @@ NULL #' } #' #' @return \code{subsetBy*} operations are endomorphic and return either -#' \code{MultiAssayExperiment} or \code{ExperimentList} depending on the +#' `MultiAssayExperiment` or `ExperimentList` depending on the #' input. #' #' @examples @@ -156,8 +156,8 @@ setGeneric("subsetByColumn", function(x, y) standardGeneric("subsetByColumn")) #' @rdname subsetBy #' @export subsetByAssay -#' @param y Any argument used for subsetting, can be a \code{character}, -#' \code{logical}, \code{integer}, \code{list} or \code{List} vector +#' @param y Any argument used for subsetting, can be a `character`, +#' `logical`, `integer`, `list` or `List` vector setGeneric("subsetByAssay", function(x, y) standardGeneric("subsetByAssay")) .subsetCOLS <- function(object, cutter) { diff --git a/R/upsetSamples.R b/R/upsetSamples.R index 051577f..e0e9785 100644 --- a/R/upsetSamples.R +++ b/R/upsetSamples.R @@ -1,20 +1,20 @@ #' Create a generalized Venn Diagram analog for sample membership in multiple -#' assays, using the upset algorithm in \code{UpSetR} +#' assays, using the upset algorithm in `UpSetR` #' #' @param MultiAssayExperiment A `MultiAssayExperiment` object #' -#' @param nsets numeric(1) The number of sets to analyze. If specified, +#' @param nsets `numeric(1)` The number of sets to analyze. If specified, #' `sets` will be ignored. #' -#' @param sets character() A character vector of names in MultiAssayExperiment +#' @param sets `character()` A character vector of names in MultiAssayExperiment #' to use. If specified, `nsets` will be ignored. #' -#' @param ... parameters passed to \code{\link[UpSetR]{upset}} +#' @param ... parameters passed to [`UpSetR::upset`] #' -#' @param check.names logical(1) Whether to munge names as in the +#' @param check.names `logical(1)` Whether to munge names as in the #' `data.frame()` constructor (default FALSE). #' -#' @param nintersects numeric() The number of intersections to plot. By +#' @param nintersects `numeric(1)` The number of intersections to plot. By #' default, all intersections will be plotted. #' #' @param order.by How the intersections in the matrix should be ordered by. @@ -26,8 +26,6 @@ #' many parameters to tune appearance of the result. Assay name handling is #' important for interpretability. #' -#' @md -#' #' @examples #' #' data(miniACC) diff --git a/man/ExperimentList-class.Rd b/man/ExperimentList-class.Rd index 9f4cf41..de4a7c7 100644 --- a/man/ExperimentList-class.Rd +++ b/man/ExperimentList-class.Rd @@ -44,14 +44,14 @@ \S4method{assay}{ExperimentList,character}(x, i, withDimnames = TRUE, ...) } \arguments{ -\item{object, x}{An \code{\linkS4class{ExperimentList}} object} +\item{object, x}{An \code{\link{ExperimentList}} object} \item{do.NULL, prefix}{ See \code{?base::\link[base]{rownames}} for a description of these arguments. } -\item{replicates}{mergeReplicates: A \code{list} or \linkS4class{LogicalList} +\item{replicates}{mergeReplicates: A \code{list} or \code{\link{LogicalList}} where each element represents a sample and a vector of repeated measurements for the sample} @@ -69,31 +69,30 @@ An \code{ExperimentList} class object } \description{ The \code{ExperimentList} class is a container that builds on - the \code{SimpleList} with additional checks for consistency in experiment - names and length. It contains a \code{SimpleList} of experiments with - sample identifiers. One element present per experiment performed. - - Convert from \code{SimpleList} or \code{list} to the multi-experiment data - container. When using the \strong{mergeReplicates} method, additional - arguments are passed to the given \code{simplify} function argument (e.g., - \code{na.rm = TRUE}) +the \code{SimpleList} with additional checks for consistency in experiment +names and length. It contains a \code{SimpleList} of experiments with +sample identifiers. One element present per experiment performed. + +Convert from \code{SimpleList} or \code{list} to the multi-experiment data +container. When using the \strong{mergeReplicates} method, additional +arguments are passed to the given \code{simplify} function argument (e.g., +\code{na.rm = TRUE}) } \section{Methods (by generic)}{ \itemize{ -\item \code{show(ExperimentList)}: Show method for -\code{\linkS4class{ExperimentList}} class +\item \code{show(ExperimentList)}: Show method for \code{\link{ExperimentList}} class \item \code{isEmpty(ExperimentList)}: check for zero length across all experiments \item \code{dimnames(ExperimentList)}: Get the dimension names for -an \code{ExperimentList} using \code{\linkS4class{CharacterList}} +an \code{ExperimentList} using \code{\link{CharacterList}} \item \code{colnames(ExperimentList)}: Get the column names for an \code{ExperimentList} -as a \code{\linkS4class{CharacterList}} slightly more efficiently +as a \code{\link{CharacterList}} slightly more efficiently \item \code{rownames(ExperimentList)}: Get the row names for an \code{ExperimentList} -as a \code{\linkS4class{CharacterList}} slightly more efficiently +as a \code{\link{CharacterList}} slightly more efficiently \item \code{mergeReplicates(ExperimentList)}: Apply the mergeReplicates method on the ExperimentList elements @@ -102,7 +101,7 @@ ExperimentList elements or \code{character} reference \item \code{assays(ExperimentList)}: Get the assay data from each element in the -\link{ExperimentList} +\code{\link{ExperimentList}} }} \section{coercion}{ @@ -111,9 +110,9 @@ Convert a \code{list} or S4 \code{List} to an ExperimentList using the \code{as()} function. In the following example, \code{x} is either a \code{list} or -\linkS4class{List}: +\code{\link{List}}: -\preformatted{ \code{as(x, "ExperimentList")}} +\preformatted{ as(x, "ExperimentList")} } \examples{ diff --git a/man/HDF5MultiAssayExperiment.Rd b/man/HDF5MultiAssayExperiment.Rd index e9e5137..538be2f 100644 --- a/man/HDF5MultiAssayExperiment.Rd +++ b/man/HDF5MultiAssayExperiment.Rd @@ -20,10 +20,10 @@ saveHDF5MultiAssayExperiment( loadHDF5MultiAssayExperiment(dir = "h5_mae", prefix = NULL) } \arguments{ -\item{x}{A \linkS4class{MultiAssayExperiment} object or derivative} +\item{x}{A \code{\link{MultiAssayExperiment}} object or derivative} \item{dir}{The path (as a single string) to the directory where to save the -HDF5-based \linkS4class{MultiAssayExperiment} object or to load it from. +HDF5-based \code{\link{MultiAssayExperiment}} object or to load it from. When saving, the directory will be created if it doesn't already exist. If the directory already exists and no prefix is specified and @@ -75,7 +75,7 @@ functionality to obtain data matrices out of the experiments. These are then saved into the \code{.h5} file format. This function relies heavily on the \code{HDF5Array} package whose installation is required before use. \code{saveHDF5MultiAssayExpeirment} preserves the classes contained in the -\linkS4class{ExperimentList} with the exception of \code{matrix} which is +\code{\link{ExperimentList}} with the exception of \code{matrix} which is converted to \code{HDF5Matrix}. Internal \code{SummarizedExperiment} assays are converted to HDF5-backed assays as in \code{HDF5Array::saveHDF5SummarizedExperiment}. \code{SummarizedExperiment} diff --git a/man/MatchedAssayExperiment-class.Rd b/man/MatchedAssayExperiment-class.Rd index d416301..fbf2cd6 100644 --- a/man/MatchedAssayExperiment-class.Rd +++ b/man/MatchedAssayExperiment-class.Rd @@ -23,7 +23,7 @@ of observations per biological unit are present in all assays. \section{Functions}{ \itemize{ \item \code{MatchedAssayExperiment()}: Construct a -\code{MatchedAssayExperiment} class from \linkS4class{MultiAssayExperiment} +\code{MatchedAssayExperiment} class from \code{\link{MultiAssayExperiment}} }} \examples{ @@ -33,5 +33,5 @@ acc } \seealso{ -\link{MultiAssayExperiment} +\code{\link{MultiAssayExperiment}} } diff --git a/man/MultiAssayExperiment-class.Rd b/man/MultiAssayExperiment-class.Rd index f944217..fe72294 100644 --- a/man/MultiAssayExperiment-class.Rd +++ b/man/MultiAssayExperiment-class.Rd @@ -56,7 +56,7 @@ \item{...}{Additional arguments for supporting functions. See details.} -\item{verbose}{logical(1) Whether to print additional information (default +\item{verbose}{\code{logical(1)} Whether to print additional information (default TRUE)} \item{sampleMap}{\code{c} method: a \code{sampleMap} \code{list} or @@ -67,16 +67,16 @@ vector indicating the experiment(s) that have an identical colname order as the experiment input(s). If using a character input, the name must match exactly.} -\item{dir}{character(1) A directory for saving exported data (default: -`tempdir()`)} +\item{dir}{\code{character(1)} A directory for saving exported data (default: +\code{tempdir()})} -\item{fmt}{character(1) or function() Either a format character atomic as -supported by `write.table` either ('csv', or 'tsv') or a function whose +\item{fmt}{\code{character(1)} or function() Either a format character atomic as +supported by \code{write.table} either ('csv', or 'tsv') or a function whose first two arguments are 'object to save' and 'file location'} -\item{ext}{character(1) A file extension supported by the format argument} +\item{ext}{\code{character(1)} A file extension supported by the format argument} -\item{match}{logical(1) Whether to coerce the current object to a +\item{match}{\code{logical(1)} Whether to coerce the current object to a 'MatchedAssayExperiment' object (default: FALSE)} \item{withDimnames}{logical (default TRUE) whether to return dimension names @@ -91,27 +91,26 @@ A \code{MultiAssayExperiment} object The \code{MultiAssayExperiment} class can be used to manage results of diverse assays on a collection of specimen. Currently, the class can handle assays that are organized instances of -\code{\linkS4class{SummarizedExperiment}}, -\code{\linkS4class{ExpressionSet}}, \code{matrix}, -\code{\link[RaggedExperiment:RaggedExperiment-class]{RaggedExperiment}} -(inherits from \code{\linkS4class{GRangesList}}), and \code{RangedVcfStack}. +\code{\link{SummarizedExperiment}}, +\code{\link{ExpressionSet}}, \code{matrix}, \code{RaggedExperiment} +(inherits from \code{\link{GRangesList}}), and \code{RangedVcfStack}. Create new \code{MultiAssayExperiment} instances with the homonymous constructor, minimally with the argument \code{\link{ExperimentList}}, potentially also with the arguments \code{colData} (see section below) and \code{\link{sampleMap}}. } \details{ -The dots (\code{\ldots}) argument allows the user to specify additional +The dots (\code{...}) argument allows the user to specify additional arguments in several instances. \itemize{ \item subsetting \strong{[}: additional arguments sent to -\link[GenomicRanges:findOverlaps-methods]{findOverlaps}. +\code{\link[GenomicRanges:findOverlaps-methods]{findOverlaps}}. \item mergeReplicates: used to specify arguments for the \code{simplify} functional argument \item assay: may contain withDimnames, which is forwarded to assays \item combining \strong{c}: compatible \code{MultiAssayExperiment} classes -passed on to the \code{\linkS4class{ExperimentList}} constructor, -can be a \code{list}, \code{\linkS4class{List}}, or a series of +passed on to the \code{\link{ExperimentList}} constructor, +can be a \code{list}, \code{\link{List}}, or a series of named arguments. See the examples below. } } @@ -140,8 +139,8 @@ of text files data for all available experiments in the object \item \code{assay(x = MultiAssayExperiment, i = missing)}: Convenience function for extracting the -assay of the first element (default) in the \code{ExperimentList}. A -\code{numeric} or \code{character} index can also be provided +assay of the first element (default) in the \code{ExperimentList}. A \code{numeric} +or \code{character} index can also be provided }} \section{Slots}{ @@ -166,14 +165,14 @@ of samples and participants} The \code{colData} slot is a collection of primary specimen data valid across all experiments. This slot is strictly of class -\code{\linkS4class{DataFrame}} but arguments for the constructor function +\code{\link{DataFrame}} but arguments for the constructor function allow arguments to be of class \code{data.frame} and subsequently coerced. } \section{ExperimentList}{ The \code{\link{ExperimentList}} slot is designed to contain results from -each experiment/assay. It contains a \linkS4class{SimpleList}. +each experiment/assay. It contains a \code{\link{SimpleList}}. } \section{sampleMap}{ @@ -197,16 +196,16 @@ An empty \code{sampleMap} may produce empty experiments if the levels of the \section{coercion}{ Convert a \code{list} or S4 \code{List} to a MultiAssayExperiment object using the -\link[methods]{as} function. +\link[methods:as]{methods::as} function. -In the following example, \code{x} is either a \code{list} or \linkS4class{List}: +In the following example, \code{x} is either a \code{list} or \code{\link{List}}: \code{as(x, "MultiAssayExperiment")} Convert a \code{MultiAssayExperiment} to \code{MAF} class object using the -\link[methods]{as} function. +\link[methods:as]{methods::as} function. -In the following example, \code{x} is a \linkS4class{MultiAssayExperiment}: +In the following example, \code{x} is a \code{MultiAssayExperiment}: \code{MultiAssayExperimentToMAF(x)} } diff --git a/man/MultiAssayExperiment-helpers.Rd b/man/MultiAssayExperiment-helpers.Rd index 97a8ffd..861c8b5 100644 --- a/man/MultiAssayExperiment-helpers.Rd +++ b/man/MultiAssayExperiment-helpers.Rd @@ -100,7 +100,7 @@ makeHitList(x, patternList) \item{x}{A MultiAssayExperiment or ExperimentList} -\item{replicates}{A list of \linkS4class{LogicalList}s +\item{replicates}{A list of \code{\link{LogicalList}}s indicating multiple / duplicate entries for each biological unit per assay, see \code{replicated} (default \code{replicated(x)}).} @@ -113,8 +113,8 @@ as indicated by the \code{replicated} method for \code{MultiAssayExperiment}} index for \code{colData} columns to be included} \item{i}{longFormat: The i-th assay in -\linkS4class{SummarizedExperiment}-like objects. A vector input is -supported in the case that the SummarizedExperiment object(s) has more +\code{SummarizedExperiment}-like objects. A vector input is +supported in the case that the \code{SummarizedExperiment} object(s) has more than one assay (default 1L), renameColname: Either a \code{numeric} or \code{character} index indicating the assay whose colnames are to be renamed} @@ -127,12 +127,12 @@ if necessary} column names. In \code{wideFormat}, experiments and rownames (and when replicate samples are present, colnames) are seperated by this delimiter} -\item{mode}{String indicating how \linkS4class{MultiAssayExperiment} +\item{mode}{String indicating how \code{MultiAssayExperiment} column-level metadata should be added to the -\linkS4class{SummarizedExperiment} \code{colData}.} +\code{SummarizedExperiment} \code{colData}.} -\item{verbose}{logical(1) Whether to `suppressMessages` on subsetting -operations in `getWithColData` (default FALSE)} +\item{verbose}{\code{logical(1)} Whether to \code{suppressMessages} on subsetting +operations in \code{getWithColData} (default FALSE)} \item{value}{renamePrimary: A \code{character} vector of the same length as the existing \code{rownames(colData)} to use for replacement, @@ -153,7 +153,6 @@ See the itemized list in the description section for details. A set of helper functions were created to help clean and manipulate a MultiAssayExperiment object. \code{intersectRows} also works for \code{ExperimentList} objects. - \itemize{ \item complete.cases: Returns a logical vector corresponding to 'colData' rows that have data across all experiments @@ -176,10 +175,10 @@ rowname) in the \code{sampleMap} measurements across all experiments and is guided by the replicated return value \item longFormat: A \code{MultiAssayExperiment} method that -returns a small and skinny \link{DataFrame}. The \code{colDataCols} +returns a small and skinny \code{\link{DataFrame}}. The \code{colDataCols} arguments allows the user to append \code{colData} columns to the data. \item wideFormat: A function to reshape the data in a -\code{MultiAssayExperiment} to a "wide" format \link{DataFrame}. Each row in +\code{MultiAssayExperiment} to a "wide" format \code{\link{DataFrame}}. Each row in the \code{DataFrame} represents an observation (corresponding to an entry in the \code{colData}). If replicates are present, their data will be appended at the end of the corresponding row and will generate additional \code{NA} data. @@ -187,7 +186,7 @@ It is recommended to remove or consolidate technical replicates with \code{mergeReplicates}. Optional \code{colDataCols} can be added when the original object is a \code{MultiAssayExperiment}. \item hasRowRanges: A function that identifies ExperimentList elements -that have a \link[=RangedSummarizedExperiment-class]{rowRanges} method +that have a \code{\link[=RangedSummarizedExperiment-class]{rowRanges}} method \item getWithColData: A convenience function for extracting an assay and associated colData \item renamePrimary: A convenience function to rename the primary @@ -198,8 +197,8 @@ of a particular assay } \details{ The \code{replicated} function finds replicate measurements in each -assay and returns a list of \linkS4class{LogicalList}s. -Each element in a single \linkS4class{LogicalList} corresponds to a +assay and returns a list of \code{\link{LogicalList}}s. +Each element in a single \code{\link{LogicalList}} corresponds to a biological or \emph{primary} unit as in the \code{sampleMap}. Below is a small graphic for one particular biological unit in one assay, where the logical vector corresponds to the number of measurements/samples in the @@ -214,38 +213,38 @@ assay: replicate. \emph{Note}. These methods are not available for the \code{ExperimentList} class due to a missing \code{sampleMap} structure (by design). -\code{showReplicated} returns a list of \linkS4class{CharacterList}s where +\code{showReplicated} returns a list of \code{\link{CharacterList}}s where each element corresponds to the the biological or \emph{primary} units that are replicated in that assay element. The values in the inner list are the \code{colnames} in the assay that are technical replicates. The \code{replicates} function (noun) returns the \code{colname}s - from the \code{sampleMap} that were identified as replicates. It returns a - list of \linkS4class{CharacterList}s for each assay present in the - \code{MultiAssayExperiment} and an inner entry for each biological unit - that has replicate observations in that assay. +from the \code{sampleMap} that were identified as replicates. It returns a +list of \code{\link{CharacterList}}s for each assay present in the +\code{MultiAssayExperiment} and an inner entry for each biological unit +that has replicate observations in that assay. The \code{mergeReplicates} function is a house-keeping method for a \code{MultiAssayExperiment} where only \code{complete.cases} are returned. This by-assay operation averages replicate measurements (by default) and columns are aligned by the row order in \code{colData}. Users can provide their own function for merging replicates with the -\code{simplify} functional argument. Additional inputs \code{\ldots} are +\code{simplify} functional argument. Additional inputs \code{...} are sent to the 'simplify' function. The \code{mergeReplicates} "ANY" method consolidates duplicate measurements for rectangular data structures, returns object of the same -class (endomorphic). The ellipsis or \code{\ldots} argument allows the +class (endomorphic). The ellipsis or \code{...} argument allows the user to provide additional arguments to the \code{simplify} functional argument. The \code{longFormat} "ANY" class method, works with classes such as -\link{ExpressionSet} and \link{SummarizedExperiment} as well as \code{matrix} -to provide a consistent long and skinny \link{DataFrame}. +\code{\link{ExpressionSet}} and \code{\link{SummarizedExperiment}} as well as \code{matrix} +to provide a consistent long and skinny \code{\link{DataFrame}}. The \code{hasRowRanges} method identifies assays that support -a \link[=RangedSummarizedExperiment-class]{rowRanges} method \emph{and} -return a \linkS4class{GRanges} object. +a \code{\link[=RangedSummarizedExperiment-class]{rowRanges}} method \emph{and} +return a \code{\link{GRanges}} object. } \section{mergeReplicates}{ @@ -254,7 +253,7 @@ The \code{mergeReplicates} function makes use of the output from biological unit in the \code{MultiAssayExperiment}. This function will return a \code{MultiAssayExperiment} with merged replicates. Additional arguments can be provided to the simplify argument via the ellipsis -(\ldots). For example, when replicates "TCGA-B" and "TCGA-A" are found in +(\code{...}). For example, when replicates "TCGA-B" and "TCGA-A" are found in the assay, the name of the first appearing replicate is taken (i.e., "B"). Note that a typical use case of merging replicates occurs when there are multiple measurements on the \strong{same} sample (within the same assay) @@ -264,24 +263,24 @@ and can therefore be averaged. \section{longFormat}{ The 'longFormat' method takes data from the \code{\link{ExperimentList}} -in a \code{\link{MultiAssayExperiment}} and returns a uniform -\code{\link{DataFrame}}. The resulting DataFrame has columns indicating +in a \code{MultiAssayExperiment} and returns a uniform +\code{DataFrame}. The resulting DataFrame has columns indicating primary, rowname, colname and value. This method can optionally include columns of the MultiAssayExperiment colData named by \code{colDataCols} character vector argument. (\code{MultiAssayExperiment} method only). The \code{i} argument allows the user to specify the assay value for the -\linkS4class{SummarizedExperiment} assay function's \code{i} argument. +\code{SummarizedExperiment} assay function's \code{i} argument. } \section{wideFormat}{ -The \code{wideFormat} function returns standardized wide \link{DataFrame} +The \code{wideFormat} function returns standardized wide \code{\link{DataFrame}} where each row represents a biological unit as in the \code{colData}. Depending on the data and setup, biological units can be patients, tumors, specimens, etc. Metadata columns are generated based on the names produced in the wide format -\linkS4class{DataFrame}. These can be accessed via the -\link[=Vector-class]{mcols} function. +\code{DataFrame}. These can be accessed via the +\code{\link[S4Vectors:Vector-class]{mcols()}} function. See the \code{wideFormat} section for description of the \code{colDataCols} and \code{i} arguments. } @@ -290,7 +289,7 @@ See the \code{wideFormat} section for description of the \code{colDataCols} and The \code{hasRowRanges} method identifies assays with associated ranged row data by directly testing the method on the object. The result from the -test must be a \linkS4class{GRanges} class object to satisfy the test. +test must be a \code{\link{GRanges}} class object to satisfy the test. } \section{getWithColData}{ @@ -298,20 +297,19 @@ test must be a \linkS4class{GRanges} class object to satisfy the test. The \code{getWithColData} function allows the user to conveniently extract a particular assay as indicated by the \strong{\code{i}} index argument. It will also attempt to provide the -\code{\link[=SummarizedExperiment-class]{colData}} along with the -extracted object using the \code{colData<-} replacement +\code{\link[SummarizedExperiment:SummarizedExperiment-class]{colData}} +along with the extracted object using the \verb{colData<-} replacement method when possible. Typically, this method is available for -\linkS4class{SummarizedExperiment} and \code{RaggedExperiment} -classes. +\code{\link{SummarizedExperiment}} and \code{RaggedExperiment} classes. -The setting of \code{mode} determines how the \code{\link{colData}} -is added. If \code{mode="append"}, the \linkS4class{MultiAssayExperiment} -metadata is appended onto that of the \linkS4class{SummarizedExperiment}. +The setting of \code{mode} determines how the \code{colData} +is added. If \code{mode="append"}, the \code{MultiAssayExperiment} +metadata is appended onto that of the \code{SummarizedExperiment}. If any fields are duplicated by name, the values in the -\linkS4class{SummarizedExperiment} are retained, with a warning emitted if +\code{SummarizedExperiment} are retained, with a warning emitted if the values are different. For \code{mode="replace"}, the -\linkS4class{MultiAssayExperiment} metadata replaces that of the -\linkS4class{SummarizedExperiment}, while for \code{mode="none"}, +\code{MultiAssayExperiment} metadata replaces that of the +\code{SummarizedExperiment}, while for \code{mode="none"}, no replacement or appending is performed. } @@ -321,7 +319,7 @@ The \code{renamePrimary} function allows the user to conveniently change the actual names of the primary biological units as seen in \code{rownames(colData)}. \code{renameColname} allows the user to change the names of a particular assay based on index \code{i}. \code{i} can either be -a single numeric or character value. See \code{colnames<-} method for +a single numeric or character value. See \verb{colnames<-} method for renaming multiple colnames in a \code{MultiAssayExperiment}. } diff --git a/man/MultiAssayExperiment-methods.Rd b/man/MultiAssayExperiment-methods.Rd index b6c610a..14f77c2 100644 --- a/man/MultiAssayExperiment-methods.Rd +++ b/man/MultiAssayExperiment-methods.Rd @@ -91,14 +91,14 @@ either the \code{sampleMap}, the \code{\link{ExperimentList}}, \section{Accessors}{ Eponymous names for accessing \code{MultiAssayExperiment} slots with the -exception of the \link{ExperimentList} accessor named \code{experiments}. +exception of the \code{\link{ExperimentList}} accessor named \code{experiments}. \itemize{ - \item colData: Access the \code{colData} slot - \item sampleMap: Access the \code{sampleMap} slot - \item experiments: Access the \link{ExperimentList} slot - \item `[[`: Access the \link{ExperimentList} slot - \item `$`: Access a column in \code{colData} - \item `drops`: Get a vector of dropped \link{ExperimentList} names +\item colData: Access the \code{colData} slot +\item sampleMap: Access the \code{sampleMap} slot +\item experiments: Access the \code{\link{ExperimentList}} slot +\item \code{[[}: Access the \code{\link{ExperimentList}} slot +\item \code{$}: Access a column in \code{colData} +\item \code{drops}: Get a vector of dropped \code{\link{ExperimentList}} names } } @@ -106,18 +106,18 @@ exception of the \link{ExperimentList} accessor named \code{experiments}. Setter method values (i.e., '\code{function(x) <- value}'): \itemize{ - \item experiments<-: An \code{\link{ExperimentList}} object - containing experiment data of supported classes - \item sampleMap<-: A \code{\link{DataFrame}} object relating - samples to biological units and assays - \item colData<-: A \code{\link{DataFrame}} object describing the - biological units - \item metadata<-: A \code{list} object of metadata - \item `[[<-`: Equivalent to the \code{experiments<-} setter method for - convenience - \item `$<-`: A vector to replace the indicated column in \code{colData} - \item `drops<-`: Trace \link{ExperimentList} names that have been - removed +\item experiments<-: An \code{\link{ExperimentList}} object +containing experiment data of supported classes +\item sampleMap<-: A \code{\link{DataFrame}} object relating +samples to biological units and assays +\item colData<-: A \code{\link{DataFrame}} object describing the +biological units +\item metadata<-: A \code{list} object of metadata +\item \verb{[[<-}: Equivalent to the \code{experiments<-} setter method for +convenience +\item \verb{$<-}: A vector to replace the indicated column in \code{colData} +\item \verb{drops<-}: Trace \code{\link{ExperimentList}} names that have been +removed } } diff --git a/man/MultiAssayExperiment.Rd b/man/MultiAssayExperiment.Rd index d950919..4610c78 100644 --- a/man/MultiAssayExperiment.Rd +++ b/man/MultiAssayExperiment.Rd @@ -15,10 +15,10 @@ MultiAssayExperiment( ) } \arguments{ -\item{experiments}{A \code{list} or \link{ExperimentList} of all +\item{experiments}{A \code{list} or \code{\link{ExperimentList}} of all combined experiments} -\item{colData}{A \code{\linkS4class{DataFrame}} or \code{data.frame} of +\item{colData}{A \code{\link{DataFrame}} or \code{data.frame} of characteristics for all biological units} \item{sampleMap}{A \code{DataFrame} or \code{data.frame} of assay names, @@ -35,7 +35,7 @@ A \code{MultiAssayExperiment} object that can store experiment and phenotype data } \description{ -The constructor function for the \link{MultiAssayExperiment-class} combines +The constructor function for the \linkS4class{MultiAssayExperiment} combines multiple data elements from the different hierarchies of data (study, experiments, and samples). It can create instances where neither a \code{sampleMap} or a \code{colData} set is provided. Please see the @@ -43,36 +43,36 @@ MultiAssayExperiment API documentation for more information. } \section{colData}{ -The `colData` input can be either `DataFrame` or `data.frame` with -subsequent coercion to DataFrame. The rownames in the `colData` must match +The \code{colData} input can be either \code{DataFrame} or \code{data.frame} with +subsequent coercion to DataFrame. The rownames in the \code{colData} must match the colnames in the experiments if no sampleMap is provided. } \section{experiments}{ -The `experiments` input can be of class \linkS4class{SimpleList} or `list`. +The \code{experiments} input can be of class \code{\link{SimpleList}} or \code{list}. This input becomes the \code{\link{ExperimentList}}. Each element of the -input `list` or `List` must be named, rectangular with two dimensions, and -have `dimnames`. +input \code{list} or \code{List} must be named, rectangular with two dimensions, and +have \code{dimnames}. } \section{sampleMap}{ -The \code{\link{sampleMap}} can either be input as `DataFrame` or -`data.frame` with eventual coercion to `DataFrame`. The `sampleMap` relates +The \code{\link{sampleMap}} can either be input as \code{DataFrame} or +\code{data.frame} with eventual coercion to \code{DataFrame}. The \code{sampleMap} relates biological units and biological measurements within each assay. Each row in -the `sampleMap` is a single such link. The standard column names of the -`sampleMap` are "assay", "primary", and "colname". Note that the "assay" +the \code{sampleMap} is a single such link. The standard column names of the +\code{sampleMap} are "assay", "primary", and "colname". Note that the "assay" column is a factor corresponding to the names of each experiment in the -`ExperimentList`. In the case where these names do not match between the -`sampleMap` and the experiments, the documented experiments in the -`sampleMap` take precedence and experiments are dropped by the harmonization -procedure. The constructor function will generate a `sampleMap` in the case +\code{ExperimentList}. In the case where these names do not match between the +\code{sampleMap} and the experiments, the documented experiments in the +\code{sampleMap} take precedence and experiments are dropped by the harmonization +procedure. The constructor function will generate a \code{sampleMap} in the case where it is not provided and this method may be a 'safer' alternative for -creating the `MultiAssayExperiment` (so long as the rownames are identical -in the `colData`, if provided). An empty `sampleMap` may produce empty -experiments if the levels of the "assay" factor in the `sampleMap` do not -match the names in the `ExperimentList`. +creating the \code{MultiAssayExperiment} (so long as the rownames are identical +in the \code{colData}, if provided). An empty \code{sampleMap} may produce empty +experiments if the levels of the "assay" factor in the \code{sampleMap} do not +match the names in the \code{ExperimentList}. } \examples{ @@ -115,5 +115,5 @@ mae <- MultiAssayExperiment(experiments = ExpList, colData = colDat, sampleMap = sampMap) } \seealso{ -\link{MultiAssayExperiment-class} +\linkS4class{MultiAssayExperiment} } diff --git a/man/MultiAssayExperimentToMAF.Rd b/man/MultiAssayExperimentToMAF.Rd index 0960d99..27705ef 100644 --- a/man/MultiAssayExperimentToMAF.Rd +++ b/man/MultiAssayExperimentToMAF.Rd @@ -9,10 +9,10 @@ MultiAssayExperimentToMAF(x, synAssay = "maf_syn", nonSynAssay = "maf_nonSyn") \arguments{ \item{x}{A \code{MultiAssayExperiment} object} -\item{synAssay}{character(1) The name of the \code{ExperimentList} element in the +\item{synAssay}{\code{character(1)} The name of the \code{ExperimentList} element in the \code{MultiAssayExperiment} that identifies synonymous variant classifications.} -\item{nonSynAssay}{character(1) The name of the \code{ExperimentList} element in +\item{nonSynAssay}{\code{character(1)} The name of the \code{ExperimentList} element in the \code{MultiAssayExperiment} that identifies non-synonymous variant classifications.} } diff --git a/man/mapToList.Rd b/man/mapToList.Rd index ccdfa1e..1363110 100644 --- a/man/mapToList.Rd +++ b/man/mapToList.Rd @@ -13,7 +13,7 @@ mapToList(dfmap, assayCol = "assay") \item{listmap}{A named \code{list} object containing \code{DataFrame}s with "primary" and "colname" columns} -\item{fill}{logical(1) Whether to fill the map with an empty \code{DataFrame} +\item{fill}{\code{logical(1)} Whether to fill the map with an empty \code{DataFrame} when empty elements are present in the input list} \item{dfmap}{A \code{data.frame} or \code{DataFrame} object with @@ -23,7 +23,7 @@ identifiers in the first column} names column} } \value{ -A \linkS4class{DataFrame} class object of names +A \code{\link{DataFrame}} class object of names A \code{list} object of DataFrames for each assay } diff --git a/man/miniACC.Rd b/man/miniACC.Rd index 130c856..3339aaf 100644 --- a/man/miniACC.Rd +++ b/man/miniACC.Rd @@ -7,21 +7,21 @@ \format{ A \code{MultiAssayExperiment} with 5 experiments, providing: \describe{ - \item{RNASeq2GeneNorm}{RNA-seq count data: an \code{ExpressionSet} - with 198 rows and 79 columns} - \item{gistict}{Reccurent copy number lesions identified by GISTIC2: - a \code{SummarizedExperiment} with 198 rows and 90 columns} - \item{RPPAArray}{Reverse Phase Protein Array: an \code{ExpressionSet} - with 33 rows and 46 columns. Rows are indexed by genes, - but protein annotations are available from - \code{featureData(miniACC[["RPPAArray"]])}. The source of these - annotations is noted in \code{abstract(miniACC[["RPPAArray"]])}} - \item{Mutations}{Somatic mutations: a \code{matrix} with 223 rows and - 90 columns. 1 for any kind of non-silent mutation, zero for silent - (synonymous) or no mutation.} - \item{miRNASeqGene}{microRNA sequencing: an \code{ExpressionSet} with - 471 rows and 80 columns. Rows not having at least 5 counts in at least - 5 samples were removed.} +\item{RNASeq2GeneNorm}{RNA-seq count data: an \code{ExpressionSet} +with 198 rows and 79 columns} +\item{gistict}{Reccurent copy number lesions identified by GISTIC2: +a \code{SummarizedExperiment} with 198 rows and 90 columns} +\item{RPPAArray}{Reverse Phase Protein Array: an \code{ExpressionSet} +with 33 rows and 46 columns. Rows are indexed by genes, +but protein annotations are available from +\code{featureData(miniACC[["RPPAArray"]])}. The source of these +annotations is noted in \code{abstract(miniACC[["RPPAArray"]])}} +\item{Mutations}{Somatic mutations: a \code{matrix} with 223 rows and +90 columns. 1 for any kind of non-silent mutation, zero for silent +(synonymous) or no mutation.} +\item{miRNASeqGene}{microRNA sequencing: an \code{ExpressionSet} with +471 rows and 80 columns. Rows not having at least 5 counts in at least +5 samples were removed.} } } \source{ @@ -57,7 +57,7 @@ wideFormat( } \references{ -Zheng S *et al.*: Comprehensive Pan-Genomic Characterization of +Zheng S \emph{et al.}: Comprehensive Pan-Genomic Characterization of Adrenocortical Carcinoma. Cancer Cell 2016, 29:723-736. } \author{ diff --git a/man/prepMultiAssay.Rd b/man/prepMultiAssay.Rd index b05226b..6bf71e3 100644 --- a/man/prepMultiAssay.Rd +++ b/man/prepMultiAssay.Rd @@ -9,10 +9,10 @@ prepMultiAssay(ExperimentList, colData, sampleMap, ...) \arguments{ \item{ExperimentList}{A \code{list} of all combined experiments} -\item{colData}{A \linkS4class{DataFrame} of the phenotype +\item{colData}{A \code{\link{DataFrame}} of the phenotype data for all participants} -\item{sampleMap}{A \linkS4class{DataFrame} of sample identifiers, assay +\item{sampleMap}{A \code{\link{DataFrame}} of sample identifiers, assay samples, and assay names} \item{...}{Optional arguments for the \code{MultiAssayExperiment} constructor diff --git a/man/reexports.Rd b/man/reexports.Rd index ceac13d..41e14c8 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -9,9 +9,9 @@ These objects are imported from other packages. Click on the function name to see their documentation. \itemize{ - \item { - S4Vectors: \linkS4class{DataFrame} - } +\item { +S4Vectors: \code{\link{DataFrame}} +} } } \examples{ diff --git a/man/upsetSamples.Rd b/man/upsetSamples.Rd index c3683b9..95960c1 100644 --- a/man/upsetSamples.Rd +++ b/man/upsetSamples.Rd @@ -18,22 +18,22 @@ upsetSamples( \arguments{ \item{MultiAssayExperiment}{A \code{MultiAssayExperiment} object} -\item{nsets}{numeric(1) The number of sets to analyze. If specified, +\item{nsets}{\code{numeric(1)} The number of sets to analyze. If specified, \code{sets} will be ignored.} -\item{sets}{character() A character vector of names in MultiAssayExperiment +\item{sets}{\code{character()} A character vector of names in MultiAssayExperiment to use. If specified, \code{nsets} will be ignored.} -\item{nintersects}{numeric() The number of intersections to plot. By +\item{nintersects}{\code{numeric(1)} The number of intersections to plot. By default, all intersections will be plotted.} \item{order.by}{How the intersections in the matrix should be ordered by. Options include frequency (entered as "freq"), degree, or both in any order.} -\item{check.names}{logical(1) Whether to munge names as in the +\item{check.names}{\code{logical(1)} Whether to munge names as in the \code{data.frame()} constructor (default FALSE).} -\item{...}{parameters passed to \code{\link[UpSetR]{upset}}} +\item{...}{parameters passed to \code{\link[UpSetR:upset]{UpSetR::upset}}} } \value{ Produces a visualization of set intersections using the UpSet matrix