Teichlab / cellphonedb

MIT License
342 stars 105 forks source link

Modifying permutation statistic to reflect specificity #144

Closed vitkl closed 4 years ago

vitkl commented 4 years ago

I would like to modify the permutation statistic (currently mean(R1-L1) in cluster1-cluster2) to reflect specificity rather than expression level of genes. Specifically I would like to divide mean(R1-L1) in cluster1-cluster2 by the sum of mean(R1-L1) across all cluster pairs. A similar alternative would be to rescale averages of clusters before computing mean(R1-L1) in cluster1-cluster2 like: R1 in cluster1 / sum(R1) across all clusters. Any suggestions of where to start? E.i. which scripts actually implement the computation of this statistic? Thanks!

mvento commented 4 years ago

Hi @vitkl,

Here is where are the methods allocated: https://github.com/Teichlab/cellphonedb/tree/master/cellphonedb/src/core/methods

To be more specific, maybe you can check this file/function https://github.com/Teichlab/cellphonedb/blob/59ee4c8b09cc36c292f6138d735af67ab48ebc12/cellphonedb/src/core/methods/cpdb_statistical_analysis_helper.py#L252

Here, you can edit the current method. If you do it, please, feel free to share with us. We can try to add to the core CellPhoneDB project.

Best!