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

qiime import #496

Closed gtsiamis closed 9 years ago

gtsiamis commented 9 years ago

I am using qiime and I am trying t the moment to import files from qiime into phyloseq.

The problem that I am facing is that after importing a biom file, a map file and a tree file I am getting the following error

otufile = "otu_table_silva.biom" mapfile = "Fasting_Map.txt" trefile = "rep_set_tree.tre" qiimedata = import_qiime (otufile, mapfile, trefile) Processing map file... Processing otu/tax file... Reading file into memory prior to parsing... Detecting first header line... Header is on line -Inf
Converting input file to a table... Error in fread(input = paste0(x, collapse = "\n"), sep = "\t", header = TRUE, : 'skip' must be a length 1 vector of type numeric or integer >=-1, or single character search string In addition: Warning messages: 1: In readLines(file) : incomplete final line found on 'otu_table_silva.biom' 2: In max(which(substr(x[1:25L], 1, 1) == "#")) : no non-missing arguments to max; returning -Inf 3: In fread(input = paste0(x, collapse = "\n"), sep = "\t", header = TRUE, : NAs introduced by coercion

joey711 commented 9 years ago

import_qiime is for the original "legacy" qiime tab-delimited table. For biom files you should use import_biom. Or you can tell QIIME to make you a legacy table. Note the other outstanding issues derived from the change in file formats labeled .biom. The original was JSON, already supported in phyloseq. The new one is HDF5 based, also labeled .biom, and will be supported soon.

See the following for a workaround

https://github.com/joey711/biomformat