sequences: DNA sequence associated with each taxonomic identifier.

Description Usage Arguments Value See Also Examples

Description

DNA sequence associated with each taxonomic identifier.

Usage

1
sequences(biom)

Arguments

biom

A BIOM object, as returned from read.biom.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
    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"))

rbiom documentation built on July 2, 2020, 1:47 a.m.