jbisanz / qiime2R

Import qiime2 artifacts to R
MIT License
156 stars 53 forks source link

Getting an error while trying to creat a phyloseq object in R #27

Closed BioresearchBO closed 4 years ago

BioresearchBO commented 4 years ago

Hello all,

I am trying to create a phyloseq object but I am getting an error. I have searched different pages and forums but I couldn't find a solution for my problem. I would really appreciate it if anyone could help me out, please.

The codes that I am running in R are the following:

physeq <- qza_to_phyloseq( features = "table.qza", tree = "rooted_tree.qza", taxonomy = "taxonomy.qza", metadata = "metadata.tsv" )

And the error that I get is:

Error in methods::as(data[[i]], colClasses[i]) : no method or default for coercing “character” to “Categorical”

The metadata that I am using is the following: Screenshot from 2020-10-12 11-27-15

Thank you all.

jbisanz commented 4 years ago

Hmm, this is likely related to read_q2metadata(). I think the problem is that you have used a capital C on "Character". Looking at the [qiime2 metadata standards]((https://docs.qiime2.org/2020.8/tutorials/metadata/) I see that these column names are case insensitive and I will fix this in a future update. In the meanwhile, just switch to character and I suspect your problem will be solved.

zx8754 commented 4 years ago

Posted at SO:

BioresearchBO commented 4 years ago

Hmm, this is likely related to read_q2metadata(). I think the problem is that you have used a capital C on "Character". Looking at the [qiime2 metadata standards]((https://docs.qiime2.org/2020.8/tutorials/metadata/) I see that these column names are case insensitive and I will fix this in a future update. In the meanwhile, just switch to character and I suspect your problem will be solved.

Thanks very much. It worked.