mkt.databases.pssm.column_counts
- mkt.databases.pssm.column_counts(sequences: list[str], gap_chars: str = '-X', weights: list[float] | None = None) ndarray[source]
Per-column (weighted) residue counts for a set of aligned sequences.
The counts primitive underlying background-relative scoring: builds one length-20 count vector per alignment column (in
STR_AA20order) from any subset of aligned sequences, without instantiating a stateful analyzer. Gap/unknown characters ingap_chars(and any residue outsideSTR_AA20) are excluded. Optional per-sequenceweights(e.g.henikoff_weights()) generalize the raw counts to weighted counts;Nonereproduces the unweighted counts.- Parameters:
sequences (list[str]) – Aligned sequence strings of equal length.
gap_chars (str) – Characters treated as gap/unknown and excluded (default:
STR_GAP_CHARS).weights (list[float] | None) – Optional per-sequence weights (same length as
sequences);Noneweights every sequence equally (default: None).
- Returns:
(n_columns, 20)array of (weighted) residue counts inSTR_AA20order.- Return type:
np.ndarray