biocore / American-Gut

American Gut open-access data and IPython notebooks
Other
108 stars 81 forks source link

Cannot import biom file in R #145

Closed arcys closed 8 years ago

arcys commented 9 years ago

I am new to biome file and try to download the biom here for testing. I have click and save the raw file into my hardisk and tried to open it in R using phyloseq and biom package but it returns :

"Error in fromJSON(content, handler, default.size, depth, allowComments, : invalid JSON input"

I have copied and paste an example url (https://github.com/biocore/American-Gut/blob/master/data/HMP/HMPv35_100nt.biom) to some jason validator on web but it return a error.

Would you instruct on some materials that I can start with working biom files from here? Thank you so much!

Regards, Carol

wasade commented 9 years ago

These BIOM tables conform to BIOM Format 2.1 spec. It looks like there is a discussion on the phyloseq tracker about updated support, see here:

https://github.com/joey711/phyloseq/issues/443

I am new to biome file and try to download the biom here for testing. I have click and save the raw file into my hardisk and tried to open it in R using phyloseq and biom package but it returns :

"Error in fromJSON(content, handler, default.size, depth, allowComments, : invalid JSON input"

I have copied and paste an example url ( https://github.com/biocore/American-Gut/blob/master/data/HMP/HMPv35_100nt.biom) to some jason validator on web but it return a error.

Would you instruct on some materials that I can start with working biom files from here? Thank you so much!

Regards, Carol

— Reply to this email directly or view it on GitHub https://github.com/biocore/American-Gut/issues/145.

ElDeveloper commented 9 years ago

As suggested in that thread, the best alternative at the moment would be to convert the tables to JSON-formatted files.

On (Apr-11-15|14:31), Daniel McDonald wrote:

These BIOM tables conform to BIOM Format 2.1 spec. It looks like there is a discussion on the phyloseq tracker about updated support, see here:

https://github.com/joey711/phyloseq/issues/443

I am new to biome file and try to download the biom here for testing. I have click and save the raw file into my hardisk and tried to open it in R using phyloseq and biom package but it returns :

"Error in fromJSON(content, handler, default.size, depth, allowComments, : invalid JSON input"

I have copied and paste an example url ( https://github.com/biocore/American-Gut/blob/master/data/HMP/HMPv35_100nt.biom) to some jason validator on web but it return a error.

Would you instruct on some materials that I can start with working biom files from here? Thank you so much!

Regards, Carol

— Reply to this email directly or view it on GitHub https://github.com/biocore/American-Gut/issues/145.


Reply to this email directly or view it on GitHub: https://github.com/biocore/American-Gut/issues/145#issuecomment-91929001

arcys commented 9 years ago

Thank you very much! It seems works!

However, I've tried to convert the biom file downloaded to the txt format and it shows the following:

biom convert -i HMPv35_100ntj.biom -o HMPv35_100nt_tab.txt --table-type "otu table" Traceback (most recent call last): File "/usr/bin/pyqi", line 184, in optparse_main(cmd_obj, argv[1:]) File "/usr/lib/python2.7/site-packages/pyqi/core/interfaces/optparse/init.py", line 275, in optparse_main result = optparse_cmd(local_argv[1:]) File "/usr/lib/python2.7/site-packages/pyqi/core/interface.py", line 39, in call cmd_result = self.CmdInstance(cmd_input) File "/usr/lib/python2.7/site-packages/pyqi/core/command.py", line 137, in call result = self.run(kwargs) File "/usr/lib/python2.7/site-packages/biom/commands/table_converter.py", line 219, in run raise CommandError(convert_error_msg) pyqi.core.exception.CommandError: Input does not look like a classic table. Did you forget to specify that a classic table file should be created from a BIOM table file?

It seems that the BIOM table file is not a classic one, how can I solve this? Thanks a lot!

wasade commented 9 years ago

Are you using biom v 1.3.1 for the conversion? If so, then you will not be able to convert a biom 2.x file. For instance, I was able to run the following just now:

$ biom convert --version
Version: biom convert 2.1.3-dev
$ biom convert -i AG.biom -o AG.biom1x --to-json --table-type='OTU table'

I'd be happy to host 1.x formatted tables on ftp.microbio.me but not within the Github repository as it is already hosting more data than it really ought to be.

wasade commented 8 years ago

@arcys, is this still an issue or can this be closed?

arcys commented 8 years ago

It is done, thx!

On Fri, Oct 23, 2015 at 1:17 AM, Daniel McDonald notifications@github.com wrote:

@arcys https://github.com/arcys, is this still an issue or can this be closed?

— Reply to this email directly or view it on GitHub https://github.com/biocore/American-Gut/issues/145#issuecomment-150295265 .

wasade commented 8 years ago

Thanks!