Calculates the mutual information (MI) from a multiple sequence alignemnt. Contributions of each pair of amino-acids are weighted using the matrix **weights** (weighted mutual information). The average product correction (**apc_correction**) correction and transformation into Z-scores (**zpx_transofrmation**) increase prediciton accuracy by reducing the effect of phylogeny and other noise sources. The small number correction reduces noise for alignments with small number of sequences of low diversity.
:param aln: The multiple sequences alignment
:type aln: :class:`~ost.seq.AlignmentHandle`
:param weights: The weight matrix
:type weights: :class`ContactWeightMatrix`
:param apc_correction: Whether to use the APC correction
:type apc_correction: :class:`bool`
:param zpx_transformation: Whether to transform the scores into Z-scores
:type zpx_transformation: :class:`bool`
:param small_number_correction: initial values for the probabilities of having a given pair of amino acids *p(a,b)*.
Calculates the Contact Score (*CoSc*) from a multiple sequence alignment. For each pair of residues *(i,j)* (pair of columns in the MSA), *CoSc(i,j)* is the average over the values of the **weights** corresponding to the amino acid pairs in the columns.
Calculates the Contact Substitution Score (*CoEvoSc*) from a multiple sequence alignment. For each pair of residues *(i,j)* (pair of columns in the MSA), *CoEvoSc(i,j)* is the average over the values of the **weights** corresponding to substituting the amino acid pair in the reference sequence (given by **ref_seq_index**) with all other pairs in columns *(i,j)* of the **aln**.
:param aln: The multiple sequences alignment
:type aln: :class:`~ost.seq.AlignmentHandle`
:param weights: The pair substitution weight matrix
:type weights: :class`ContactWeightMatrix`
.. function:: LoadDefaultContactWeightMatrix()
:returns: *CPE*, a :class:`ContactWeightMatrix` that was calculated from a large (>15000) set of
high quality crystal structures as *CPE=log(CF(a,b)/NCF(a,b))* and then normalised so that all its elements are comprised between 0 and 1. *CF(a,b)* is the frequency of amino acids *a* and *b* for pairs of contacting residues and *NCF(a,b)* is the frequency of amino acids *a* and *b* for pairs of non-contacting residues. Apart from weights for the standard amino acids, this matrix gives a weight of 0 to all pairs for which at least one amino-acid is a gap.
.. function:: LoadConstantContactWeightMatrix()
:returns: A :class:`ContactWeightMatrix`. This matrix gives a weight of one to all pairs of
standard amino-acids and a weight of 0 to pairs for which at least one amino-acid is a gap.
.. function:: LoadDefaultPairSubstWeightMatrix()
:returns: *CRPE*, a :class:`PairSubstWeightMatrix` that was calculated from a large (>15000) set of
high quality crystal structures as *CRPE=log(CRF(ab->cd)/NCRF(ab->cd))* and then normalised so that all its elements are comprised between 0 and 1. *CRF(ab->cd)* is the frequency of replacement of a pair of amino acids *a* and *b* by a pair *c* and *d* in columns of the MSA corresponding to contacting residues and *NCRF(ab->cd)* is the frequency of replacement of a pair of amino acids *a* and *b* by a pair *c* and *d* in columns of the MSA corresponding to non-contacting residues. Apart from weights for the standard amino acids, this matrix gives a weight of 0 to all pair substitutions for which at least one amino-acid is a gap.