Learn R Programming

rbiom (version 2.2.0)

export: Export data to QIIME 2 or mothur.

Description

Populates a directory with the following files, formatted according to QIIME 2 or mothur's specifications.

  • biom_counts.tsv

  • biom_metadata.tsv

  • biom_taxonomy.tsv

  • biom_tree.nwk

  • biom_seqs.fna

biom_counts.tsv will always be created. The others are dependent on whether the content is present in the biom argument.

Usage

write_mothur(biom, dir = tempfile(), prefix = "biom_")

write_qiime2(biom, dir = tempfile(), prefix = "biom_")

Value

The normalized directory path that was written to (invisibly).

Arguments

biom

An rbiom object, such as from as_rbiom(). Any value accepted by as_rbiom() can also be given here.

dir

Where to save the files. If the directory doesn't exist, it will be created. Default: tempfile()

prefix

A string to prepend to each file name. Default: 'biom_'

Examples

Run this code
    library(rbiom)
    
    tdir <- tempfile()
    
    write_qiime2(hmp50, tdir, 'qiime2_')
    write_mothur(hmp50, tdir, 'mothur_')
    
    list.files(tdir)
    
    readLines(file.path(tdir, 'qiime2_metadata.tsv'), n = 4)
    
    readLines(file.path(tdir, 'mothur_taxonomy.tsv'), n = 3)
    
    unlink(tdir, recursive = TRUE)

Run the code above in your browser using DataLab