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
Refactor 3Di functionality
  • Loading branch information
padix-key committed Oct 16, 2024
commit 9384ebbea92857120f335a1b35a2e37eaece673e
33 changes: 3 additions & 30 deletions src/biotite/structure/alphabet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,10 @@
# information.

"""
NumPy port of the ``foldseek`` code for encoding structures to 3di.
A subpackage for converting structures to structural alphabet sequences.
"""

__name__ = "biotite.structure.alphabet"
__author__ = "Martin Larralde"
__all__ = ["Encoder", "StructureSequence", "to_3di"]
__author__ = "Martin Larralde, Patrick Kunzmann"

from .encoder import Encoder
from .sequence import StructureSequence

def to_3di(array):
r"""
Encode the atoms to the 3di structure alphabet.

Parameters
----------
atoms : AtomArray
The atom array to encode to 3di. All atoms must be part of
a single chain.

Returns
-------
sequence : StructureSequence
The encoded structure sequence.

Note
----
To encode atoms in different chains, use :func:`apply_chain_wise` to
return a list with one sequence per chain.
"""
encoder = Encoder()
sequence = StructureSequence()
sequence.code = encoder.encode_atoms(array).filled()
return sequence
from .i3d import *
Loading