numbered.ASVs: Numbered ASVs

View source: R/numbered_ASVs.R

numbered.ASVsR Documentation

Numbered ASVs

Description

Replace ASV names (sequences) as output by dada2 with ASV numbers (e.g. ASV001, ASV002, ...). Returns a phyloseq object with the new names.

Usage

numbered.ASVs(ps, prefix = "ASV", save.dir = ".", save.file = "ASV_sequences")

Arguments

ps

a phyloseq object

prefix

The string you want to come before the id numbers. Defaults to "ASV". Cannot be "" or logical (TRUE/FALSE) as numbers can't be used as column names in data.frames.

save.dir

directory in which to save the original ASV sequences, for reference. Defaults to "." (current directory).

save.file

file name to save the original ASV sequences. Does NOT require an extension (saves as a .rds). Defaults to "ASV_sequences".

See Also

taxa_names, phyloseq

Examples

data(example_phyloseq)
head(taxa_names(example_phyloseq))
new.phyloseq <- numbered.ASVs(example_phyloseq)
head(taxa_names(new.phyloseq))

kstagaman/phyloseqCompanion documentation built on Aug. 26, 2022, 5:07 a.m.