Retrieve Sequence from Phyloseq
fetchSequence(x, seq_id = NULL, as_DNAStringSet = TRUE)
A phyloseq object
A list of IDs matching taxa_names(phyloseq) that also have
sequence information stored in refseq slot of
phyloseq
object.
Logical (Default=TRUE). If FALSE sequences are returned as character strings.
Sequences for user species IDs either as vector or DNAStringSet object
Retrieve sequences from refseq slot in phyloseq
phyloseq
object.
library(biomeUtils)
data("SprockettTHData")
ps <- SprockettTHData
seq_id <- c("ASV_30_Lachnospiraceae", "ASV_451_UC5-1-2E3", "ASV_586_CAG-56")
myseqs <- fetchSequence(ps, seq_id = seq_id, as_DNAStringSet = TRUE)
myseqs
#> DNAStringSet object of length 3:
#> width seq names
#> [1] 233 GCAAGCGTTATCCGGATTTACTG...CGTTGAGGCTCGAAAGCGTGGGG ASV_30_Lachnospir...
#> [2] 233 GCAAGCGTTATCCGGATTTACTG...CGTTGAGGCTCGAAAGCGTGGGG ASV_451_UC5-1-2E3
#> [3] 233 GCAAGCGTTATCCGGATTTACTG...CGTTGAGGCTCGAAAGCGTGGGG ASV_586_CAG-56