Skip to content

Conversation

@skfegan
Copy link
Member

@skfegan skfegan commented May 6, 2025

Summary

This is to fix errors when the slicing of trajectories occurs (MDAnalysis uses the end variable and then goes to frame end-1).

Changes

Adapting the end parameter to account for the whole trajectory as the default, but to give the expected frames and frame count when end is set to a positive integer.

Impact

This should give the correct results. In particular, it will avoid the problem of the dihedral angle appearing as 0 when there was a mismatch between the frames MDAnalysis included in the timesteps loop and the expected number of frames reducing the number of incorrect peaks in the histograms for the conformational entropy.

@skfegan skfegan linked an issue May 6, 2025 that may be closed by this pull request
@skfegan skfegan requested review from harryswift01 and jimboid May 6, 2025 16:08
Copy link
Contributor

@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 is a great fix for the slicing bug - it now correctly captures the full range of specified frames. The only small thing to tidy up is the length of the help string. Splitting it across multiple lines would keep it consistent with the rest of the code. Other than that, everything looks great!

@harryswift01 harryswift01 self-requested a review May 8, 2025 09:06
Copy link
Contributor

@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 all looks good to go now, thank you for this fix.

@harryswift01 harryswift01 merged commit 986c314 into main May 9, 2025
6 checks passed
@harryswift01 harryswift01 deleted the 86-indexing-error-in-creating-dihedral-histograms branch May 12, 2025 12:27
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.

Indexing error in creating dihedral histograms

3 participants