joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
569 stars 187 forks source link

how to reassign errant taxonomic assignments #908

Open KMKemp opened 6 years ago

KMKemp commented 6 years ago

I need to reassign an errant phylum assignment given by greengenes. I simply need to reassign (replace) the phylum "Tenericutes" to "Firmicutes". How can this be done within phyloseq?

mikemc commented 6 years ago

One way to do this is

tax <- tax_table(physeq)
rows <- (tax[, "Phylum"] == "Tenericutes")
tax[rows, "Phylum"] <- "Firmicutes"
tax_table(physeq) <- tax