Skip to content

Commit aebbd48

Browse files
committed
fix for building ua bead when customised_axes False and UA trans axes when customised_axes True
1 parent 2b2b3a9 commit aebbd48

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CodeEntropy/levels/axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def get_UA_axes(self, data_container, index: int, res_position):
225225
# only the one residue => use principal axes
226226
residue = data_container
227227
trans_center = data_container.atoms.center_of_mass(unwrap=True)
228-
trans_axes = data_container.atoms.principal_axes
228+
trans_axes = data_container.atoms.principal_axes()
229229
else:
230230
# residue of interest has at least one neighbour
231231
if res_position == -1:

CodeEntropy/levels/nodes/covariance.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def _process_united_atom(
223223
else:
224224
# only one residue
225225
res_position = None
226+
residue_group = res
226227
bead_key = (mol_id, "united_atom", local_res_i)
227228
bead_idx_list = beads.get(bead_key, [])
228229
if not bead_idx_list:
@@ -475,9 +476,12 @@ def _build_ua_vectors(
475476
if res_position == -1:
476477
# first residue in group
477478
residue = residue_group.residues[0]
478-
else:
479+
elif res_position == 0 or res_position == 1:
479480
# middle or last residue => second in group
480481
residue = residue_group.residues[1]
482+
else:
483+
# res_position is None bc there is only one residue
484+
residue = residue_group
481485
trans_axes = residue.atoms.principal_axes()
482486
rot_axes, moi = axes_manager.get_vanilla_axes(bead)
483487
center = bead.center_of_mass(unwrap=True)

0 commit comments

Comments
 (0)