## 3 Methods
### Probability estimator for ranking of individual positions  
The estimator of the the joint probability in eq. (1) is defined as  
\[P_{p}(\alpha,i)\approx\tilde{P}_{p}(\alpha,i)\triangleq\sum_{\beta=1}^{24}f_{p}( \beta,i)m(\beta\rightarrow\alpha),\alpha=1..20 \tag{2}\]  
The equation above can be read as follows: the total probability to find amino acid \(\alpha\) at position \(p\) is given by the probability, approximated by \(f_{p}(\beta,i)\), to find an amino acid \(\beta\) at that position times the probability, \(m(\beta\rightarrow\alpha)\), that \(\alpha\) substitutes \(\beta\). Such a function thus describes the event \"a given amino acid, \(\alpha\), or a similar one, \(\beta\), occurs at position \(p\) and the protein belongs to class \(i\)\". The sum extends to 24 due to the possible presence in the alignment of non standard symbols such as B, Z, X, and of the gap symbol \"\(-\)\". In our applications, the symbols B, Z, and X are included in the definition of the probability above but they are left out of the space of the events since they bring in redundant information (i.e. we are only including mutually exclusive events). In actual calculations, \(f_{p}(\beta,i)\) is the relative frequency of occurrence of \(\beta\) in position \(p\) of a protein belonging to class \(i\). Bias of the overall alignment can be treated via a weighing procedure as suggested in [15]. The substitution probability \(m(\beta\rightarrow\alpha)\) is introduced with the intent to smooth the bare relative frequency of occurrence of amino acid \(\alpha\) at position \(p\) by taking into account residue substitutions occurring at that position weighted according to their similarity. This quantity can be defined in different ways. A natural choice, given its interpretation, is  
\[m(\beta\rightarrow\alpha)=\frac{q_{\beta,\alpha}}{\sum_{\lambda}q_{\beta, \lambda}} \tag{3}\]  
\(q_{\beta,\alpha}\) is closely related, in a sense that will be clear shortly, to the Clustered Target Frequencies matrix provided by the Blocks WWW Server, created by [PERSON]. It represents the probability of occurrence of two amino acids \(\alpha\) and \(\beta\) in the same column of a prototypical block alignment [11]. The importance of a smoothing scheme has been recognized and used in the past, most notably in SDPpred, the approach that we choose to benchmark the performance of our method. In this previous work, however, the substitution matrix is used in the log odds form and contains an _ad hoc_ parameter [2]. Our suggestion is parameter free and enables the right hand side of eq. 3 to be interpreted as an actual probability. Gaps, \"amino acid\" number \(24\) in the sum above, are treated according to the following prescriptions: a column in the alignment is neglected if more than \(30\%\) of its constituents are gaps. In the remaining cases, gaps are considered as an additional amino acid with substitution probabilities obtained by suitably enlarging and rescaling \(q_{\beta,\alpha}\). Namely, one row and column are added to this matrix, in such a way that the, fictitious, substitution probabilities toward gaps are proportional to the overall percentage of gaps in the alignment. Values of the substitution probability are determined accounting for the individual propensity (or resistance) of each amino acid to mutate, which is represented by the diagonal elements of the \(q_{\beta,\alpha}\) matrix. Finally, the extended matrix thus obtained is suitably normalized. We preferred this approach to alternatives in the literature, where, for instance, \(m(gap\to gap)=1\) and \(m(gap\rightarrow\alpha)=m(\alpha\to 0)\(gap)=0\)\(\forall\alpha\), since in this latter case the \"gapped\" positions present spuriously high levels of mutual information. Note that the above prescriptions ensure that:  
\[\sum_{i}\sum_{\alpha=1}^{20,24}\tilde{P}_{p}(\alpha,i)=1 \tag{4}\]  
(i.e. the probability to find any amino acid, or a gap, at a given position is one, as it should).