# Maaslin not the same results as spearman!

**URL:** <https://forum.biobakery.org/t/maaslin-not-the-same-results-as-spearman/4669>\
**Category:** MaAsLin\
**Created:** [January 18, 2023, 10:32am UTC](https://forum.biobakery.org/t/maaslin-not-the-same-results-as-spearman/4669 "2023-01-18T10:32:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nada\_Ezz](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nada_ezz/32/1894_2.png) [@Nada\_Ezz](https://forum.biobakery.org/u/Nada_Ezz)\
**Post date:** [January 18, 2023, 10:32am UTC](https://forum.biobakery.org/t/maaslin-not-the-same-results-as-spearman/4669/1 "2023-01-18T10:32:27Z")

</div>

I have an inquiry concerning the results of Maaslin2. I have split the metadata into categories to be able to correlate the BMI with the different taxonomic levels.  
this is my command for Maaslin2:  
fit\_data\_L7\_GenderGEOGROUPAGE\_8\_nomaxsig\<- Maaslin2( Metadata\_combinations2\_L7\_MaAslin\_R\_Taxonomy[,-1], Metadata\_combinations2\_L7\_GenderGEOGROUPAGE\_Maaslin\_male\_ismailia\_nonobese\_morethan5\_vs\_male\_ismailia\_obese\_morethan5[,-1], output = ‘demo\_output\_L7\_GenderGEOGROUPAGE\_8\_nomaxsig’)  
I have attached my input files and the significant results:

 ![L7 TAXONOMY](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/5/51f37f182c72546921f33831292544ba9b621ffc.png)  
 ![male ism obese vs nonobese significant results](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/3/31a83a01c9dc729729a5ccc6df0d57bf7f81c3f6.png)  
 ![male ism obese vs nonobese](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/a/a36a079a2bbc90702d7a5257e448c5df11ae6348.png)  
However, when I started a spearman correlation analysis, I have got completely opposite results; example  
As per Maaslin2, Cyanobacteria gives the coeef. -5.2 in the male obese population.  
As I understand, this means it exists in higher abundance in the non-obese male population. (Correct me if I am mistaken please)  
However, as per spearman correlation analysis, Cyanobacteria is negatively correlated with BMI giving me a value of -0.41  
this is my command for spearman correlation:  
corr\_L7\_BMI ← cor(Metadata\_combinations2\_L7\_Taxonomy\_plus\_BMIVALUE\_AGE\_transposed, method = “spearman”)  
corr\_L7\_BMI\_df ← as.data.frame(corr\_L7\_BMI)  
corr\_L7\_BMI\_pval ← cor\_pmat(corr\_L7\_BMI\_df), knowing that my input file for the correlation looks like the attached file below:  
 ![input file for spearman](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/6/6fb92a798aba75380b88f3076d3c391aa7ae3d94.png)

N.B: all of the results generated from Maaslin2 and spearman correlation are the opposite.

Regards,  
Nada Ezz

---

<div class="post-metadata">

**Author:** ![andrewGhazi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/andrewghazi/32/2950_2.png) [@andrewGhazi](https://forum.biobakery.org/u/andrewGhazi)\
**Post date:** [January 18, 2023, 3:40pm UTC](https://forum.biobakery.org/t/maaslin-not-the-same-results-as-spearman/4669/2 "2023-01-18T15:40:41Z")

</div>

It could be related to how you discretized your nonobese vs obese categories, how Maaslin is handling 0’s, or any number of things. Before going further with computing statistics, you should make a plot of the variables in question. The website below gives a basic introduction to plotting in R - try to adapt the flipper vs body mass example and make a plot of BMI vs Cyanobacteria. That should give you some insight into where the inconsistency is coming from.

[https://r4ds.hadley.nz/data-visualize.html](https://r4ds.hadley.nz/data-visualize.html)
