Skip to content

Commit

Permalink
Merge pull request #108 from adrientaudiere/dev
Browse files Browse the repository at this point in the history
v 0.12
  • Loading branch information
adrientaudiere authored Jan 15, 2025
2 parents 193e6aa + 489edaf commit 2a98133
Show file tree
Hide file tree
Showing 248 changed files with 11,350 additions and 816 deletions.
5 changes: 3 additions & 2 deletions 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.11.0
Version: 0.12.0
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 Expand Up @@ -55,10 +55,11 @@ Suggests:
networkD3,
pak,
patchwork,
pbapply,
permute,
phangorn,
phyloseqGraphTest,
pbapply,
pkgnet,
plotly,
plyr,
reshape2,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export(all_object_size)
export(ancombc_pq)
export(are_modality_even_depth)
export(as_binary_otu_table)
export(assign_idtaxa)
export(assign_sintax)
export(assign_vsearch_lca)
export(asv2otu)
Expand Down Expand Up @@ -71,6 +72,7 @@ export(is_mumu_installed)
export(is_swarm_installed)
export(is_vsearch_installed)
export(krona)
export(learn_idtaxa)
export(list_fastq_files)
export(lulu)
export(lulu_phyloseq)
Expand Down Expand Up @@ -137,6 +139,7 @@ export(taxa_as_columns)
export(taxa_as_rows)
export(taxa_only_in_one_level)
export(tbl_sum_samdata)
export(tbl_sum_taxtable)
export(track_wkflow)
export(track_wkflow_samples)
export(transp)
Expand Down
19 changes: 17 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# MiscMetabar 0.11 (in development)
# MiscMetabar 0.2.0 (in development)

- Add function [assign_idtaxa()] and [learn_idtaxa()] to facilitate the taxonomic assignation using the idtaxa algorithm from the DECIPHER R package.
- Add option `idtaxa` to method in [add_new_taxonomy_pq()]
- Add function [tbl_sum_taxtable()] to summarize tax_table from a phyloseq object
- In function [assign_sintax()], add params `too_few` (default value "align_start") and `too_many` (default "merge") to authorize db with variable numbers of rank and parenthesis in taxonomic name,


# MiscMetabar 0.11.1 (in development)

- Add param `suffix` to `add_blast_info()` allowing multiple use of the function on the same phyloseq object (e.g. in order to used different database)
- Add param `return_DNAStringSet` to `write_temp_fasta()` function to return a DNAStringSet object in place of a temporary file.
- Add a vignette pkgnet-report.
- Add the possibility to send fasta.gz file to `count_seq()`

# MiscMetabar 0.11

- Add function `filt_taxa_pq()` to filter taxa based on the number of sequences/occurences
- Add functions `no_legend()` and `hill_curves_pq()` to plot hill diversity accumulation curves for phyloseq
- Add function `umap_pq()` to compute Dimensionality Reduction with UMAP
- Add function `plot_complexity_pq()` to plot kmer complexity of references sequences of a phyloseq object
- Add param `type` to `ridge_pq()` to plot a cumulative version (type="ecdf") version of ridge
- Introduce the idea of a pq-verse: some other packages will complete the MiscMetabar packages to make package maintenance easier. The [comparpq](https://github.com/adrientaudiere/comparpq) package will facilitate the comparison of phyloseq object with different taxonomy, different clustering method, different samples with same modality or different primers.
- Introduce the idea of a pq-verse: some other packages will complete the MiscMetabar packages to make package maintenance easier. The [comparpq](https://github.com/adrientaudiere/comparpq) package will facilitate the comparison of phyloseq object with different taxonomy, different clustering methods, different samples with same modality or different primers.
- Add functions [assign_vsearch_lca()], [assign_sintax()] and internal function [write_temp_fasta()]
- Add param `method` to `add_new_taxonomy_pq()` to allow the use of [dada2::assign_taxonomy()] (default, precedent only method available), [assign_sintax()] or [assign_vsearch_lca()]

Expand Down
3 changes: 2 additions & 1 deletion R/MiscMetabar-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ if (getRversion() >= "2.15.1") {
"X1_lim1", "X1_lim2", "aicc", "variable", "pos_letters", "alluvium",
"na_remove", "stratum", "to_lodes_form", "clean_fastq", "clean_sam",
"samples_names_common", "seq_id", "alpha_hill", "Modality", "Type", "complexity",
"value_bootstrap"
"value_bootstrap", "LearnTaxa", "OrientNucleotides", "RemoveGaps",
"method", "readDNAStringSet"
))
}

Expand Down
16 changes: 12 additions & 4 deletions R/blast.R
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ blast_to_derep <- function(derep,
#' @inheritParams clean_pq
#' @param fasta_for_db path to a fasta file to make the blast database
#' @param silent (logical) If true, no message are printing.
#' @param suffix (character) The suffix to name the new columns.
#' Set the suffix to "" in order to remove any suffix.
#' @param ... Other arguments passed on to [blast_pq()] function.
#' @return A new \code{\link[phyloseq]{phyloseq-class}} object with more information in tax_table based on a
#' blast on a given database
Expand All @@ -638,21 +640,27 @@ blast_to_derep <- function(derep,
#'
#' @author Adrien Taudière

add_blast_info <- function(physeq, fasta_for_db, silent = FALSE, ...) {
add_blast_info <- function(physeq, fasta_for_db, silent = FALSE, suffix = "blast_info", ...) {
verify_pq(physeq)
res_blast <- blast_pq(physeq,
fasta_for_db = fasta_for_db,
unique_per_seq = TRUE, score_filter = FALSE, ...
unique_per_seq = TRUE,
score_filter = FALSE,
...
)
new_physeq <- physeq

new_physeq@tax_table <- tax_table(cbind(
new_taxtab <- cbind(
new_physeq@tax_table,
as.matrix(res_blast[match(
taxa_names(new_physeq),
res_blast$`Query name`
), ])
))
)

# colnames(new_taxtab) <- c(colnames(new_physeq@tax_table), paste0(colnames(physeq), suffix))

new_physeq@tax_table <- tax_table(new_taxtab)

verify_pq(new_physeq)
if (!silent) {
Expand Down
Loading

0 comments on commit 2a98133

Please sign in to comment.