-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
to_3di
helper function to obtain a StructureSequence
from an …
…`AtomArray`
- Loading branch information
Showing
4 changed files
with
47 additions
and
3,225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,34 @@ | |
NumPy port of the ``foldseek`` code for encoding structures to 3di. | ||
""" | ||
|
||
__all__ = ["Encoder", "FeatureEncoder", "PartnerIndexEncoder", "VirtualCenterEncoder"] | ||
__author__ = "Martin Larralde <[email protected]>" | ||
__name__ = "biotite.structure.alphabet" | ||
__author__ = "Martin Larralde" | ||
__all__ = ["Encoder", "StructureSequence", "to_3di"] | ||
|
||
from .encoder import Encoder, FeatureEncoder, PartnerIndexEncoder, VirtualCenterEncoder | ||
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 |
Oops, something went wrong.