#' @import ROBITaxonomy #' @include 02_class_metabarcoding.data.R NULL #' Dataset taxonomic resolution summary. #' #' Summarizes the taxonomic relution of reads and MOTUs over the entire dataset #' #' #' @param x a \code{\link{metabarcoding.data}} object #' @param colranks a string indicating column name where ranks are stored in \code{x} #' @param colscores a string indicating column name where taxonomic identification scores are stored in \code{x} #' @param thresh a threshold for defining at which taxonomic identification scores a sequence can be considered as "not assigned". #' Default is \code{0.7} #' #' @return returns a data.frame and piecharts of the number/proportion of MOTUs/reads assigned to each taxonomic levels #' #' @examples #' #' data(termes) #' taxo=default.taxonomy() #' #' termes.taxo.table = get.classic.taxonomy(termes, taxo, "taxid") #' attr(termes, "motus") = data.frame(termes$motus, termes.taxo.table) #' attr(termes, "motus")["count"] = colSums(termes$reads) #' #' summary.taxores(termes, "taxonomic_rank_ok","best_identity") #' #' @seealso \code{\linkS4class{taxonomy.obitools}}, and method \code{\link{taxonmicank}} #' #' @author Lucie Zinger #' @keywords taxonomy #' #' @export #' summary.taxores = function(x,colranks,colscores, thresh=0.7){ #vector encompassing all ranked possible taxonomic levels taxorank = c("superkingdom", "kingdom", "subkingdom", "superphylum", "phylum", "subphylum", "superclass", "class", "subclass", "infraclass", "superorder", "order", "suborder", "infraorder", "parvorder", "superfamily", "family", "subfamily", "supertribe", "tribe", "subtribe", "supergenus", "genus", "subgenus", "species group", "species subgroup", "superspecies", "species", "subspecies", "varietas", "forma", "no rank", "not assigned") #settings if thresh ranks = as.vector(x$motus[,colranks]) ranks[x$motus[,colscores]