Issue with Replica Index Mismatch During Demultiplexing in REST2 Simulations

GROMACS version:2022.5-plumed_2.9.0
GROMACS modification: Yes/No
Hello everyone,

I am performing REST2 simulations of my protein system using 16 replicas, with a total simulation time of 2 microseconds per replica. The full trajectory was generated in four segments, meaning the simulation was restarted three times.

While demultiplexing the trajectories, I noticed that the replica indices in the second segment start from 0, 1, 2, … as expected, and it does not follow the first replica index and appear with different index values. Because of this mismatch, I am unable to combine or demultiplex the full set of replicas properly.

Could you please advise how to resolve this issue or how to ensure consistent replica numbering across all segments?

Best regards,
Munazzah

A simple Python script would be sufficient here, assuming you know exactly which frame in the previous segment becomes the starting frame for the next segment. Something like:

prev_order = {n: val for n, val in enumerate(last_line_previous)}
new_order = [[prev_order[n] for n in line] for line in next_segment]

This way, if 5 is the 0th element in last_line_previous, all the 0s in next_segment will be replaced by 5s, and so on. (Note that I’m disregarding the extra time column.)