From d0d045eb7ab0b7400c3d53cc20e5f5f0eeb3ec5d Mon Sep 17 00:00:00 2001 From: Gavin Rhys Lloyd Date: Thu, 6 Jul 2023 18:19:36 +0100 Subject: [PATCH] fix documentation - remove use of square brackets as this now gets interpreted as markdown - generate filter_by_name documentation from object, like we do for all other objects --- R/filter_by_name_class.R | 24 ++++++++---------------- R/fold_change_class.R | 4 ++-- man/filter_by_name.Rd | 20 +++++++++----------- man/fold_change.Rd | 2 +- man/fold_change_int.Rd | 2 +- 5 files changed, 21 insertions(+), 31 deletions(-) diff --git a/R/filter_by_name_class.R b/R/filter_by_name_class.R index 435b536..f137cbf 100644 --- a/R/filter_by_name_class.R +++ b/R/filter_by_name_class.R @@ -1,22 +1,8 @@ -#' Filter by name -#' -#' A filter to subsample a DatasetExperiment object based on sample or feature name, -#' id, row/column index or using a vector of TRUE/FALSE. -#' -#' @param mode "include" or ["exclude"] to subsample a DatasetExperiment by including or -#' excluding samples/features based on the provided labels -#' @param dimension ["sample"] or "variable" to filter by sample or feature -#' labels -#' @param names the sample/feature identifiers to filter by. Can provide column -#' names, column indices or logical. -#' +#' @eval get_description('filter_by_name') #' @examples #' D = MTBLS79_DatasetExperiment() #' M = filter_by_name(mode='exclude',dimension='variable',names=c(1,2,3)) #' M = model_apply(M,D) -#' -#' @param ... additional slots and values passed to struct_class -#' @return struct object #' @export filter_by_name filter_by_name = function(mode='exclude',dimension='sample',names,...) { out=struct::new_struct('filter_by_name', @@ -36,7 +22,13 @@ filter_by_name = function(mode='exclude',dimension='sample',names,...) { names='entity', filtered='DatasetExperiment' ), - prototype=list(type = 'filter', + prototype=list( + name = 'Filter by name', + description = paste0( + 'Filter samples/variables by row/column name, index or ', + 'logicals.'), + + type = 'filter', predicted = 'filtered', .params=c('mode','dimension','names'), .outputs=c('filtered'), diff --git a/R/fold_change_class.R b/R/fold_change_class.R index 79aec01..736dfc1 100644 --- a/R/fold_change_class.R +++ b/R/fold_change_class.R @@ -111,12 +111,12 @@ fold_change = function( 'transformed space before being transformed back to the ', 'original space.'), "median" = paste0('The group medians and the method described ', - 'by Price and Bonett[1] is used to ', + 'by Price and Bonett is used to ', 'estimate confidence intervals. For paired data standard ', 'error of the median is used to estimate confidence ', 'intervals from the median fold change of all pairs.'), "mean" = paste0('The group means and the method described by ', - 'Price and Bonnet[1] is used to estimate confidence ', + 'Price and Bonnet is used to estimate confidence ', 'intervals. For paired data standard error of the mean is ', 'used to estimate confidence intervals from the mean ', 'fold change of all pairs.') diff --git a/man/filter_by_name.Rd b/man/filter_by_name.Rd index 07ac90d..a43588a 100644 --- a/man/filter_by_name.Rd +++ b/man/filter_by_name.Rd @@ -7,27 +7,25 @@ filter_by_name(mode = "exclude", dimension = "sample", names, ...) } \arguments{ -\item{mode}{"include" or \link{"exclude"} to subsample a DatasetExperiment by including or -excluding samples/features based on the provided labels} +\item{mode}{(character) The filtering mode controls whether samples/features are mode="included" or mode="excluded" based on their name. The default is \code{"exclude"}.} -\item{dimension}{\link{"sample"} or "variable" to filter by sample or feature -labels} +\item{dimension}{(character) The filtering dimensions controls whether dimension="sample" or dimension="variable" are filtered based on their name. The default is \code{"sample"}.} -\item{names}{the sample/feature identifiers to filter by. Can provide column -names, column indices or logical.} +\item{names}{(character, numeric, logical) The name of features/samples to be filtered. Must be an exact match. Can also provide indexes (numeric) or logical.} -\item{...}{additional slots and values passed to struct_class} +\item{...}{Additional slots and values passed to \code{struct_class}.} } \value{ -struct object +A \code{filter_by_name} object with the following \code{output} slots: +\tabular{ll}{ +\code{filtered} \tab (DatasetExperiment) \cr +} } \description{ -A filter to subsample a DatasetExperiment object based on sample or feature name, -id, row/column index or using a vector of TRUE/FALSE. +Filter samples/variables by row/column name, index or logicals. } \examples{ D = MTBLS79_DatasetExperiment() M = filter_by_name(mode='exclude',dimension='variable',names=c(1,2,3)) M = model_apply(M,D) - } diff --git a/man/fold_change.Rd b/man/fold_change.Rd index 36d9a88..9338393 100644 --- a/man/fold_change.Rd +++ b/man/fold_change.Rd @@ -26,7 +26,7 @@ fold_change( \item{control_group}{(character) The level name of the group used in the denominator (where possible) when computing fold change. The default is \code{character(0)}.} -\item{method}{(character) Fold change method. Allowed values are limited to the following: \itemize{\item{\code{"geometric"}: A log transform is applied before using group means to calculate fold change. In the non-tranformedspace this is equivalent to using geometric group means. Confidence intervals for independant and paired sampling are estimated using standard error of the mean in log transformed space before being transformed back to the original space.}\item{\code{"median"}: The group medians and the method described by Price and Bonett\link{1} is used to estimate confidence intervals. For paired data standard error of the median is used to estimate confidence intervals from the median fold change of all pairs.}\item{\code{"mean"}: The group means and the method described by Price and Bonnet\link{1} is used to estimate confidence intervals. For paired data standard error of the mean is used to estimate confidence intervals from the mean fold change of all pairs.}} The default is \code{"geometric"}.} +\item{method}{(character) Fold change method. Allowed values are limited to the following: \itemize{\item{\code{"geometric"}: A log transform is applied before using group means to calculate fold change. In the non-tranformedspace this is equivalent to using geometric group means. Confidence intervals for independant and paired sampling are estimated using standard error of the mean in log transformed space before being transformed back to the original space.}\item{\code{"median"}: The group medians and the method described by Price and Bonett is used to estimate confidence intervals. For paired data standard error of the median is used to estimate confidence intervals from the median fold change of all pairs.}\item{\code{"mean"}: The group means and the method described by Price and Bonnet is used to estimate confidence intervals. For paired data standard error of the mean is used to estimate confidence intervals from the mean fold change of all pairs.}} The default is \code{"geometric"}.} \item{conf_level}{(numeric) The confidence level of the interval. The default is \code{0.95}.} diff --git a/man/fold_change_int.Rd b/man/fold_change_int.Rd index 4dff484..081deaf 100644 --- a/man/fold_change_int.Rd +++ b/man/fold_change_int.Rd @@ -20,7 +20,7 @@ fold_change_int( \item{control_group}{(character) The level names of the groups used in the denominator (where possible) when computing fold change. One level for each factor, assumed to be in the same order as factor_name. The default is \code{character(0)}.} -\item{method}{(character) Fold change method. Allowed values are limited to the following: \itemize{\item{\code{"geometric"}: A log transform is applied before using group means to calculate fold change. In the non-tranformedspace this is equivalent to using geometric group means. Confidence intervals for independant and paired sampling are estimated using standard error of the mean in log transformed space before being transformed back to the original space.}\item{\code{"median"}: The group medians and the method described by Price and Bonett\link{1} is used to estimate confidence intervals. For paired data standard error of the median is used to estimate confidence intervals from the median fold change of all pairs.}\item{\code{"mean"}: The group means and the method described by Price and Bonnet\link{1} is used to estimate confidence intervals. For paired data standard error of the mean is used to estimate confidence intervals from the mean fold change of all pairs.}} The default is \code{"geometric"}.} +\item{method}{(character) Fold change method. Allowed values are limited to the following: \itemize{\item{\code{"geometric"}: A log transform is applied before using group means to calculate fold change. In the non-tranformedspace this is equivalent to using geometric group means. Confidence intervals for independant and paired sampling are estimated using standard error of the mean in log transformed space before being transformed back to the original space.}\item{\code{"median"}: The group medians and the method described by Price and Bonett is used to estimate confidence intervals. For paired data standard error of the median is used to estimate confidence intervals from the median fold change of all pairs.}\item{\code{"mean"}: The group means and the method described by Price and Bonnet is used to estimate confidence intervals. For paired data standard error of the mean is used to estimate confidence intervals from the mean fold change of all pairs.}} The default is \code{"geometric"}.} \item{conf_level}{(numeric) The confidence level of the interval. The default is \code{0.95}.}