Skip to content

Commit

Permalink
Merge pull request #100 from adrientaudiere/dev
Browse files Browse the repository at this point in the history
docs: Fix bugs for devel cran test
  • Loading branch information
adrientaudiere authored Sep 27, 2024
2 parents 76a25f8 + 3f565a2 commit c9d0a46
Show file tree
Hide file tree
Showing 188 changed files with 393 additions and 257 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MiscMetabar
Type: Package
Title: Miscellaneous Functions for Metabarcoding Analysis
Version: 0.9.3
Version: 0.9.4
Authors@R: person("Adrien", "Taudière", email = "[email protected]",
role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-1088-1182"))
Description: Facilitate the description, transformation, exploration, and reproducibility of metabarcoding analyses. 'MiscMetabar' is mainly built on top of the 'phyloseq', 'dada2' and 'targets' R packages. It helps to build reproducible and robust bioinformatics pipelines in R. 'MiscMetabar' makes ecological analysis of alpha and beta-diversity easier, more reproducible and more powerful by integrating a large number of tools. Important features are described in Taudière A. (2023) <doi:10.21105/joss.06038>.
Expand Down
15 changes: 10 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

# MiscMetabar 0.9.3 (in development)
# MiscMetabar 0.9.5 (in development)

# MiscMetabar 0.9.4

- Set a seed in the example of `build_tree_pq` to resubmit to CRAN

# MiscMetabar 0.9.3

- Homogenize terminology replacing ASV by taxa/taxon in documentation and code
- Build an alias function `filter_taxa_blast()` for
`filter_asv_blast()`
- Build an alias function `postcluster_pq()` for
`asv2otu()`
- Build an alias function `filter_taxa_blast()` for `filter_asv_blast()`
- Build an alias function `postcluster_pq()` for `asv2otu()`
- Add param `return_data_for_venn` in function `ggvenn_pq` in order to make more customizable plot following [ggVennDiagram tutorial](https://gaospecial.github.io/ggVennDiagram/articles/fully-customed.html)


## BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion R/blast.R
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ filter_taxa_blast <- filter_asv_blast
################################################################################


#' Blast some sequence against sequences from of a \code{\link{derep-class}}
#' Blast some sequence against sequences from of a \code{\link[dada2]{derep-class}}
#' object.
#'
#' @description
Expand Down
3 changes: 2 additions & 1 deletion R/dada_phyloseq.R
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ tbl_sum_samdata <- function(physeq, remove_col_unique_value = TRUE, ...) {
#' @details
#' This function is mainly a wrapper of the work of others.
#' Please make a reference to `FUNGuildR` package and the associate
#' [publication](https://www.sciencedirect.com/science/article/abs/pii/S1754504815000847) if you
#' publication (\doi{10.1016/j.funeco.2015.06.006}) if you
#' use this function.
#' @seealso [plot_guild_pq()]

Expand Down Expand Up @@ -2019,6 +2019,7 @@ plot_guild_pq <-
#' @examplesIf tolower(Sys.info()[["sysname"]]) != "windows"
#' \donttest{
#' if (requireNamespace("phangorn")) {
#' set.seed(22)
#' df <- subset_taxa_pq(data_fungi_mini, taxa_sums(data_fungi_mini) > 9000)
#' df_tree <- build_phytree_pq(df, nb_bootstrap = 2)
#' plot(df_tree$UPGMA)
Expand Down
2 changes: 1 addition & 1 deletion R/funguild.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' The original function and documentation was written by Brendan Furneaux
#' in the [FUNGuildR](https://github.com/brendanf/FUNGuildR/) package.
#'
#' Please cite this [publication](https://www.sciencedirect.com/science/article/abs/pii/S1754504815000847).
#' Please cite this publication (\doi{10.1016/j.funeco.2015.06.006}).
#'
#' @param db_url a length 1 character string giving the URL to retrieve the database
#' from
Expand Down
39 changes: 38 additions & 1 deletion R/plot_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,9 @@ venn_pq <-
#' modalities of args `fact`. Use `phyloseq::rarefy_even_depth()` function
#' @param rarefy_after_merging Rarefy each sample after merging by the
#' modalities of args `fact`.
#' @param return_data_for_venn (logical, default FALSE) If TRUE, the plot is
#' not returned, but the resulting dataframe to plot with ggVennDiagram package
#' is returned.
#' @param ... Other arguments for the `ggVennDiagram::ggVennDiagram` function
#' for ex. `category.names`.
#' @return A \code{\link[ggplot2]{ggplot}}2 plot representing Venn diagram of
Expand Down Expand Up @@ -1225,6 +1228,35 @@ venn_pq <-
#' ggvenn_pq(data_fungi, fact = "Height", rarefy_before_merging = TRUE)
#' ggvenn_pq(data_fungi, fact = "Height", rarefy_after_merging = TRUE) +
#' scale_x_continuous(expand = expansion(mult = 0.5))
#'
#' # For more flexibility, you can save the dataset for more precise construction
#' # with ggplot2 and ggVennDiagramm
#' # (https://gaospecial.github.io/ggVennDiagram/articles/fully-customed.html)
#' res_venn <- ggvenn_pq(data_fungi, fact = "Height", return_data_for_venn = TRUE)
#'
#' ggplot() +
#' # 1. region count layer
#' geom_polygon(aes(X, Y, group = id, fill = name),
#' data = ggVennDiagram::venn_regionedge(res_venn)
#' ) +
#' # 2. set edge layer
#' geom_path(aes(X, Y, color = id, group = id),
#' data = ggVennDiagram::venn_setedge(res_venn),
#' show.legend = FALSE, linewidth = 3
#' ) +
#' # 3. set label layer
#' geom_text(aes(X, Y, label = name),
#' data = ggVennDiagram::venn_setlabel(res_venn)
#' ) +
#' # 4. region label layer
#' geom_label(
#' aes(X, Y, label = paste0(
#' count, " (",
#' scales::percent(count / sum(count), accuracy = 2), ")"
#' )),
#' data = ggVennDiagram::venn_regionlabel(res_venn)
#' ) +
#' theme_void()
#' }
#' }
#' @export
Expand All @@ -1240,6 +1272,7 @@ ggvenn_pq <- function(physeq = NULL,
add_nb_seq = FALSE,
rarefy_before_merging = FALSE,
rarefy_after_merging = FALSE,
return_data_for_venn = FALSE,
...) {
if (!is.factor(physeq@sam_data[[fact]])) {
physeq@sam_data[[fact]] <- as.factor(physeq@sam_data[[fact]])
Expand Down Expand Up @@ -1323,7 +1356,11 @@ ggvenn_pq <- function(physeq = NULL,
ggtitle(moda)
}
}
return(p)
if (return_data_for_venn) {
return(ggVennDiagram::process_data(ggVennDiagram::Venn(res)))
} else {
return(p)
}
}
################################################################################

Expand Down
9 changes: 9 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ A CRAN version of MiscMetabar is available.
install.packages("MiscMetabar")
```

You may need to install required bioconductor packages (dada2 and phyloseq) first. See their installation pages.
One other solution is to use the package [pak](https://pak.r-lib.org/) to install MiscMetabar. It comes with the benefit to check for
uninstalled dependencies on your computer (system requirements), thank you [pak](https://pak.r-lib.org/)!

```{r, results = 'hide', eval=FALSE}
pak::pkg_install("MiscMetabar")
```



You can also install the stable development version from [GitHub](https://github.com/) with:

Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org
[![DOI](https://joss.theoj.org/papers/10.21105/joss.06038/status.svg)](https://doi.org/10.21105/joss.06038)

<!-- README.md is generated from README.Rmd. Please edit that file -->

<!-- devtools::build_readme() -->

# MiscMetabar <a href="https://adrientaudiere.github.io/MiscMetabar/"><img src="https://adrientaudiere.github.io/MiscMetabar/reference/figures/logo.png" align="right" height="138" alt="MiscMetabar website" /></a>
Expand Down Expand Up @@ -48,6 +49,16 @@ A CRAN version of MiscMetabar is available.
install.packages("MiscMetabar")
```

You may need to install required bioconductor packages (dada2 and
phyloseq) first. See their installation pages. One other solution is to
use the package [pak](https://pak.r-lib.org/) to install MiscMetabar. It
comes with the benefit to check for uninstalled dependencies on your
computer (system requirements), thank you [pak](https://pak.r-lib.org/)!

``` r
pak::pkg_install("MiscMetabar")
```

You can also install the stable development version from
[GitHub](https://github.com/) with:

Expand Down Expand Up @@ -138,7 +149,7 @@ ggvenn_pq(data_fungi, fact = "Height") +
labs(title = "Share number of ASV among Height in tree")
```

<img src="man/figures/README-unnamed-chunk-7-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-8-1.png" width="100%" />

### Note for non-Linux users

Expand Down
21 changes: 2 additions & 19 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
Resolved 2 Notes from CRAN submission
Resolved 1 Error from CRAN "Additional issue"


# Invalid URLs

Found the following (possibly) invalid URLs:
URL: https://www.sciencedirect.com/science/article/abs/pii/S1754504815000847
From: man/add_funguild_info.Rd
man/get_funguild_db.Rd
Status: 403
Message: Forbidden

> I don't understand why the URL is invalid. It works for me.

# Bad \link{} for external packages

Found the following Rd file(s) with Rd \link{} targets missing package

> Solved in v. 0.9.3
I add a seed (`set.seed(22)`) in the offending example of `build_phytree_pq`. I tried to find the error using a loop, but after 50 different seed numbers, the examples still work on my side.
2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html

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

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

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

2 changes: 1 addition & 1 deletion docs/LICENSE.html

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

4 changes: 2 additions & 2 deletions docs/articles/MiscMetabar.html

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

6 changes: 3 additions & 3 deletions docs/articles/Reclustering.html

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

2 changes: 1 addition & 1 deletion docs/articles/Rules.html

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

4 changes: 2 additions & 2 deletions docs/articles/alpha-div.html

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

4 changes: 2 additions & 2 deletions docs/articles/beta-div.html

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

2 changes: 1 addition & 1 deletion docs/articles/explore_data.html

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

2 changes: 1 addition & 1 deletion docs/articles/fastq_quality_check.html

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

4 changes: 2 additions & 2 deletions docs/articles/filter.html

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

Loading

0 comments on commit c9d0a46

Please sign in to comment.