diff --git a/CodeEntropy/config/arg_config_manager.py b/CodeEntropy/config/arg_config_manager.py index 607bf36..89987b4 100644 --- a/CodeEntropy/config/arg_config_manager.py +++ b/CodeEntropy/config/arg_config_manager.py @@ -25,7 +25,12 @@ }, "end": { "type": int, - "help": "Stop analysing the trajectory at this frame index", + "help": ( + "Stop analysing the trajectory at this frame index. This is " + "the frame index of the last frame to be included, so for example" + "if start=0 and end=500 there would be 501 frames analysed. The " + "default -1 will include the last frame." + ), "default": -1, }, "step": { diff --git a/CodeEntropy/main_mcc.py b/CodeEntropy/main_mcc.py index e3cdc61..caeadb8 100644 --- a/CodeEntropy/main_mcc.py +++ b/CodeEntropy/main_mcc.py @@ -127,13 +127,17 @@ def main(): if step is None: step = 1 # Count number of frames, easy if not slicing + # MDAnalysis trajectory slicing only includes up to end-1 + # This works the way we want it to if the whole trajectory is being included if start == 0 and end == -1 and step == 1: + end = len(u.trajectory) number_frames = len(u.trajectory) elif end == -1: end = len(u.trajectory) - number_frames = math.floor((end - start) / step) + 1 + number_frames = math.floor((end - start) / step) else: - number_frames = math.floor((end - start) / step) + 1 + end = end + 1 + number_frames = math.floor((end - start) / step) logger.debug(f"Number of Frames: {number_frames}") # Create pandas data frame for results