Skip to content

Commit 0e76f34

Browse files
authored
Merge pull request #72 from CCPBioSim/63-conformational-entropy
Issue 63- Conformational Entropy Calculation. This merge closes #63 and resolves differences between the two versions of the code for aliphatic residues.
2 parents d06c3dd + 46c6f9d commit 0e76f34

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CodeEntropy/LevelFunctions.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ def get_dihedrals(data_container, level):
175175

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

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

CodeEntropy/main_mcc.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def main():
258258
S_trans = 0
259259
S_rot = 0
260260
S_conf = 0
261+
261262
for residue in range(num_residues):
262263
# molecule data container of MDAnalysis Universe type for internal
263264
# degrees of freedom getting indices of first and last atoms in the
@@ -269,10 +270,14 @@ def main():
269270
residue_container = MDAHelper.new_U_select_atom(
270271
molecule_container, selection_string
271272
)
273+
residue_heavy_atoms_container = MDAHelper.new_U_select_atom(
274+
residue_container, "not name H*"
275+
) # only heavy atom dihedrals are relevant
272276

273277
# Vibrational entropy at every level
274278
# Get the force and torque matrices for the beads at the relevant
275279
# level
280+
276281
force_matrix, torque_matrix = LF.get_matrices(
277282
residue_container,
278283
level,
@@ -342,11 +347,11 @@ def main():
342347
# Gives entropy of conformations within each residue
343348

344349
# Get dihedral angle distribution
345-
dihedrals = LF.get_dihedrals(residue_container, level)
350+
dihedrals = LF.get_dihedrals(residue_heavy_atoms_container, level)
346351

347352
# Calculate conformational entropy
348353
S_conf_residue = EF.conformational_entropy(
349-
residue_container,
354+
residue_heavy_atoms_container,
350355
dihedrals,
351356
bin_width,
352357
start,

0 commit comments

Comments
 (0)