Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/apidoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,13 @@
"biotite.structure.alphabet" : {
"Structural alphabets": [
"I3DSequence",
"ProteinBlocksSequence"
"ProteinBlocksSequence",
"ClepapsSequence"
],
"Conversion Function": [
"to_3di",
"to_protein_blocks"
"to_protein_blocks",
"to_clepaps"
]
}
}
15 changes: 15 additions & 0 deletions doc/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,21 @@ @article{Varadi2024
doi = {10.1093/nar/gkad1011}
}

@article{Wang2008,
title = {{{CLePAPS}}: {{FAST PAIR ALIGNMENT OF PROTEIN STRUCTURES BASED ON CONFORMATIONAL LETTERS}}},
shorttitle = {{{CLePAPS}}},
author = {Wang, Sheng and Zheng, Wei-Mou},
year = {2008},
month = apr,
journal = {Journal of Bioinformatics and Computational Biology},
volume = {06},
number = {02},
pages = {347--366},
publisher = {World Scientific Publishing Co.},
issn = {0219-7200},
doi = {10.1142/S0219720008003461}
}

@article{Westbrook2015,
title = {The Chemical Component Dictionary: Complete Descriptions of Constituent Molecules in Experimentally Determined {{3D}} Macromolecules in the {{Protein Data Bank}}},
shorttitle = {The Chemical Component Dictionary},
Expand Down
45 changes: 45 additions & 0 deletions src/biotite/sequence/align/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class SubstitutionMatrix(Generic[S1, S2]):

- **3Di** - For 3Di alphabet from ``foldseek`` :footcite:`VanKempen2024`
- **PB** - For Protein Blocks alphabet from *PBexplore* :footcite:`Barnoud2017`
- **CLESUM** - For CLePAPS alphabet :footcite:`Wang2008`

A list of all available matrix names is returned by
:meth:`list_db()`.
Expand Down Expand Up @@ -630,6 +631,50 @@ def std_protein_blocks_matrix(
matrix_dict,
)

@staticmethod
@functools.cache
def std_clepaps_matrix(
unknown_match: int = 200, unknown_mismatch: int = -200
) -> SubstitutionMatrix[str, str]:
"""
Get the *CLESUM* substitution matrix for *CLePAPS* sequence.
:footcite:`Wang2008`

Parameters
----------
unknown_match, unknown_mismatch : int, optional
The match and mismatch score for the unknown symbol.
The default values were chosen arbitrarily, but are in the order of
magnitude of the other score values.

Returns
-------
matrix : SubstitutionMatrix
Default matrix.

References
----------

.. footbibliography::
"""
from biotite.structure.alphabet.clepaps import ClepapsSequence

alphabet = ClepapsSequence.alphabet
unknown_symbol = ClepapsSequence.unknown_symbol
matrix_dict = SubstitutionMatrix.dict_from_db("CLESUM")
# Add match/mismatch scores for the unknown symbol
for symbol in alphabet:
if symbol == unknown_symbol:
continue
matrix_dict[symbol, unknown_symbol] = unknown_mismatch
matrix_dict[unknown_symbol, symbol] = unknown_mismatch
matrix_dict[unknown_symbol, unknown_symbol] = unknown_match
return SubstitutionMatrix(
alphabet,
alphabet,
matrix_dict,
)

def _fill_with_matrix_dict(self, matrix_dict: dict[tuple[Any, Any], int]) -> None:
self._matrix = np.zeros((len(self._alph1), len(self._alph2)), dtype=np.int32)
for i in range(len(self._alph1)):
Expand Down
19 changes: 19 additions & 0 deletions src/biotite/sequence/align/matrix_data/CLESUM.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# CLESUM: The conformation letter substitution matrix from the CLePAPS paper
A B C D E F G H I J K L M N O P Q
A 73 20 13 -17 -25 -20 -6 -45 -31 -23 -19 -11 -2 10 25 35 16
B 20 51 7 13 15 7 13 -96 -74 -57 -50 -12 -13 -11 -12 42 12
C 13 7 53 21 3 20 -4 -77 -56 -43 -33 0 -12 -5 3 4 29
D -17 13 21 52 22 21 -31 -124 -105 -88 -81 -22 -49 -44 -42 -10 14
E -25 15 3 22 36 26 -22 -127 -108 -93 -84 -21 -47 -43 -48 -5 -6
F -20 7 20 21 26 50 -5 -107 -88 -73 -69 -16 -33 -32 -30 0 3
G -6 13 -4 -31 -22 -5 69 -51 -34 -21 -13 29 21 -8 -1 5 8
H -45 -96 -77 -124 -127 -107 -51 23 18 13 5 -62 -4 -34 -55 -60 -87
I -31 -74 -56 -105 -108 -88 -34 18 23 16 21 -41 1 -11 -34 -49 -62
J -23 -57 -43 -88 -93 -73 -21 13 16 37 13 -32 16 -2 -24 -34 -44
K -19 -50 -33 -81 -84 -69 -13 5 21 13 49 -1 12 28 5 -36 -24
L -11 -12 0 -22 -21 -16 29 -62 -41 -32 -1 74 5 8 -4 -12 26
M -2 -13 -12 -49 -47 -33 21 -4 1 16 12 5 61 7 5 8 -7
N 10 -11 -5 -44 -43 -32 -8 -34 -11 -2 28 8 7 90 15 -3 32
O 25 -12 3 -42 -48 -30 -1 -55 -34 -24 5 -4 5 15 104 4 -13
P 35 42 4 -10 -5 0 5 -60 -49 -34 -36 -12 8 -3 4 66 7
Q 16 12 29 14 -6 3 8 -87 -62 -44 -24 26 -7 32 -13 7 90
1 change: 1 addition & 0 deletions src/biotite/structure/alphabet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
__name__ = "biotite.structure.alphabet"
__author__ = "Martin Larralde, Patrick Kunzmann"

from .clepaps import *
from .i3d import *
from .pb import *
Loading
Loading