Skip to content

Commit 316f8d4

Browse files
committed
add arg to choose between axes schemes
1 parent 993f827 commit 316f8d4

3 files changed

Lines changed: 23 additions & 6 deletions

File tree

‎CodeEntropy/config/arg_config_manager.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@
8787
},
8888
"combined_forcetorque": {
8989
"type": bool,
90-
"help": """Use cobined force-torque matrix for residue
90+
"help": """Use combined force-torque matrix for residue
91+
level vibrational entropies""",
92+
"default": True,
93+
},
94+
"customised_axes": {
95+
"type": bool,
96+
"help": """Use bonded axes to rotate forces for UA
9197
level vibrational entropies""",
9298
"default": True,
9399
},

‎CodeEntropy/entropy.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def execute(self):
134134
number_frames,
135135
self._args.force_partitioning,
136136
self._args.combined_forcetorque,
137+
self._args.customised_axes,
137138
)
138139
)
139140

‎CodeEntropy/levels.py‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def get_matrices(
8686
force_matrix,
8787
torque_matrix,
8888
force_partitioning,
89+
customised_axes,
8990
):
9091
"""
9192
Compute and accumulate force/torque covariance matrices for a given level.
@@ -122,11 +123,11 @@ def get_matrices(
122123
# translation and rotation use different axes
123124
# how the axes are defined depends on the level
124125
axes_manager = AxesManager()
125-
if level == "united_atom":
126+
if level == "united_atom" and customised_axes:
126127
trans_axes, rot_axes, center, moment_of_inertia = (
127128
axes_manager.get_UA_axes(data_container, bead_index)
128129
)
129-
elif level == "residue":
130+
elif level == "residue" and customised_axes:
130131
trans_axes, rot_axes, center, moment_of_inertia = (
131132
axes_manager.get_residue_axes(data_container, bead_index)
132133
)
@@ -216,6 +217,7 @@ def get_combined_forcetorque_matrices(
216217
highest_level,
217218
forcetorque_matrix,
218219
force_partitioning,
220+
customised_axes,
219221
):
220222
"""
221223
Compute and accumulate combined force/torque covariance matrices for
@@ -252,7 +254,7 @@ def get_combined_forcetorque_matrices(
252254
# translation and rotation use different axes
253255
# how the axes are defined depends on the level
254256
axes_manager = AxesManager()
255-
if level == "residue":
257+
if level == "residue" and customised_axes:
256258
trans_axes, rot_axes, center, moment_of_inertia = (
257259
axes_manager.get_residue_axes(data_container, bead_index)
258260
)
@@ -558,6 +560,7 @@ def build_covariance_matrices(
558560
number_frames,
559561
force_partitioning,
560562
combined_forcetorque,
563+
customised_axes,
561564
):
562565
"""
563566
Construct average force and torque covariance matrices for all molecules and
@@ -675,6 +678,7 @@ def build_covariance_matrices(
675678
frame_counts,
676679
force_partitioning,
677680
combined_forcetorque,
681+
customised_axes,
678682
)
679683

680684
progress.advance(task)
@@ -696,6 +700,7 @@ def update_force_torque_matrices(
696700
frame_counts,
697701
force_partitioning,
698702
combined_forcetorque,
703+
customised_axes,
699704
):
700705
"""
701706
Update the running averages of force and torque covariance matrices
@@ -737,9 +742,11 @@ def update_force_torque_matrices(
737742
Dictionary holding the count of frames processed for each molecule/level
738743
combination.
739744
force_partitioning : float
740-
Factor to adjust force contributions, default is 0.5.
745+
Factor to adjust force contributions, default is 0.5.
741746
combined_forcetorque : bool
742-
Whether to use combined forcetorque covariance matrix.
747+
Whether to use combined forcetorque covariance matrix.
748+
customised_axes: bool
749+
Whether to use bonded axes for UA rovib calculations
743750
Returns
744751
-------
745752
None
@@ -772,6 +779,7 @@ def update_force_torque_matrices(
772779
None if key not in force_avg["ua"] else force_avg["ua"][key],
773780
None if key not in torque_avg["ua"] else torque_avg["ua"][key],
774781
force_partitioning,
782+
customised_axes,
775783
)
776784

777785
if key not in force_avg["ua"]:
@@ -806,6 +814,7 @@ def update_force_torque_matrices(
806814
else forcetorque_avg[key][group_id]
807815
),
808816
force_partitioning,
817+
customised_axes,
809818
)
810819

811820
if forcetorque_avg[key][group_id] is None:
@@ -833,6 +842,7 @@ def update_force_torque_matrices(
833842
else torque_avg[key][group_id]
834843
),
835844
force_partitioning,
845+
customised_axes,
836846
)
837847

838848
if force_avg[key][group_id] is None:

0 commit comments

Comments
 (0)