KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
66 stars 23 forks source link

Also problems with Mothur BIOM file #113

Closed noah472 closed 3 years ago

noah472 commented 3 years ago

Hi,

this problem was asked previously as question number 100 but no fix was found due to a lack of a reproducible example.

example.biom.zip

I am trying to load a biom file that I produced using mothur using the following settings:

make.biom(shared=path to shared, constaxonomy = taxonomy file) (I have tried both dense and sparse formats, and just the defaults).

I then try and use amp_import_biom and get the folliwing:

Error: Can't combine ..1$Kingdom and ..2$Kingdom .

Repex output:

library(ampvis2)

> Loading required package: ggplot2

biom_otutable <- amp_import_biom("data/mothur_biom_output.biom") #Convert the .shared and .taxonomy file into a biom file using mothur

> Error in biomformat::read_biom(file): Both attempts to read input file:

> data/mothur_biom_output.biom

> either as JSON (BIOM-v1) or HDF5 (BIOM-v2).

> Check file path, file name, file itself, then try again.

I have attached an example of the biom output that gives the error.

Thanks

KasperSkytte commented 3 years ago

Hi

Sorry for the late response. Thanks for the data, much easier to help out. The issue should now be fixed. It seems to be due to a change in dplyr::bind_rows and that the data only had 6 taxonomic levels, lacking species. Please also note that I have made the amp_import_biom() function defunct and instead just implemented it directly into amp_load(), so you simply run d <- amp_load("path/to/file.biom") instead of the rather clunky way with two functions.

noah472 commented 3 years ago

Awesome!! Thats great, all working fine now.

Very slick with the one command too.

Thanks!!