condenseTaxa: Condense multiple taxonomic assignments to their most recent...

View source: R/taxa.R

condenseTaxaR Documentation

Condense multiple taxonomic assignments to their most recent common branch

Description

Take a table of taxonomic assignments, e.g. assignments from hits to a read, and condense it to a single vector with NAs where there are disagreements between the hits.

Usage

condenseTaxa(taxaTable, groupings = rep(1, nrow(taxaTable)))

Arguments

taxaTable

a matrix or data.frame with hits on the rows and various levels of taxonomy in the columns

groupings

a vector of groups e.g. read queries to condense taxa within

Value

a matrix with ncol(taxaTable) taxonomy columns with a row for each unique id (labelled on rownames) with NAs where there was not complete agreement for an id

Examples

taxas<-matrix(c(
 'a','b','c','e',
 'a','b','d','e'
),nrow=2,byrow=TRUE)
condenseTaxa(taxas)
condenseTaxa(taxas[c(1,2,2),],c(1,1,2))

taxonomizr documentation built on May 29, 2024, 8:49 a.m.