write_greengenes: Write an imitation of the Greengenes database

View source: R/writers.R

write_greengenesR Documentation

Write an imitation of the Greengenes database

Description

Attempts to save taxonomic and sequence information of a taxmap object in the Greengenes output format. If the taxmap object was created using parse_greengenes, then it should be able to replicate the format exactly with the default settings.

Usage

write_greengenes(
  obj,
  tax_file = NULL,
  seq_file = NULL,
  tax_names = obj$get_data("taxon_names")[[1]],
  ranks = obj$get_data("gg_rank")[[1]],
  ids = obj$get_data("gg_id")[[1]],
  sequences = obj$get_data("gg_seq")[[1]]
)

Arguments

obj

A taxmap object

tax_file

(character of length 1) The file path to save the taxonomy file.

seq_file

(character of length 1) The file path to save the sequence fasta file. This is optional.

tax_names

(character named by taxon ids) The names of taxa

ranks

(character named by taxon ids) The ranks of taxa

ids

(character named by taxon ids) Sequence ids

sequences

(character named by taxon ids) Sequences

Details

The taxonomy output file has a format like:

228054  k__Bacteria; p__Cyanobacteria; c__Synechococcophycideae; o__Synech...
844608  k__Bacteria; p__Cyanobacteria; c__Synechococcophycideae; o__Synech...
...

The optional sequence file has a format like:

>1111886 
AACGAACGCTGGCGGCATGCCTAACACATGCAAGTCGAACGAGACCTTCGGGTCTAGTGGCGCACGGGTGCGTA...
>1111885 
AGAGTTTGATCCTGGCTCAGAATGAACGCTGGCGGCGTGCCTAACACATGCAAGTCGTACGAGAAATCCCGAGC...
...

See Also

Other writers: make_dada2_asv_table(), make_dada2_tax_table(), write_mothur_taxonomy(), write_rdp(), write_silva_fasta(), write_unite_general()


metacoder documentation built on April 4, 2023, 9:08 a.m.