Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLePAPS structural alphabet #681

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add doctest
  • Loading branch information
padix-key committed Oct 16, 2024
commit edda6902a536d6f262f7e9c7ea1f864f8193cd2c
21 changes: 16 additions & 5 deletions src/biotite/structure/alphabet/i3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

class I3DSequence(Sequence):
"""
Representation of a structure in 3Di structural alphabet. :footcite:`VanKempen2024`
Representation of a structure in the 3Di structural alphabet.
:footcite:`VanKempen2024`

Parameters
----------
Expand All @@ -29,10 +30,15 @@ class I3DSequence(Sequence):
May take upper or lower case letters.
By default the sequence is empty.

See also
--------
to_3di : Create 3Di sequences from a structure.

References
----------

.. footbibliography::

"""

alphabet = LetterAlphabet(
Expand Down Expand Up @@ -78,29 +84,34 @@ def __repr__(self):


def to_3di(atoms):
r"""
"""
Encode each chain in the given structure to the 3Di structure alphabet.
:footcite:`VanKempen2024`

Parameters
----------
atoms : AtomArray
The atom array to encode. All atoms must be part of
a single chain.
The atom array to encode.
May contain multiple chains.

Returns
-------
sequences : list of Sequence, length=n
The encoded 3Di sequence for each peptide chain in the structure.

chain_start_indices : ndarray, shape=(n,), dtype=int
The atom index where each chain starts.

References
----------

.. footbibliography::

Examples
--------

>>> sequences, chain_starts = to_3di(atom_array)
>>> print(sequences[0])
DQQVVCVVCPNVVNVDHGDD
"""
sequences = []
chain_start_indices = get_chain_starts(atoms, add_exclusive_stop=True)
Expand Down
1 change: 1 addition & 0 deletions tests/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"biotite.structure.io.mol", ["biotite.structure", "biotite.structure.info"]
),
pytest.param("biotite.structure.info", ["biotite.structure"]),
pytest.param("biotite.structure.alphabet", ["biotite.structure"]),
pytest.param(
"biotite.database.entrez",
[],
Expand Down