Trouble Importing .biom Table to QIIME2

import
(Zachary Bendiks) #1

Hi, I have an ASV table that I exported from QIIME2, batch-corrected using the SVA package in R, and now I want to import the table back into QIIME2 for reanalysis. Unfortunately, I’ve run into an issue and I’m not sure how to deal with it. I’m currently using QIIME 2018.4.

biom convert -i SVA_corrected_table_dada2_batches_merged_no_controls_formatted.txt -o SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom --table-type=“OTU table” --to-json

qiime tools import
–input-path SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom
–type ‘FeatureTable[Frequency]’
–source-format BIOMV100Format
–output-path SVA_corrected_table_dada2_batches_merged_no_controls_formatted.qza

When I run the above code, I get the following error message:

File “/home/marcolabuser/miniconda3/envs/qiime2-2018.4/lib/python3.5/json/decoder.py”, line 357, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 4662605 (char 4662604)

An unexpected error has occurred:

Expecting value: line 1 column 4662605 (char 4662604)

See above for debug info.

This seems similar to what was posted here, but her error appeared in a different part of the file and the error was introduced by UNOISE. I haven’t used UNOISE with my data, so I’m wondering if something weird happened when I converted from .txt to .biom. I looked in both the .txt and .biom files but haven’t seen any obvious formatting issues. The files can be downloaded with my Google Drive links below:

Batch corrected .txt table: https://drive.google.com/open?id=1ZDAIlVic1sw9Lb1GNCn_xBg6fctV5FBa
Table after conversion to .biom format: https://drive.google.com/open?id=19ipz41yhNB71AwY2_SIIEHwpIOcSXQuB

Thanks for any help you can provide!

(Justine) #2

Hi @Zachary_Bendiks,

My suspicion is that you’ve got a Biom 2 table in JSON format, and not a biom 1. Do you have a --to-hdf5 flag on your import documentation? If so, you’ve got a biom 2 table and need to import that way.

Best,
Justine

(Zachary Bendiks) #3

Hi, thanks for the reply. Here is documentation for the import function

qiime tools import --help

Usage: qiime tools import [OPTIONS]

Import data to create a new QIIME 2 Artifact. See https://docs.qiime2.org/
for usage examples and details on the file types and associated semantic
types that can be imported.

Options:
–type TEXT The semantic type of the artifact that will be
created upon importing. Use --show-importable-
types to see what importable semantic types are
available in the current deployment. [required]
–input-path PATH Path to file or directory that should be
imported. [required]
–output-path PATH Path where output artifact should be written.
[required]
–source-format TEXT The format of the data to be imported. If not
provided, data must be in the format expected by
the semantic type provided via --type.
–show-importable-types Show the semantic types that can be supplied to
–type to import data into an artifact.
–show-importable-formats Show formats that can be supplied to --source-
format to import data into an artifact.
–help Show this message and exit.

I tried importing with the ‘–source-format BIOMV210Format’ flag but it gives an error saying my table is not BIOMV210. I also compared my table to the BIOMv1.0 and 2.1 specifications and it looks like a BIOMv1.0 table.

(Justine) #4

Could you try

biom convert -i SVA_corrected_table_dada2_batches_merged_no_controls_formatted.txt -o SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom --table-type=“OTU table” --to-hdf5

And then try importing it?

I haven’t dug deeply into the documentation, but my suspicion is that the biom 2 json isn’t reading correctly as a biom 1 table, but also isn’t being passed correctly as a biom 2 table.

(Zachary Bendiks) #5

Passing the --to-hdf5 flag during conversion and BIOMV100Format during import

biom convert -i SVA_corrected_table_dada2_batches_merged_no_controls_formatted.txt -o SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom --table-type=“OTU table” --to-hdf5

qiime tools import
–input-path SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom
–type ‘FeatureTable[Frequency]’
–source-format BIOMV100Format
–output-path SVA_corrected_table_dada2_batches_merged_no_controls_formatted.qza

There was a problem importing SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom:

SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom is not a(n) BIOMV100Format file

Passing the --to-hdf5 flag during conversion and BIOMV210Format during import

biom convert -i SVA_corrected_table_dada2_batches_merged_no_controls_formatted.txt -o SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom --table-type=“OTU table” --to-hdf5

qiime tools import
–input-path SVA_corrected_table_dada2_batches_merged_no_controls_formatted.biom
–type ‘FeatureTable[Frequency]’
–source-format BIOMV210Format
–output-path SVA_corrected_table_dada2_batches_merged_no_controls_formatted.qza

##runs without error, but the table isn’t viewable

qiime feature-table summarize
–i-table SVA_corrected_table_dada2_batches_merged_no_controls_formatted.qza
–o-visualization SVA_corrected_table_dada2_batches_merged_no_controls_formatted.qzv

Plugin error from feature-table:

max must be larger than min in range parameter.

(Matthew Ryan Dillon) assigned thermokarst #7
(Matthew Ryan Dillon) #8

Hey there @Zachary_Bendiks, I am not familiar with SVA, but, the table you attached above does not appear to be a FeatureTable[Frequency] - the values are all fractions. I suspect we don’t have a type on hand to accurately describe this type of feature table.

If I convert your txt file to HDF5, and import as BIOMV210Format, that table looks like this:

It imported just fine, however, I am not quite sure what you can do with it in QIIME 2…

1 Like
(Matthew Ryan Dillon) unassigned thermokarst #9
(Zachary Bendiks) #10

Thanks for your response @thermokarst . Do you mind sharing the code you used to convert the table to HDF5 and import the table into QIIME2? In my last post I attempted to do what you’ve shown (convert to HDF5 -> import as BIOMV210 -> visualize) but received an error at the visualization step.

(Matthew Ryan Dillon) #11

I ran the same steps as above, except I ran metadata tabulate, since the table isn’t actually FeatureTable[Frequency].

1 Like