Skip to content

Commit

Permalink
Merge pull request #60 from adrientaudiere/dev
Browse files Browse the repository at this point in the history
v 0.52
  • Loading branch information
adrientaudiere authored Dec 13, 2023
2 parents 80e2122 + 3f9d492 commit a09750e
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 15 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.51
Version: 0.52
Authors@R: person("Adrien", "Taudière", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1088-1182"))
Maintainer: Adrien Taudière <[email protected]>
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# MiscMetabar 0.52 (in development)
# MiscMetabar 0.53 (in development)

# MiscMetabar 0.52

- Add function `ggbetween_pq()` to facilitate comparison of hill number using the power of `ggstatsplot::ggbetweenstats()`
- Add function `plot_SCBD_pq()` to plot species contributions to beta diversity (SCBD) of samples
Expand Down
9 changes: 6 additions & 3 deletions R/plot_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ plot_mt <-
#' @examples
#' data("GlobalPatterns", package = "phyloseq")
#' GP <- subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
#' GP <- rarefy_even_depth(subset_samples_pq(GP, sample_sums(GP) > 3000))
#' p <- accu_plot(GP, "SampleType", add_nb_seq = TRUE, by.fact = TRUE, step = 10)
#' p <- accu_plot(GP, "SampleType", add_nb_seq = TRUE, step = 10)
#'
#' p + theme(legend.position = "none")
#'
Expand Down Expand Up @@ -288,6 +290,7 @@ accu_plot <-
#' @examples
#' data("GlobalPatterns", package = "phyloseq")
#' GP <- subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
#' GP <- rarefy_even_depth(subset_samples_pq(GP, sample_sums(GP) > 3000))
#' p <- accu_plot(GP, "SampleType", add_nb_seq = TRUE, by.fact = TRUE, step = 10)
#'
#' val_threshold <- accu_samp_threshold(p)
Expand Down Expand Up @@ -1439,9 +1442,9 @@ ggbetween_pq <- function(physeq, variable, one_plot = FALSE, ...) {
physeq <- clean_pq(physeq, force_taxa_as_columns = TRUE)
df <- cbind(
"nb_asv" = sample_sums(physeq@otu_table), physeq@sam_data,
"hill_0" = vegan::renyi(physeq@otu_table, scale = c(0), hill = TRUE),
"hill_1" = vegan::renyi(physeq@otu_table, scale = c(1), hill = TRUE),
"hill_2" = vegan::renyi(physeq@otu_table, scale = c(2), hill = TRUE)
"hill_0" = vegan::renyi(physeq@otu_table, scale = 0, hill = TRUE),
"hill_1" = vegan::renyi(physeq@otu_table, scale = 1, hill = TRUE),
"hill_2" = vegan::renyi(physeq@otu_table, scale = 2, hill = TRUE)
)
variable <- sym(variable)
p0 <- ggstatsplot::ggbetweenstats(df, !!variable, hill_0, ...)
Expand Down
2 changes: 2 additions & 0 deletions man/accu_plot.Rd

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

1 change: 1 addition & 0 deletions man/accu_samp_threshold.Rd

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

3 changes: 2 additions & 1 deletion man/blast_to_phyloseq.Rd

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

8 changes: 6 additions & 2 deletions man/count_seq.Rd

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

8 changes: 4 additions & 4 deletions man/plot_SCBD_pq.Rd

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

8 changes: 5 additions & 3 deletions man/subsample_fastq.Rd

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

1 change: 1 addition & 0 deletions tests/testthat/test_figures_alpha_div.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data_fungi_2trees <-
)
GP_archae <-
subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
GP_archae <- rarefy_even_depth(subset_samples_pq(GP_archae, sample_sums(GP_archae) > 3000))
data_basidio <- subset_taxa(data_fungi, Phylum == "Basidiomycota")

test_that("hill_pq works with data_fungi dataset", {
Expand Down

0 comments on commit a09750e

Please sign in to comment.