diff --git a/R/LFQDataSummariser.R b/R/LFQDataSummariser.R index 834b3de2a..7cd7210ff 100644 --- a/R/LFQDataSummariser.R +++ b/R/LFQDataSummariser.R @@ -16,6 +16,7 @@ #' sum$hierarchy_counts_sample("wide") #' sum$hierarchy_counts_sample("long") #' sum$plot_hierarchy_counts_sample() +#' sum$plot_hierarchy_counts_sample() #' tmp <- sum$interaction_missing_stats() #' #' sum$missingness_per_group() @@ -44,16 +45,20 @@ LFQDataSummariser <- R6::R6Class( #' @description #' number of elements at each level in every sample #' @param value wide - wide format, long - long format, plot - ggplot - hierarchy_counts_sample = function(value=c("wide","long")){ + #' @param nr_children get summary for 1,2 or more number of children + hierarchy_counts_sample = function(value=c("wide","long"), nr_children = 1){ value <- match.arg(value) - fun <- prolfqua::hierarchy_counts_sample(self$lfq$data, self$lfq$config) + fun <- prolfqua::hierarchy_counts_sample(self$lfq$data, self$lfq$config, + nr_children = nr_children) return(fun(value)) }, #' @description #' barplot showing number of elements at each level in every sample #' @param value wide - wide format, long - long format, plot - ggplot - plot_hierarchy_counts_sample = function(){ - fun <- prolfqua::hierarchy_counts_sample(self$lfq$data, self$lfq$config) + #' @param nr_children get summary for 1,2 or more number of children + plot_hierarchy_counts_sample = function(nr_children = 1){ + fun <- prolfqua::hierarchy_counts_sample(self$lfq$data, self$lfq$config, + nr_children = nr_children) return(fun("plot")) }, #' @description diff --git a/R/tidyMS_R6_TransitionCorrelations.R b/R/tidyMS_R6_TransitionCorrelations.R index 005adb374..5efc36318 100644 --- a/R/tidyMS_R6_TransitionCorrelations.R +++ b/R/tidyMS_R6_TransitionCorrelations.R @@ -226,7 +226,7 @@ tidy_to_wide <- function(data, #' testthat::expect_equal(nrow(res$rowdata), nrow(res$data)) #' testthat::expect_equal(ncol(res$data) - ncol(res$rowdata) , nrow(res$annotation)) #' res <- tidy_to_wide_config(data, config, as.matrix = TRUE) -#' stopifnot(all(dim(res$data) == c(28, 12)) +#' stopifnot(all(dim(res$data) == c(28, 12))) #' stopifnot(all(dim(res$annotation) == c(12, 4))) #' stopifnot(all(dim(res$rowdata) == c(28, 3))) #' diff --git a/man/LFQDataSummariser.Rd b/man/LFQDataSummariser.Rd index 25d6628cc..e76024e4c 100644 --- a/man/LFQDataSummariser.Rd +++ b/man/LFQDataSummariser.Rd @@ -20,6 +20,7 @@ sum$hierarchy_counts() sum$hierarchy_counts_sample("wide") sum$hierarchy_counts_sample("long") sum$plot_hierarchy_counts_sample() +sum$plot_hierarchy_counts_sample() tmp <- sum$interaction_missing_stats() sum$missingness_per_group() @@ -98,13 +99,18 @@ summarize hierarchy \subsection{Method \code{hierarchy_counts_sample()}}{ number of elements at each level in every sample \subsection{Usage}{ -\if{html}{\out{