From 02ad30ad4625236a7ad3b0556142118ee4088afc Mon Sep 17 00:00:00 2001 From: oliviaAB Date: Wed, 17 Apr 2024 11:53:50 +1200 Subject: [PATCH] Removed here from dependencies, using where() from tidyselect and not dplyr --- DESCRIPTION | 3 +-- NAMESPACE | 1 - NEWS.md | 4 ++++ R/data_import.R | 5 ++++- R/diablo.R | 2 +- R/import_from_packages.R | 2 +- R/multidataset_utils.R | 4 ++-- R/output_plot.R | 2 +- R/so2pls.R | 2 +- man/diablo_plot_tune.Rd | 6 +++--- 10 files changed, 18 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d50830c..b8a6a7c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: moiraine Title: Construction of Reproducible Pipelines for Testing and Comparing Multi-omics Integration Tools -Version: 1.0.0 +Version: 1.0.0.9000 Authors@R: c(person("Olivia", "Angelin-Bonnet", email = "O.Angelin-Bonnet@massey.ac.nz", @@ -30,7 +30,6 @@ Imports: ggpubr, ggrepel, grid, - here, methods, mixOmics, MOFA2, diff --git a/NAMESPACE b/NAMESPACE index c02e9b0..5d8967b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -177,5 +177,4 @@ importClassesFrom(Biobase,SnpSet) importClassesFrom(Biobase,eSet) importClassesFrom(MultiDataSet,MultiDataSet) importFrom(dplyr,sym) -importFrom(dplyr,where) importFrom(ggplot2,aes) diff --git a/NEWS.md b/NEWS.md index aff67b4..2f0aa6f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ # moiraine (development version) - In `comparison_heatmap_corr()`, the user can now choose the legend position through the `legend_position` parameter. + +- Package here has been removed from dependencies (not needed). + +- `where()` function now imported from tidyselect instead of dplyr (as it required a newer version of dplyr). diff --git a/R/data_import.R b/R/data_import.R index 22c037a..03e3b72 100644 --- a/R/data_import.R +++ b/R/data_import.R @@ -180,7 +180,10 @@ import_fmetadata_gff <- function(file, feature_type, add_fields = NULL) { ## become vector tibble::as_tibble() |> dplyr::mutate( - dplyr::across(where(is.list), ~ sapply(.x, paste, collapse = " ")) + dplyr::across( + tidyselect::where(is.list), + ~ sapply(.x, paste, collapse = " ") + ) ) .check_names( diff --git a/R/diablo.R b/R/diablo.R index 529fafb..af92cf9 100644 --- a/R/diablo.R +++ b/R/diablo.R @@ -595,7 +595,7 @@ diablo_table_optim_keepX <- function(tune_res) { ) }) |> purrr::reduce(dplyr::bind_rows) |> - dplyr::mutate(Total = rowSums(dplyr::across(where(is.numeric)))) + dplyr::mutate(Total = rowSums(dplyr::across(tidyselect::where(is.numeric)))) return(res) } diff --git a/R/import_from_packages.R b/R/import_from_packages.R index 499cdb8..3649c1a 100644 --- a/R/import_from_packages.R +++ b/R/import_from_packages.R @@ -7,7 +7,7 @@ NULL #' @import methods NULL -#' @importFrom dplyr sym where +#' @importFrom dplyr sym NULL #' @importFrom ggplot2 aes diff --git a/R/multidataset_utils.R b/R/multidataset_utils.R index 3d0c0d8..7daf686 100644 --- a/R/multidataset_utils.R +++ b/R/multidataset_utils.R @@ -238,7 +238,7 @@ join_features_metadata <- function(df, mo_data) { dplyr::filter(feature_id %in% df$feature_id) |> dplyr::select( feature_id, - where(~ any(!is.na(.x))) + tidyselect::where(~ any(!is.na(.x))) ) if (nrow(fmeta) == 0) { @@ -285,7 +285,7 @@ join_samples_metadata <- function(df, mo_data, datasets = NULL) { dplyr::filter(id %in% df$id) |> dplyr::select( id, - where(~ any(!is.na(.x))) + tidyselect::where(~ any(!is.na(.x))) ) if (nrow(smeta) == 0) { diff --git a/R/output_plot.R b/R/output_plot.R index 1293a71..be334f8 100644 --- a/R/output_plot.R +++ b/R/output_plot.R @@ -1122,7 +1122,7 @@ plot_features_weight_covariate <- function(method_output, ) |> dplyr::mutate( dplyr::across( - .cols = dplyr::where(\(x){!is.numeric(x)}), + .cols = tidyselect::where(\(x){!is.numeric(x)}), .fns = as.character ) ), diff --git a/R/so2pls.R b/R/so2pls.R index a5d8c32..dd8e445 100644 --- a/R/so2pls.R +++ b/R/so2pls.R @@ -666,7 +666,7 @@ so2pls_print_cv_sparsity <- function(cv_res_optim) { names_from = joint_component, values_from = n_features ) |> - dplyr::mutate(Total = rowSums(dplyr::across(where(is.numeric)))) + dplyr::mutate(Total = rowSums(dplyr::across(tidyselect::where(is.numeric)))) } #' Plot sparsity cross-validation results for sO2PLS diff --git a/man/diablo_plot_tune.Rd b/man/diablo_plot_tune.Rd index 85fcade..237f2aa 100644 --- a/man/diablo_plot_tune.Rd +++ b/man/diablo_plot_tune.Rd @@ -7,12 +7,12 @@ diablo_plot_tune(tune_res) } \arguments{ -\item{tune_res}{The cross-validation results, computed with \code{\link{diablo_tune}}.} +\item{tune_res}{The cross-validation results, computed with \code{\link[=diablo_tune]{diablo_tune()}}.} } \value{ A \code{ggplot2} object. } \description{ -Displays the error rate of a DIABLO run cross-validation to estimate the optimal number of features to retain from -each dataset (\code{keepX}). +Displays the error rate of a DIABLO run cross-validation to estimate the +optimal number of features to retain from each dataset (\code{keepX}). }