zellerlab / siamcat

R package for Statistical Inference of Associations between Microbial Communities And host phenoType
https://siamcat.embl.de/
51 stars 16 forks source link

Error when running check.associations #22

Closed alex-d13 closed 3 years ago

alex-d13 commented 3 years ago

Hi, I want to run check.associations on my data and get the following error:

Error in check.associations(s.obj, fn.plot = NULL) : This function expects compositional data. Exiting...

My s.obj looks like this:

siamcat-class object
label()                Label object:         197 rest and 69 severe samples
filt_feat()            Filtered features:    1758 features after abundance filtering

contains phyloseq-class experiment-level object @phyloseq:
phyloseq@otu_table()   OTU Table:            [ 1766 taxa and 266 samples ]
phyloseq@sam_data()    Sample Data:          [ 266 samples by 32 sample variables ]

Here is my OTU table: https://www.dropbox.com/s/6b50yjnpy2udz5b/rel_abund.tsv?dl=0

Can you help me what is the issue here? Cheers, Alex

jakob-wirbel commented 3 years ago

Hi Alex,

Thank you for your question! I can imagine that other people might have the same problem

I looked into your dataset and you seem to have percentages of taxa (each sample sums up to 100). SIAMCAT expects relative abundances (each sample sums up to 1). Either, you divide each column in your input matrix by 100 or you can use the prop.table function in R:

feat.rel <- prop.table(feat, 2)

I hope this clears it up :) Cheers, Jakob