Skip to content
Open
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
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ edition = "2018"
numpy = "0.27"
ndarray = "0.17"
num-traits = "0.2"
smallvec = "1"
itertools = "0.14"

[dependencies.pyo3]
version = "0.27"
Expand Down
2 changes: 1 addition & 1 deletion src/biotite/application/autodock/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import numpy as np
from biotite.application.application import AppState, requires_state
from biotite.application.localapp import LocalApp, cleanup_tempfile
from biotite.structure.bonds import find_connected
from biotite.structure.connect import find_connected
from biotite.structure.error import BadStructureError
from biotite.structure.io.pdbqt import PDBQTFile
from biotite.structure.residues import get_residue_masks, get_residue_starts_for
Expand Down
1 change: 1 addition & 0 deletions src/biotite/structure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
from .chains import *
from .charges import *
from .compare import *
from .connect import *
from .density import *
from .dotbracket import *
from .error import *
Expand Down
10 changes: 5 additions & 5 deletions src/biotite/structure/basepairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ class Edge(IntEnum):
This enum type represents the interacting edge for a given base.
"""

INVALID = (0,)
WATSON_CRICK = (1,)
HOOGSTEEN = (2,)
INVALID = 0
WATSON_CRICK = 1
HOOGSTEEN = 2
SUGAR = 3


Expand All @@ -305,8 +305,8 @@ class GlycosidicBond(IntEnum):
"""

INVALID = 0
CIS = (1,)
TRANS = (2,)
CIS = 1
TRANS = 2


def base_pairs_edge(atom_array, base_pairs):
Expand Down
67 changes: 67 additions & 0 deletions src/biotite/structure/bonds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.

__name__ = "biotite.structure"
__author__ = "Patrick Kunzmann"
__all__ = [
"BondList",
"BondType",
]

from enum import IntEnum
from biotite.rust.structure import BondList, bond_type_members


def _without_aromaticity(self):
"""
Get the non-aromatic counterpart of this bond type.

If this bond type is already non-aromatic, it is returned unchanged.

Returns
-------
BondType
The non-aromatic counterpart of this bond type.

Examples
--------
>>> BondType.AROMATIC_DOUBLE.without_aromaticity()
<BondType.DOUBLE: 2>
>>> BondType.SINGLE.without_aromaticity()
<BondType.SINGLE: 1>
"""
match self:
case BondType.AROMATIC_SINGLE:
return BondType.SINGLE
case BondType.AROMATIC_DOUBLE:
return BondType.DOUBLE
case BondType.AROMATIC_TRIPLE:
return BondType.TRIPLE
case BondType.AROMATIC:
return BondType.ANY
case _:
return self


# Create BondType IntEnum dynamically from Rust enum members
BondType = IntEnum(
"BondType",
{name: value for name, value in bond_type_members().items()},
module=__name__,
)
BondType.__doc__ = """
This enum type represents the type of a chemical bond.

- ``ANY`` - Used if the actual type is unknown
- ``SINGLE`` - Single bond
- ``DOUBLE`` - Double bond
- ``TRIPLE`` - Triple bond
- ``QUADRUPLE`` - A quadruple bond
- ``AROMATIC_SINGLE`` - Aromatic bond with a single formal bond
- ``AROMATIC_DOUBLE`` - Aromatic bond with a double formal bond
- ``AROMATIC_TRIPLE`` - Aromatic bond with a triple formal bond
- ``COORDINATION`` - Coordination complex involving a metal atom
- ``AROMATIC`` - Aromatic bond without specification of the formal bond
"""
BondType.without_aromaticity = _without_aromaticity
Loading
Loading