Skip to content

Commit

Permalink
v 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
adrientaudiere committed Jan 15, 2025
1 parent c6b115d commit 489edaf
Show file tree
Hide file tree
Showing 248 changed files with 11,282 additions and 843 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.11.1
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
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
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 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)
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
17 changes: 7 additions & 10 deletions R/blast.R
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,7 @@ blast_to_derep <- function(derep,
#' @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.
#' If set to NULL (the default), the basename of the file reFasta
#' is used with the name of the method. Set suffix to "" in order
#' to remove any suffix.
#' 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 @@ -642,11 +640,8 @@ blast_to_derep <- function(derep,
#'
#' @author Adrien Taudière

add_blast_info <- function(physeq, fasta_for_db, silent = FALSE, suffix=NULL, ...) {
add_blast_info <- function(physeq, fasta_for_db, silent = FALSE, suffix = "blast_info", ...) {
verify_pq(physeq)
if (is.null(suffix)) {
suffix <- paste0(basename(fasta_for_db), "_", method)
}
res_blast <- blast_pq(physeq,
fasta_for_db = fasta_for_db,
unique_per_seq = TRUE,
Expand All @@ -655,15 +650,17 @@ add_blast_info <- function(physeq, fasta_for_db, silent = FALSE, suffix=NULL, ..
)
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))

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

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

0 comments on commit 489edaf

Please sign in to comment.