raphaelvallat / pingouin

Statistical package in Python based on Pandas
https://pingouin-stats.org/
GNU General Public License v3.0
1.61k stars 138 forks source link

(Feature request) Implementations for pairwise partial correlation for compositional data #346

Closed jolespin closed 1 year ago

jolespin commented 1 year ago

Trying to reproduce the methodology in the following publication:

https://www.sciencedirect.com/science/article/pii/S2590197420300082

In particular, implementing pairwise partial correlations for compositional data. This is pretty powerful for any biological data that comes from a DNA/RNA sequencing machine.

Is there any pairwise implementation available with Pingouin?

raphaelvallat commented 1 year ago

Hi @jolespin,

I think this is too specific to be implemented in Pingouin (paper from 2020 with 20 citations). I see that you already have developed a Python package dedicated to compositional data (https://github.com/jolespin/compositional), why not implement it there? For reference, see also:

Thanks, Raphael

jolespin commented 1 year ago

Would the best way to implement pairwise partial correlation to just do a for loop between all pairs of features? Or is there a more efficient way you would recommend?

raphaelvallat commented 1 year ago

Pairwise partial correlation is already implemented in Pingouin in the https://pingouin-stats.org/build/html/generated/pingouin.pairwise_corr.html#pingouin.pairwise_corr function, which is indeed basically a for loop between all pairs of features. See also the https://pingouin-stats.org/build/html/generated/pingouin.pcorr.html#pingouin.pcorr function

raphaelvallat commented 1 year ago

Closing this, but feel free to reopen if needed