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"
)
taxonomy table
a vector whose length longer than ncol(taxdf)
, use to be prefix. Default: c("k", "p", "c", "o", "f", "g","s", "st")
grepl some words and turn to na_repalce
, default: "Unclassified|uncultured|Ambiguous|Unknown|unknown|metagenome|Unassig"
ignore.case for na_tax
defalut: Unknown
a good taxonomy table
MicrobiotaProcess
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