diff --git a/.Rbuildignore b/.Rbuildignore index c503c4f..d325fbf 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1 +1,3 @@ ^\.github$ +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/R/viz.R b/R/viz.R index fb1d059..76f8d15 100644 --- a/R/viz.R +++ b/R/viz.R @@ -689,6 +689,11 @@ maaslin3_summary_plot <- invokeRestart("muffleWarning") }) }) + saveRDS(final_plot, + file = paste(figures_folder, + "/" , + "summary_plot_gg.RDS", + sep = "")) } } @@ -1380,7 +1385,6 @@ maaslin3_association_plots <- ) saved_plots <- list() - features_by_metadata <- unique(merged_results[, c('feature', 'metadata', 'model')]) @@ -1412,7 +1416,6 @@ maaslin3_association_plots <- dplyr::inner_join(feature_abun, metadata_sub, by = c('sample')) model_name <- features_by_metadata[row_num, 'model'] - this_signif_association <- merged_results[merged_results$feature == feature_name & merged_results$metadata == metadata_name & @@ -1444,6 +1447,7 @@ maaslin3_association_plots <- saved_plots[[metadata_name]][[feature_name]][[model_name]] <- temp_plot + } association_plots_folder <- @@ -1454,6 +1458,12 @@ maaslin3_association_plots <- # Save all plots for (metadata_variable in names(saved_plots)) { + saveRDS(saved_plots[[metadata_variable]], + file = paste(association_plots_folder, + "/" , + metadata_variable, + "_gg_associations.RDS", + sep = "")) for (feature in names(saved_plots[[metadata_variable]])) { for (model_name in names( saved_plots[[metadata_variable]][[feature]])) {