+
Skip to content

Exporting biom file with taxonomy from dada2 #6

@mdehollander

Description

@mdehollander

I would like to export/save the results of the dada2 demo workflow as biom file with the taxonomy as metadata.

I did that like this:

library(biomformat)
write_biom(make_biom(t(seqtab.nochim), observation_metadata=taxa), file.path("./", "dada2.biom"))

But get an error when loading it in phyloseq:

library(phyloseq)
import_biom("dada2.biom")
Error: $ operator is invalid for atomic vectors

Inspecting a biom file in json format generated with vsearch and the biom command line tool, I see some differences

A working biom file

"rows": [{"id": "OTU_934", "metadata": {"taxonomy": ["Eukaryota", "Opisthokonta", "Metazoa", "Nematoda", "Chromadorea", "Chromadorea_X", "*", "*"]}}

The exported biom file from dada2

rows":[{"id":"TACGGAGGATGCGAGCGTTATCCGGATTTATTGGGTTTAAAGGGTGCGCAGGCGGAAGATCAAGTCAGCGGTAAAATTGAGAGGCTCAACCTCTTCGAGCCGTTGAAACTGGTTTTCTTGAGTGAGCGAGAAGTATGCGGAATGCGTGGTGTAGCGGTGAAATGCATAGATATCACGCAGAACTCCGATTGCGAAGGCAGCATACCGGCGCTCAACTGACGCTCATGCACGAAAGTGTGGGTATCGAACAGG","metadata":["Bacteria","Bacteroidetes","Bacteroidia","Bacteroidales","Bacteroidales_S24-7_group",null]}

Would the differentce in formatting the metadata causes the above error? Is there somewhere an example on how to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载