Skip to content

Commit e39c3d7

Browse files
committed
fixed calling get_custom_axes in get_non_terminal_axes and get_terminal_axes
2 parents fe1fd2e + 07b11d6 commit e39c3d7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎CodeEntropy/levels/axes.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,26 @@ def get_residue_axes(
7373
(previous/next in sequence) using MDAnalysis bonded selections.
7474
- If there are *no* bonds to other residues:
7575
* Use a custom principal axes, from a moment-of-inertia (MOI) tensor
76+
that uses positions of heavy atoms only, but includes masses of
7677
that uses positions of heavy atoms only, but includes masses of
7778
heavy atom + bonded hydrogens.
7879
* Set translational axes equal to rotational axes (as per the original
7980
code convention).
8081
8182
- If bonded to only one other residue:
83+
84+
- If bonded to only one other residue:
85+
* Translational axes are principal axes of data_container.
86+
* Find edge heavy atom (i.e. heavy atoms bonded to neighbour residue).
87+
Compute rotation centre and axes as in get_terminal_axes.
88+
custom MOI, using heavy atom positions and heavy atom + hydrogen masses.
89+
90+
- If bonded to at least two other residues:
8291
* Translational axes are principal axes of data_container.
92+
* Find edge heavy atoms (i.e. heavy atoms bonded to neighbour residues).
93+
Compute rotation centre and axes as in get_non_terminal_axes.
94+
Compute a custom MOI, using heavy atom positions and
95+
heavy atom + hydrogen masses.
8396
* Find edge heavy atom (i.e. heavy atoms bonded to neighbour residue).
8497
Compute rotation centre and axes as in get_terminal_axes.
8598
custom MOI, using heavy atom positions and heavy atom + hydrogen masses.
@@ -244,12 +257,18 @@ def get_UA_axes(self, data_container, index: int, res_position):
244257
only, but includes masses of heavy atom + bonded hydrogens.
245258
- If bonded to only one other residue, see get_terminal_axes.
246259
- If bonded to at least two other residues, see get_non_terminal_axes.
260+
- If there are *no* bonds to other residues, use a custom principal axes
261+
from a moment-of-inertia (MOI) tensor that uses positions of heavy atoms
262+
only, but includes masses of heavy atom + bonded hydrogens.
263+
- If bonded to only one other residue, see get_terminal_axes.
264+
- If bonded to at least two other residues, see get_non_terminal_axes.
247265
248266
- Rotational axes:
249267
Identify heavy atoms in the residue/molecule of interest and choose
250268
the `index`-th heavy atom (where index corresponds to the bead index).
251269
Use bonded topology around that heavy atom to determine UA rotational
252270
axes (see :meth:`get_bonded_axes`). Compute a custom MOI tensor.
271+
axes (see :meth:`get_bonded_axes`). Compute a custom MOI tensor.
253272
254273
Args:
255274
data_container (MDAnalysis.Universe or AtomGroup):
@@ -326,6 +345,7 @@ def get_UA_axes(self, data_container, index: int, res_position):
326345
)
327346
# look for heavy atoms in residue of interest
328347
residue_heavy_atoms = residue.atoms.select_atoms("mass 2 to 999")
348+
residue_heavy_atoms = residue.atoms.select_atoms("mass 2 to 999")
329349
heavy_atom_indices = []
330350
for atom in residue_heavy_atoms:
331351
heavy_atom_indices.append(atom.index)

0 commit comments

Comments
 (0)