if (FALSE) {
# Parse data
x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
class_regex = "^(.+)__(.+)$")
# Get all col names
metacoder:::parse_taxmap_cols(x, "tax_data")
# Get col names by index
metacoder:::parse_taxmap_cols(x, "tax_data", 2:4)
# Get col names by name (i.e. verify)
metacoder:::parse_taxmap_cols(x, "tax_data", c("taxon_id", "lineage"))
metacoder:::parse_taxmap_cols(x, "tax_data", c("taxon_id", "not_valid"))
# Get colnames by TRUE/FALSE vector
metacoder:::parse_taxmap_cols(x, "tax_data", startsWith(colnames(x$data$tax_data), "7"))
}
Run the code above in your browser using DataLab