Pairwise comparisons

I have a rather basic question that I’d like to check my understanding on. For comparing conditions, I have a single fixed effect with levels A, B, and C. I can run MaAsLin2 with level A as the reference and see what taxa in B and C are different from A. If I want to essentially do pairwise comparisons and also learn what taxa in B and C are different from each other, as I understand it, I would re-run the analysis with level B (or C) as the reference. Is this correct?

To correct these p-values, I would just combine these results and do the BH correction on the original p-values, yes?

Is there anything wrong with this approach? Is there a better way to go about it?

Thanks for a great tool.

1 Like

Hi Jess

I was just wondering if you have got any answers for your question? This was exactly my question.

And in this case I was just wondering how we can creat one heat map instead of multiple ones? since I have many levels!

Cheers Rogi

Hi @Jess_Jarett That’s correct. I don’t see any issue as long as the p-values are adjusted for each pairwise comparison separately (see this for a related discussion by Gordon Smyth).

1 Like

Hi @roghaieh_ashrafi - this is currently not possible with the default MaAsLin 2 workflow. However, once you get the appropriately adjusted p-values and q-values (as stated above), you can use an external package like Complexheatmap or pheatmap to create a heatmap that includes all the individual comparisons in the same figure.

All the best,

1 Like

I have a related question. If we have a fixed effect with levels A1, A2, B1, B2 but we are interested only in contrasts A1-B1 and A2-B2. As one option we could simply split this into two separate analyses by splitting up samples ({A1+B1} and {A2+B2}). However, e.g. for Deseq2 it is recommended to do normalisation/shrinkage estimation on all samples, not only those contrasted, as this would lead to more robust estimates.
In this case we would still run two analyses (with all samples), with reference levels B1 and B2

What would you suggest for MaAsLin? And if we do not split the samples, how would the non-required comparisons A2-B1, B2-B1, A1-B2 affect the statistics (p-val, corrected p-val) for the A1-B1 and A2-B2?
Would we just need to extract the contrast of interest from all results and re-correct the p-values on this subset?

Thank you,

Hi @Sandro.Berlin - for DESeq2, the pipeline relies on an internal normalization scheme that impacts downstream performance, and skipping the normalization is usually not an option for the user. In MaAsLin 2, however, you can always normalize the data externally and pass the normalized data to run your analyses (by specifying normalization = "NONE").

Regarding your question on splitting the data vs. not, we are currently not equipped with user-defined contrast specifications which we plan to add in our next major release. In the event you do not split the data, the coefficient estimates and p-values are still based on the specific contrast of interest and they are not impacted by the presence of other non-required comparisons (the internal calculation in R is always based on the specific subset of the data). However, you may need to re-calculate the corrected p-values after subsetting to the specific contrast of interest which is easily doable by subsetting the relevant variable(s) of interest from the MaAsLin 2 results table and re-adjusting the corresponding p-values.

Let me know if that clarifies your question.

Best regards,

Thank you very much @himel.mallick! This clarifies everything!