joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
582 stars 187 forks source link

BIOM imports from QIIME tutorial page #1104

Open ctseto opened 5 years ago

ctseto commented 5 years ago

Pulling data from (https://docs.qiime2.org/2019.1/tutorials/importing/)

download.file("https://data.qiime2.org/2019.1/tutorials/importing/feature-table-v100.biom",destfile = "feature-table-v100.biom")

(And if I revert to standard vanilla phyloseq)

library('phyloseq');import_biom('feature-table-v100.biom')

Error in if (!object$type %in% biomtypevals) { : argument is of length zero

Checking if alterntaive biomformat importer works:

library('biomformat') packageVersion('biomformat') [1] ‘1.10.1’ read_biom("feature-table-v100.biom")

Error in if (!object$type %in% biomtypevals) { : argument is of length zero

I can import it with library(jsonlite) with fromJSON, but it mangles the count matrix, but metadata looks mostly intact.

spholmes commented 5 years ago

You might want to post this also to the github issues for the biomformat package as this is is what is working under the hood here: https://github.com/joey711/biomformat/issues

If you have more details about the file, in particular are there any stray

characters, that would help us debug this.

On Fri, Mar 29, 2019 at 8:42 AM Charlie Seto notifications@github.com wrote:

Pulling data from (https://docs.qiime2.org/2019.1/tutorials/importing/)

download.file(" https://data.qiime2.org/2019.1/tutorials/importing/feature-table-v100.biom",destfile = "feature-table-v100.biom")

(And if I revert to standard vanilla phyloseq)

library('phyloseq');import_biom('feature-table-v100.biom')

Error in if (!object$type %in% biomtypevals) { : argument is of length zero

Checking if alterntaive biomformat importer works:

library('biomformat') packageVersion('biomformat') [1] ‘1.10.1’ read_biom("feature-table-v100.biom")

Error in if (!object$type %in% biomtypevals) { : argument is of length zero

I can import it with library(jsonlite) with fromJSON, but it mangles the count matrix, but metadata looks mostly intact.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/1104, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJcvSb9oMJQ_ux2qRUA9m75rCcd1TYQks5vbjR_gaJpZM4cSrbq .

-- Susan Holmes John Henry Samter Fellow in Undergraduate Education Professor, Statistics 2017-2018 CASBS Fellow, Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/

nachishankar commented 5 years ago

I have the same issue. I export the biom file from Qiime2 -- Using that command...

biom add-metadata -i feature-table.biom -m MappingFile.csv -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy --output-as-json

I get the following error with both

import_biom("table-with-taxonomy.biom") -- > phyloseq
read_biom("table-with-taxonomy.biom") --> biomformat

ERROR MESSAGE Error in if (!object$type %in% biomtypevals) { : argument is of length zero

Please let me know if there is a solution to this.

nachishankar commented 5 years ago

I found the problem with my samples. I had to use

#Filter table - filter OTU table for samples with absolutely 0 counts of reads
qiime feature-table filter-samples --i-table table_MS.qza --p-min-features 1 --o-filtered-table table_filtered.qza

#export OTU table into biom format 
qiime tools export --input-path table_filtered.qza --output-path R_Analysis_V1

#Taxonomy.tsv file first line has been changed to #OTUID    taxonomy    confidence

#export the taxonomy into a .tsv format
qiime tools export --input-path taxonomy_MS.qza --output-path R_Analysis_V1

biom add-metadata -i R_Analysis_V1/feature-table.biom -o R_Analysis_V1/table-with-taxonomy.biom --observation-metadata-fp taxonomy.tsv --sc-separated taxonomy 

and this worked for me