sequences {rbiom} | R Documentation |
DNA sequence associated with each taxonomic identifier.
Description
DNA sequence associated with each taxonomic identifier.
Usage
sequences(biom)
Arguments
biom |
A |
Value
A named character vector of sequences in biom
. If this data
is not present, then returns NULL
.
See Also
Other accessor functions:
counts()
,
info()
,
metadata()
,
nsamples()
,
ntaxa()
,
phylogeny()
,
sample.names()
,
taxa.names()
,
taxa.ranks()
,
taxonomy()
Examples
library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
sequences(biom)[1:4]
# Write to a compressed fasta file in the temporary directory:
seqs <- sequences(biom)
conn <- bzfile(file.path(tempdir(), "Sequences.fa.bz2"), "w")
cat(sprintf(">%s\n%s", names(seqs), seqs), file=conn, sep="\n")
close(conn)
# You can also use the write.fasta function for this task:
write.fasta(biom, file.path(tempdir(), "Sequences.fa.gz"))
[Package rbiom version 1.0.3 Index]