From 505f874c9a081625dc87eeaaf62cdf152554b8d4 Mon Sep 17 00:00:00 2001 From: wolski Date: Tue, 3 Sep 2024 15:50:11 +0200 Subject: [PATCH 1/3] fix examples --- DESCRIPTION | 2 +- R/AnalysisConfiguration.R | 2 +- man/table_factors_size.Rd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5c6d553b..557441a7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -67,7 +67,7 @@ Suggests: SummarizedExperiment, proDA, vsn -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Roxygen: list(r6 = TRUE) Depends: R (>= 4.1) diff --git a/R/AnalysisConfiguration.R b/R/AnalysisConfiguration.R index d1c3ff5f..fd57a0f9 100644 --- a/R/AnalysisConfiguration.R +++ b/R/AnalysisConfiguration.R @@ -378,7 +378,7 @@ table_factors <- function(pdata, configuration){ #' #' #' xx <- table_factors_size(istar$data,istar$config ) -#' stopifnot(all(xt$n == 4)) +#' stopifnot(all(xx$n == 4)) #' table_factors_size <- function(pdata, configuration){ xx <- table_factors(pdata, configuration) diff --git a/man/table_factors_size.Rd b/man/table_factors_size.Rd index 539e5c8e..f2a461b7 100644 --- a/man/table_factors_size.Rd +++ b/man/table_factors_size.Rd @@ -21,7 +21,7 @@ istar <- sim_lfq_data_peptide_config() xx <- table_factors_size(istar$data,istar$config ) -stopifnot(all(xt$n == 4)) +stopifnot(all(xx$n == 4)) } \seealso{ From dcb1333c96d0c7f755324e0db6876f355e041632 Mon Sep 17 00:00:00 2001 From: wolski Date: Tue, 3 Sep 2024 22:13:33 +0200 Subject: [PATCH 2/3] fixo --- R/LFQDataPlotter.R | 2 +- R/utilities.R | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/R/LFQDataPlotter.R b/R/LFQDataPlotter.R index d75e2133..4350e2bc 100644 --- a/R/LFQDataPlotter.R +++ b/R/LFQDataPlotter.R @@ -12,13 +12,13 @@ #' istar$data, #' istar$config) #' #LFQDataPlotter$debug("boxplots") +#' LFQDataPlotter$debug("pairs_smooth") #' lfqplotter <- lfqdata$get_Plotter() #' #' stopifnot(class(lfqplotter$heatmap()) == "pheatmap") #' stopifnot(class(lfqplotter$heatmap_cor()) == "pheatmap") #' stopifnot("ggplot" %in% class(lfqplotter$pca())) #' stopifnot("plotly" %in% class(lfqplotter$pca_plotly())) -#' #' tmp <- lfqplotter$boxplots() #' stopifnot("ggplot" %in% class(tmp$boxplot[[1]])) #' stopifnot("ggplot" %in% class(lfqplotter$missigness_histogram())) diff --git a/R/utilities.R b/R/utilities.R index 7f5db0a1..9dd74eb0 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -460,11 +460,6 @@ panel_cor <- function(x, y, digits = 2, ...) #' pairs_smooth(tmp,log="xy",main="small data", legend=TRUE) #' @seealso also \code{\link{pairs}} pairs_smooth <- function(data, legend = FALSE, ...) { - while (nrow(na.omit(data)) < 100) { - non_na_counts <- apply(data, 2, function(x) sum(!is.na(x))) - min_col <- which.min(non_na_counts) - data <- data[, -min_col, drop = FALSE] - } pairs( data, From 019b0b55bfad3e62e56b3034a48b19ee1975c4e2 Mon Sep 17 00:00:00 2001 From: wolski Date: Tue, 3 Sep 2024 22:33:32 +0200 Subject: [PATCH 3/3] temp --- R/utilities.R | 6 +++++- man/LFQDataPlotter.Rd | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/utilities.R b/R/utilities.R index 9dd74eb0..502615fb 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -460,7 +460,11 @@ panel_cor <- function(x, y, digits = 2, ...) #' pairs_smooth(tmp,log="xy",main="small data", legend=TRUE) #' @seealso also \code{\link{pairs}} pairs_smooth <- function(data, legend = FALSE, ...) { - + non_na_counts <- apply(data, 2, function(x) sum(!is.na(x))) + min_col <- which(non_na_counts < 2) + if(length(min_col) >= 1){ + data <- data[, -min_col, drop = FALSE] + } pairs( data, upper.panel = function(x, y) { diff --git a/man/LFQDataPlotter.Rd b/man/LFQDataPlotter.Rd index 00fe9bdf..e3d890a6 100644 --- a/man/LFQDataPlotter.Rd +++ b/man/LFQDataPlotter.Rd @@ -19,13 +19,13 @@ lfqdata <- LFQData$new( istar$data, istar$config) #LFQDataPlotter$debug("boxplots") +LFQDataPlotter$debug("pairs_smooth") lfqplotter <- lfqdata$get_Plotter() stopifnot(class(lfqplotter$heatmap()) == "pheatmap") stopifnot(class(lfqplotter$heatmap_cor()) == "pheatmap") stopifnot("ggplot" \%in\% class(lfqplotter$pca())) stopifnot("plotly" \%in\% class(lfqplotter$pca_plotly())) - tmp <- lfqplotter$boxplots() stopifnot("ggplot" \%in\% class(tmp$boxplot[[1]])) stopifnot("ggplot" \%in\% class(lfqplotter$missigness_histogram()))