Skip to content

Commit 93fca6c

Browse files
committed
Merge branch 'main' of https://github.com/CCPBioSim/CodeEntropy into 34-implement-python-logging
2 parents ccd80dd + 0e76f34 commit 93fca6c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CodeEntropy/calculations/LevelFunctions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ def get_dihedrals(data_container, level):
174174

175175
# if united atom level, read dihedrals from MDAnalysis universe
176176
if level == "united_atom":
177-
# only use dihedrals made of heavy atoms
178-
heavy_atom_group = data_container.select_atoms("not name H*")
179-
dihedrals = heavy_atom_group.dihedrals
177+
dihedrals = data_container.dihedrals
180178

181179
# if residue level, looking for dihedrals involving residues
182180
if level == "residue":

CodeEntropy/main_mcc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def main():
180180
S_trans = 0
181181
S_rot = 0
182182
S_conf = 0
183+
183184
for residue in range(num_residues):
184185
# molecule data container of MDAnalysis Universe type for internal
185186
# degrees of freedom getting indices of first and last atoms in the
@@ -191,10 +192,14 @@ def main():
191192
residue_container = MDAHelper.new_U_select_atom(
192193
molecule_container, selection_string
193194
)
195+
residue_heavy_atoms_container = MDAHelper.new_U_select_atom(
196+
residue_container, "not name H*"
197+
) # only heavy atom dihedrals are relevant
194198

195199
# Vibrational entropy at every level
196200
# Get the force and torque matrices for the beads at the relevant
197201
# level
202+
198203
force_matrix, torque_matrix = LF.get_matrices(
199204
residue_container,
200205
level,
@@ -247,11 +252,11 @@ def main():
247252
# Gives entropy of conformations within each residue
248253

249254
# Get dihedral angle distribution
250-
dihedrals = LF.get_dihedrals(residue_container, level)
255+
dihedrals = LF.get_dihedrals(residue_heavy_atoms_container, level)
251256

252257
# Calculate conformational entropy
253258
S_conf_residue = EF.conformational_entropy(
254-
residue_container,
259+
residue_heavy_atoms_container,
255260
dihedrals,
256261
bin_width,
257262
start,

0 commit comments

Comments
 (0)