Discard taxa with less than the given minimum number of occurrences.

filterTaxonMatrix(x, minocc = 0, dependency = FALSE, keepSum = FALSE,
  return.filtered.indices = FALSE)

Arguments

x

taxon abundance matrix, rows are taxa, columns are samples

minocc

minimum occurrence (minimum number of samples with non-zero taxon abundance)

dependency

if true, remove all taxa with a slope above -0.5 or a non-linear slope in the periodogram in log-scale (samples are supposed to represent equidistant time points)

keepSum

If keepSum is true, the discarded rows are summed and the sum is added as a row with name: summed-nonfeat-rows

return.filtered.indices

if true, return an object with the filtered abundance matrix in mat and the indices of removed taxa in the original matrix in filtered.indices

Value

filtered abundance matrix

Examples

if (FALSE) { data(david_stoolA_otus) minocc=round(ncol(david_stoolA_otus)/3) stoolAFiltered=filterTaxonMatrix(david_stoolA_otus,minocc=minocc) print(paste("Filtered taxa with less than a minimum occurrence of:",minocc)) print(paste("Taxon number before filtering:",nrow(david_stoolA_otus))) print(paste("Taxon number after filtering:",nrow(stoolAFiltered))) }