Skip to content

Conversation

@ioanaapapa
Copy link
Collaborator

Summary

This PR addresses issues related to the calculation of the conformational entropy at the united atom and residue levels and resolves the differences between results obtained using the current implementation of the theory at the united atom level and the implementation from the previous release. Differences for each type of residue, prior the commit, with terminal residues being isolated, are shown in the figure below. This PR closes #63
conformational_entropy_per_residue

Changes

Heavy atoms universe :

  • A new MDAnalysis universe is created, containing only the heavy atoms in a residue and this universe now represents the data_container argument for the get_dihedrals and conformational_entropy functions. Previously, the functions called an MDAnalysis universe containing all atoms within a residue and iterated
    per heavy atom in residue - hence, all dihedrals that the heavy atoms were involved in were found and taken into account.

Impact

  • Heavy atom-only dihedrals are now identified and taken into account for the conformational entropy calculation. Values obtained for aliphatic residues now match values obtained using the previous AEM implementation, as shown in the figure below.
    Sconf_per_residue_post_first_commit

Sconf_per_residue

  • In the previous implementation, terminal residues each had an additional dihedral, as shown in the figure below. These dihedrals coincide with backbone dihedrals, which are now accounted for by the residue level calculation.
terminal_residue_dihedrals
  • Previous implementation seems to sometimes double count some turning points for aromatic side chains that are rigid, as seen in the figure below for a phenylalanine. However, the aromatic rings are flipped as a result of the rotation about a different bond, not as a result of these dihedral adopting a new conformation so these conformations shouldn't be taken into account. Therefore, entropy of residues with aromatic side chains was much higher sometimes - this should be fine in the current new implementation and explains the difference observed for aromatic side chains.
old_aromatic_conformational_entropy_issue

Possible future considerations

  • Currently, the backbone entropy is estimated using the residue level calculation, which treats a whole residue as a bead and takes into account dihedrals consisting of four neighbouring residues. Backbone entropy could also be calculated using the phi and psi dihedrals, obtained using the corresponding MDAnalysis functions (https://userguide.mdanalysis.org/1.1.1/examples/analysis/structure/dihedrals.html). Results seem to be very close anyway.
Sconf_residue_level

…get_dihedrals and conformational_entropy functions so that MDAnalysis gives dihedrals only containing heavy atoms. Values obtained for aliphatic residue match the old code now. Some further investigation for aromatic residues is still required to confirm results obtained using this implementation.
…for non-hydrogen atoms within the function is no longer necessary
@ioanaapapa ioanaapapa added this to the WP7 - Refactor milestone Mar 20, 2025
Copy link
Member

@jimboid jimboid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks like it is matching the explainer in the PR. Very thorough analysis supporting this merger.

@skfegan
Copy link
Member

skfegan commented Mar 21, 2025

I agree with James. The explanation makes sense and the code looks like what I would expect.

Copy link
Member

@harryswift01 harryswift01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a very clean implementaion, thank you for going through so much detail in the PR comments its very nice to see, I'm happy to approve this.

@ioanaapapa ioanaapapa merged commit 0e76f34 into main Mar 21, 2025
6 checks passed
@ioanaapapa ioanaapapa deleted the 63-conformational-entropy branch March 21, 2025 19:04
@jimboid jimboid modified the milestones: WP7 - Refactor, 1.0.0 release Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conformational entropy differences between versions

5 participants