GraceYoon / SPRING

Semi-parametric Rank-Based Correlation and Partial Correlation Estimation for Quantitative Microbiome Data
22 stars 2 forks source link

single SPRING network from 2 (or more) independent compositions #2

Closed dcat4 closed 3 years ago

dcat4 commented 3 years ago

Hi there, thanks for the great SPRING package and paper.

I'm working with two independent compositional data sets, one of which is amplicon-based. We've actually imposed the composition constraint on the non-amplicon data (they're measured in absolute space), and are building networks from both sets of compositions as well as both sets of absolute abundance estimates based on scaling the amplicon data, so I think SPRING's ability to handle both data "types" is a good fit for this problem. Anyhow I'd like to construct a single network from both compositions using the SPRING method. If I'm understanding the method correctly, I think I should be able to modify your SPRING function to perform the mclr transformation independently on each independent composition, and then concatenate the independent mclr-transformed compositions and proceed as usual with the SPRING correlation and "mb" network construction.

Is it that simple or am I missing something?

P.S. if this approach would be of interest I can submit a pull request with the modified code - it's a very simple change, just supply a list of dataframes, then lapply SPRING::mclr, then cbind the transformed dataframes before moving on with the rest of the SPRING method.

irinagain commented 3 years ago

Hi, thanks for the suggestions. I am on break for now till 2nd half of June, but I will look more closely afterwards and let you know. I don't think we need to have a pull request, but again, let me look more closely later. Thanks!

muellsen commented 3 years ago

Hi Dylan, thanks for the comment and interest. Yes, this is a viable solution. What you are describing has been the core of the SPIEC-EASI method for multiple data sets, introduced here https://microbiomejournal.biomedcentral.com/articles/10.1186/s40168-017-0393-0 (see in the Methods part why this is a valid approach). There, only the standard clr is performed but apart from that, this is exactly your approach. Using SPRING should give you an additional benefit due to the improved correlation estimation! In parallel, we have also worked on extending SPRING and NetCoMi to allow this but I leave the pull request for this package up to Irina's decision.

dcat4 commented 3 years ago

Thank you both for the responses!

I realized you can also just SPRING::mclr both compositions, concatenate, and then SPRING::SPRING with quantitative = TRUE for the same result, which is probably simple enough such that a pull request is not needed (still happy to submit one if you'd like though). Thanks again!