PBSSCOREMATRIX(1)
π PBSSCOREMATRIX β bestie edition π
okay so this is the manual page for pbsScoreMatrix, section 1 (User Commands), and I need you to lock in because it's lowkey giving "math class but make it fashion". β¨
πΈ NAME πΈ
pbsScoreMatrix β Generate log-odds score matrices for use in alignment of
(yes bestie, the sentence just ends there, we don't make the rules, we just vibe with it π)
β¨ DESCRIPTION β¨
So the whole point: we generate log-odds score matrices for use in alignment of probabilistic biological sequences (PBSs, iykyk). By default it generates a matrix for every branch of the tree (as defined in tree.mod), but it can also generate a matrix for a given branch length (see --branch-length). For a code size of N, an N x N matrix is generated by default; --half-pbs will produce an N x 4 matrix, and --no-pbs will produce a 4 x 4 matrix (assuming a four-character nucleotide alphabet). π§¬
Two sequences are assumed to have evolved from a common ancestor by a reversible continuous-time Markov substitution process, and to be separated by a branch of length t. The conditional probability of a base j in one sequence given a base i in the other, P(j | i, t) is given by element (i, j) of the matrix
P(t) = exp(Qt)
where Q is the rate matrix defining the substitution process, and element (i, j) of Q is the instantaneous rate at which base i changes to base j. π
Let S_t(i, j) be a log odds score for the alignment of two bases, i and j, based on P(t):
S_t(i, j) = log P(i, j | t) / (pi(i) * pi(j))
= log P(j | i, t) pi(i) / (pi(i) * pi(j))
= log P(j | i, t) / pi(j) (1)
where pi(x) is the "equilibrium" or "background" probability of base x. Because of reversibility, S(i, j) = S(j, i), and the S(i, j) form a symmetric 4 x 4 matrix. That's the matrix that gets generated by pbsScoreMatrix with the --no-pbs option. π
If each "letter" in each sequence represents a probability distribution over bases, as in a PBS, then the score for two letters k and l can be shown to be
S'_t(k, l) = log sum_i sum_j p_k(i) p_l(j) exp S_t(i, j) (2)
where the two sums are over the four bases, p_k(i) is the probability of base i under the distribution for k, and p_l(j) is the probability of base j under the distribution for l. π¦
Notice that (2) reduces to (1) when p_k(i) = p_l(j) = 1 for some i and j and for all other i' and j' p_k(i') = p_l(j') = 0 (i.e., when all of the probability mass is on a single base in both distributions and the PBS reduces to an ordinary nucleotide sequence). The special case of p_l(j) = 1 only is also of interest when aligning a PBS and a nucleotide sequence:
S''_t(k, j) = log sum_i p_k(i) exp S_t(i, j) (3)
This is the matrix generated by pbsScoreMatrix with the --half-pbs option. π
β οΈ Note: all logs are base 2. no cap.
π₯ EXAMPLE π₯
Generate an N x N matrix for every branch of the tree, using a code file "code" (generated by pbsTrain) and a tree model file "mytree.mod" (generated by phyloFit):
pbsScoreMatrix mytree.mod code > matrices.dat
Generate an N x N matrix for a branch length of 0.2 expected substitutions per site.
pbsScoreMatrix --branch-length 0.2 mytree.mod code > matrix.dat
Generate an N x 4 matrix:
pbsScoreMatrix --branch-length 0.2 --half-pbs mytree.mod code >
matrix.dat
Generate a 4 x 4 matrix:
pbsScoreMatrix --branch-length 0.2 --no-pbs code mytree.mod >
matrix.dat
(In this case, a code file is not needed.) π iconic behavior honestly
π OPTIONS π
--branch-length,-t<length> β Output a matrix for a branch of the specified length, rather than a matrix for every branch of the tree. The given length must be non-negative and in units of expected substitutions per site. π--half-pbs,-Hβ Output an N x 4 matrix, as described above. β¨--no-pbs,-Nβ Output a 4 x 4 matrix, as described above. With this option, a code file is not needed. π«Ά--help,-hβ Show this help message. π
that's the whole page bestie, you ate it up π§
this was pbsScoreMatrix version 1.4, dated May 2016 β go forth and align, mwah π
π
π¦ where this page comes from
- debian bookworm: phast 1.6+dfsg-3+b1 Β· BSD-3-Clause
- debian trixie: phast 1.7+dfsg-2 Β· BSD-3-Clause
- ubuntu jammy: phast 1.6+dfsg-3 Β· BSD-3-Clause
- ubuntu noble: phast 1.6+dfsg-4 Β· BSD-3-Clause
- ubuntu questing: phast 1.7+dfsg-3
- ubuntu resolute: phast 1.8+dfsg-1 Β· BSD-3-Clause
- ubuntu stonking: phast 1.8+dfsg-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms