cocoatree.statistics.pairwise.compute_entropy_correction

cocoatree.statistics.pairwise.compute_entropy_correction(coevolution_matrix, s)[source]

Computes the entropy correction according to Vorberg et al. (2018)

\[C_{ij}^{EC} = C_{ij} - \alpha s_{i}^{\frac{1}{2}} s_{j}^{\frac{1}{2}}\]

where \(\alpha\) is a coefficient determining the strength of the correction:

\[\alpha = \frac{\sum_{i \neq j}^{L} c_ij s_{i}^{\frac{1}{2}}}{\sum_{i \neq j}^{L} s_i s_j}\]

Arguments

coevolution_matrix : square matrix of shape (Nseq, Nseq)

s : entropy computed for every position of the MSA

Returns

a square matrix of shape (Nseq, Nseq)