Skip to content

Commit

Permalink
BiocCheck canges
Browse files Browse the repository at this point in the history
  • Loading branch information
xec-cm committed Sep 20, 2023
1 parent dbf1c92 commit cc0dd53
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 47 deletions.
8 changes: 4 additions & 4 deletions R/corncob.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 ",
Expand Down
8 changes: 4 additions & 4 deletions R/filter_taxa.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions R/phyloseq_qc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 16 additions & 13 deletions R/plot_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
))

Expand All @@ -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"
)
))

Expand Down Expand Up @@ -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 <-
Expand All @@ -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"
)
))

Expand All @@ -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"
)
))

Expand Down Expand Up @@ -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"
)
))

Expand All @@ -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"
)
))

Expand Down
4 changes: 2 additions & 2 deletions man/phy_qc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 22 additions & 19 deletions vignettes/article.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion vignettes/dar.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions vignettes/import_export_recipes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc0dd53

Please sign in to comment.