Complete a taxonomy table

pre_tax_table(
  tax_table,
  tax_levels = c("k", "p", "c", "o", "f", "g", "s", "st"),
  na_tax = "Unclassified|uncultured|Ambiguous|Unknown|unknown|metagenome|Unassig",
  ignore.case = TRUE,
  na_repalce = "Unknown"
)

Arguments

tax_table

taxonomy table

tax_levels

a vector whose length longer than ncol(taxdf), use to be prefix. Default: c("k", "p", "c", "o", "f", "g","s", "st")

na_tax

grepl some words and turn to na_repalce, default: "Unclassified|uncultured|Ambiguous|Unknown|unknown|metagenome|Unassig"

ignore.case

ignore.case for na_tax

na_repalce

defalut: Unknown

Value

a good taxonomy table

References

MicrobiotaProcess

Examples

taxmat <- matrix(sample("onelevel", 7 * 2, replace = TRUE), nrow = 2, ncol = 7) %>% as.data.frame()
colnames(taxmat) <- c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species")
pre_tax_table(taxmat)
#>       Kingdom      Phylum       Class       Order      Family       Genus
#> 1 k__onelevel p__onelevel c__onelevel o__onelevel f__onelevel g__onelevel
#> 2 k__onelevel p__onelevel c__onelevel o__onelevel f__onelevel g__onelevel
#>       Species
#> 1 s__onelevel
#> 2 s__onelevel