mikemc / speedyseq

Speedy versions of phyloseq functions
https://mikemc.github.io/speedyseq/
Other
45 stars 6 forks source link

Add functions to rename taxa and samples #68

Closed mikemc closed 3 years ago

mikemc commented 3 years ago

For renaming taxa, I'm imagining a function rename_taxa(ps, nms) that sets new taxa names where nms is either a vector of length ntaxa(ps) of new names or an expression that can be passed to dplyr::transmute(ps_tibble(tax_table(ps)), nms) %>% pull(1) to generate the new names from the tax table.

For renaming samples, I'm imagining a function rename_samples(ps, nms) that works in the analogous way, but with tax_table(ps) replaced with sample_data(ps)

mikemc commented 3 years ago

This functionality now exists via mutate_sample_data() and mutate_tax_table() by setting the special .sample and .otu variables to the new names