I want to revert a 20$\times$20 log odds (amino-acid) substitution matrix (log odds matrix $S$) back to its probabilities.
$S_{i,j} = \left(\frac{1}{\lambda}\right)\log_2{\left( \frac{p_{i,j}}{p_i\ \times\ p_j} \right)}$
$p_{i,j}$ is the substitution probability of two amino acids $i$ and $j$, and $p_i$ and $p_j$ are the background probabilities. The factor $\lambda$ is just a constant scaling factor.
Is it possible to transform the $S_{i,j}$ matrix to $p_{i,j}$, $p_i$, and $p_j$?
I tried something like this:
$p_i = \sum_{j=1}^{20} \left(2^{\frac{S_{i,j}}{\lambda}}\right)^{-1}$
But I do not get the right background probabilities back.