# Is MaAsLin2 reading features all at once?

**URL:** <https://forum.biobakery.org/t/is-maaslin2-reading-features-all-at-once/5821>\
**Category:** MaAsLin\
**Created:** [August 26, 2023, 7:44pm UTC](https://forum.biobakery.org/t/is-maaslin2-reading-features-all-at-once/5821 "2023-08-26T19:44:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nutribiomes](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nutribiomes](https://forum.biobakery.org/u/nutribiomes)\
**Post date:** [August 26, 2023, 7:44pm UTC](https://forum.biobakery.org/t/is-maaslin2-reading-features-all-at-once/5821/1 "2023-08-26T19:44:41Z")

</div>

Hello, I know that MaAsLin2 does not consider all features (dependent variables such as taxa) together in a single analysis. However, I am encountering an unusual problem:

1. I have one metadata file and two data files (data file 1 and data file 2).

2. The two data files have a number of dependent variables (taxa), some of which are unique to the data file 1 and data file 2, and a couple are the same dependent variable that is just present in both data file 1 and data file 2 (e.g., OTU\_Shannon).

3. When I use the same metadata against two different data files, I get different responses for associations between my metadata and the identical shared dependent variable (e.g., OTU\_Shannon).

My codes are below - does someone know what the issue may be here?

fit\_data = Maaslin2(  
input\_data = data\_file\_1,  
input\_metadata = metadata,  
output = “Energy”,  
analysis\_method = “LM”,  
normalization = “NONE”,  
standardize = TRUE,  
min\_prevalence = 0.1,  
min\_abundance = 0.001,  
plot\_heatmap = TRUE,  
fixed\_effects = c(“energy”))

fit\_data = Maaslin2(  
input\_data = data\_file\_2,  
input\_metadata = metadata,  
output = “Energy”,  
analysis\_method = “LM”,  
normalization = “NONE”,  
standardize = TRUE,  
min\_prevalence = 0.1,  
min\_abundance = 0.001,  
plot\_heatmap = TRUE,  
fixed\_effects = c(“energy”))

Again, the metadata is identical: “energy” is going up against data file 1 and data file 2, both of which have the same dependent variable (OTU\_Shannon) but also unique dependent variables (specific taxa). In data file 1, energy is associated with OTU\_Shannon, but when using data file 2 it is not.

---

<div class="post-metadata">

**Author:** ![nutribiomes](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nutribiomes](https://forum.biobakery.org/u/nutribiomes)\
**Post date:** [August 27, 2023, 1:06pm UTC](https://forum.biobakery.org/t/is-maaslin2-reading-features-all-at-once/5821/2 "2023-08-27T13:06:58Z")

</div>

Here’s another example looking at an amino acid from the metadata: again, the metadata used in association with data file 1 and data file 2 is identical, and OTU\_Observed is also identical between data file 1 and data file 2. Below, you will see I get different FDR’s even though you can see I am working with the exact same data points and exact same code. I also have a data file 3 with the same OTU\_Observed and that one doesn’t come up significant at all. Could the other taxa being different in each of these datasets be affecting the results?

 ![gln_1](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/b/be331a39726a704ad147492cdadd189d200e1414.png)  
 ![gln_2](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/a/a708388cee2891e9c8f3cadb396e731122b538da.png)

@andrewGhazi @himel.mallick @nearinj I would appreciate your help.

---

<div class="post-metadata">

**Author:** ![nutribiomes](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nutribiomes](https://forum.biobakery.org/u/nutribiomes)\
**Post date:** [August 27, 2023, 2:31pm UTC](https://forum.biobakery.org/t/is-maaslin2-reading-features-all-at-once/5821/3 "2023-08-27T14:31:26Z")

</div>

Update 3: I created test datasets mimicking the original data I was working with:

Metadata: energy  
Dataset 1: OTU\_Shannon, bifido, lacto  
Dataset 2: OTU\_Shannon, proteo, bacteroides, clostridium

OTU\_Shannon are identical to one another.

When running MaAslin2, energy is associated with OTU\_Shannon in dataset 1 but not in dataset 2. Can someone please explain why that is? I was under the impression that MaAslin2 examines the relationship between a specific metadata (energy) and each individual feature separately.

Thank you.

---

<div class="post-metadata">

**Author:** ![nearinj](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nearinj/32/2135_2.png) [@nearinj](https://forum.biobakery.org/u/nearinj)\
**Post date:** [August 28, 2023, 6:32pm UTC](https://forum.biobakery.org/t/is-maaslin2-reading-features-all-at-once/5821/4 "2023-08-28T18:32:14Z")

</div>

hi there,

It looks like the results are as expected given the coefficients are the same. The key thing to remember is that the q-value output is an FDR corrected p-value ([False discovery rate - Wikipedia](https://en.wikipedia.org/wiki/False_discovery_rate)). This means that the number of tests and the distribution of those p-values in each Maaslin run will impact the final q-values for each variable (even if they have the same coefficient and same p-values.

Hope that helps  
Cheers,  
Jacob Nearing
