diff --git a/R/corncob.R b/R/corncob.R index dcb6c4b..ebd1389 100644 --- a/R/corncob.R +++ b/R/corncob.R @@ -265,11 +265,11 @@ run_corncob <- function(rec, "converge!" ), glue::glue( - "{crayon::bgMagenta('corncob')}: If you are seeing this, it ", - "is likely that your model is overspecified. This occurs ", + "{crayon::bgMagenta('corncob')}: If you are seeing this, it", + " is likely that your model is overspecified. This occurs ", "when your sample size is not large enough to estimate all ", - "the parameters of your model. This is most commonly due to ", - "categorical variables that include many categories." + "the parameters of your model. This is most commonly due to", + " categorical variables that include many categories." ), glue::glue( "Please remove or edit the ", diff --git a/R/filter_taxa.R b/R/filter_taxa.R index 32ae94b..782c472 100644 --- a/R/filter_taxa.R +++ b/R/filter_taxa.R @@ -90,10 +90,10 @@ run_filter_taxa <- function(rec, .f) { if (val > 0 & rm_zeros == 0 & is_metagenomeseq) { rlang::abort(c( "!" = glue::glue( - "{crayon::bgMagenta('step_filter_taxa()')} returns a phyloseq object ", - "that contains taxa with values of 0 in all samples of a level within ", - "the variable of interest. This can cause errors during the execution ", - "of metagenomeseq method!" + "{crayon::bgMagenta('step_filter_taxa()')} returns a phyloseq ", + "object that contains taxa with values of 0 in all samples of a ", + "level within the variable of interest. This can cause errors during ", + "the execution of metagenomeseq method!" ), "*" = "Please create a new recipe using a stricter filter expression.", "*" = glue::glue( diff --git a/R/phyloseq_qc.R b/R/phyloseq_qc.R index 079eeff..9c82f13 100644 --- a/R/phyloseq_qc.R +++ b/R/phyloseq_qc.R @@ -3,8 +3,8 @@ #' phy_qc() returns a tibble. It will have information about some important #' metrics about the sparsity of the count matrix. The content of the table is #' as follows: -#' * var_levels: levels of the categorical variable of interest. "all" refers to -#' all rows of the dataset (without splitting by categorical levels). +#' * var_levels: levels of the categorical variable of interest. "all" refers +#' to all rows of the dataset (without splitting by categorical levels). #' * n: total number of values in the count matrix. #' * n_zero: number of zeros in the count matrix. #' * pct_zero: percentage of zeros in the count matrix. diff --git a/R/plot_methods.R b/R/plot_methods.R index 4f70204..0b35982 100644 --- a/R/plot_methods.R +++ b/R/plot_methods.R @@ -377,8 +377,8 @@ methods::setMethod( "{top_n}" ), "i" = glue::glue( - "The top {top_n} significant taxa with the greatest overlap between ", - "methods will be used" + "The top {top_n} significant taxa with the greatest overlap between", + " methods will be used" ) )) @@ -395,8 +395,8 @@ methods::setMethod( rlang::inform(c( "!" = "0 taxa are present in all tested methods", "i" = glue::glue( - "The top {top_n} significant taxa with the greatest overlap between ", - "methods will be used" + "The top {top_n} significant taxa with the greatest overlap ", + "between methods will be used" ) )) @@ -434,7 +434,10 @@ methods::setMethod( #' @noRd #' @keywords internal .abundance_heatmap <- function(rec, taxa_ids, transform, scale, top_n) { - ComplexHeatmap::ht_opt(message = FALSE, COLUMN_ANNO_PADDING = unit(0.5, "cm")) + ComplexHeatmap::ht_opt( + message = FALSE, + COLUMN_ANNO_PADDING = unit(0.5, "cm") + ) if (is.null(taxa_ids)) { taxa_ids <- @@ -450,8 +453,8 @@ methods::setMethod( "{top_n}" ), "i" = glue::glue( - "The top {top_n} significant taxa with the greatest overlap between ", - "methods will be used" + "The top {top_n} significant taxa with the greatest overlap between", + " methods will be used" ) )) @@ -468,8 +471,8 @@ methods::setMethod( rlang::inform(c( "!" = "0 taxa are present in all tested methods", "i" = glue::glue( - "The top {top_n} significant taxa with the greatest overlap between ", - "methods will be used" + "The top {top_n} significant taxa with the greatest overlap between", + " methods will be used" ) )) @@ -630,8 +633,8 @@ methods::setMethod( "{top_n}" ), "i" = glue::glue( - "The top {top_n} significant taxa with the greatest overlap between ", - "methods will be used" + "The top {top_n} significant taxa with the greatest overlap between", + " methods will be used" ) )) @@ -653,8 +656,8 @@ methods::setMethod( "0 taxa are present with count_cutoff = {count_cutoff}" ), "i" = glue::glue( - "The top {top_n} significant taxa with the greatest overlap between ", - "methods will be used" + "The top {top_n} significant taxa with the greatest overlap between", + " methods will be used" ) )) diff --git a/man/phy_qc.Rd b/man/phy_qc.Rd index 7344208..11698e5 100644 --- a/man/phy_qc.Rd +++ b/man/phy_qc.Rd @@ -20,8 +20,8 @@ phy_qc() returns a tibble. It will have information about some important metrics about the sparsity of the count matrix. The content of the table is as follows: \itemize{ -\item var_levels: levels of the categorical variable of interest. "all" refers to -all rows of the dataset (without splitting by categorical levels). +\item var_levels: levels of the categorical variable of interest. "all" refers +to all rows of the dataset (without splitting by categorical levels). \item n: total number of values in the count matrix. \item n_zero: number of zeros in the count matrix. \item pct_zero: percentage of zeros in the count matrix. diff --git a/vignettes/article.Rmd b/vignettes/article.Rmd index 9218b89..1c3ac85 100644 --- a/vignettes/article.Rmd +++ b/vignettes/article.Rmd @@ -27,15 +27,15 @@ options(digits = 3) ``` To illustrate the functionality of the 'dar' package, this study will use the -data set from (Noguera-Julian, M., et al. 2016). The authors of this study found -that men who have sex with men (MSM) predominantly belonged to the +data set from (Noguera-Julian, M., et al. 2016). The authors of this study +found that men who have sex with men (MSM) predominantly belonged to the Prevotella-rich enterotype whereas most non-MSM subjects were enriched in -Bacteroides, independently of HIV-1 status. This result highlights the potential -impact of sexual orientation on the gut microbiome and emphasizes the importance -of controlling for such variables in microbiome research. Using the 'dar' -package, we will conduct a differential abundance analysis to further explore -this finding and uncover potential microbial biomarkers associated with this -specific population. +Bacteroides, independently of HIV-1 status. This result highlights the +potential impact of sexual orientation on the gut microbiome and emphasizes the +importance of controlling for such variables in microbiome research. Using the +'dar' package, we will conduct a differential abundance analysis to further +explore this finding and uncover potential microbial biomarkers associated with +this specific population. ## Load dar package and data @@ -56,10 +56,10 @@ abundance analysis. The initialization of the recipe object is done through the function recipe(), which takes as inputs a phyloseq object, the name of the categorical variable of interest and the taxonomic level at which the differential abundance analyses are to be performed. As previously mentioned, -we will use the data set from (Noguera-Julian, M., et al. 2016) and the variable -of interest "RiskGroup2" containing the categories: men who have sex with men -(msm), non-MSM (hts) and people who inject drugs (pwid) and we will perform the -analysis at the species level. +we will use the data set from (Noguera-Julian, M., et al. 2016) and the +variable of interest "RiskGroup2" containing the categories: men who have sex +with men (msm), non-MSM (hts) and people who inject drugs (pwid) and we will +perform the analysis at the species level. ```{r} ## Recipe initialization @@ -215,16 +215,19 @@ corr_heat ``` Finally, 'dar' also includes the function mutual_plt(), which plots the number -of differential abundant features mutually found by a defined number of methods, -colored by the differential abundance direction and separated by comparison. -The resulting graph allows us to see that the features detected correspond -mainly to the comparisons between hts vs msm and msm vs pwid. Additionally, the -graph also allows us to observe the direction of the effect; whether a specific -OTU is enriched or depleted for each comparison. +of differential abundant features mutually found by a defined number of +methods, colored by the differential abundance direction and separated by +comparison. The resulting graph allows us to see that the features detected +correspond mainly to the comparisons between hts vs msm and msm vs pwid. +Additionally, the graph also allows us to observe the direction of the effect; +whether a specific OTU is enriched or depleted for each comparison. ```{r, fig.height=6} ## Mutual plot -mutual_plt(da_results, count_cutoff = length(steps_ids(da_results, type = "da"))) +mutual_plt( + da_results, + count_cutoff = length(steps_ids(da_results, type = "da")) +) ``` ## Define a consesus strategy using bake diff --git a/vignettes/dar.Rmd b/vignettes/dar.Rmd index 26e56dc..ff4edba 100644 --- a/vignettes/dar.Rmd +++ b/vignettes/dar.Rmd @@ -124,7 +124,9 @@ full list: ```{r da_steps_list} grep("^step_", ls("package:dar"), value = TRUE) %>% - grep("_new|_to_expr|filter|subset|rarefaction", ., value = TRUE, invert = TRUE) + grep( + "_new|_to_expr|filter|subset|rarefaction", ., value = TRUE, invert = TRUE + ) ``` ## Prep diff --git a/vignettes/import_export_recipes.Rmd b/vignettes/import_export_recipes.Rmd index e4092d4..e44def0 100644 --- a/vignettes/import_export_recipes.Rmd +++ b/vignettes/import_export_recipes.Rmd @@ -82,8 +82,9 @@ In this example, an empty recipe is initialized, and then the steps are imported from a JSON file using the `import_steps` function. The imported steps are added to the existing recipe. -Once the recipe is imported, we can choose to add more steps or execute the code -using the `prep` function. In this case, we choose to execute `prep` directly. +Once the recipe is imported, we can choose to add more steps or execute the +code using the `prep` function. In this case, we choose to execute `prep` +directly. ```{r} ## Execute