openmmtools icon indicating copy to clipboard operation
openmmtools copied to clipboard

Demultiplexing RepEx trajectories

Open dlukauskis opened this issue 3 years ago • 6 comments

Hi, I'd like to use openmmtools's replica exchange code, but I can't see a way of actually demultiplexing the trajectories and having a look at them. Am I missing something? The docs don't address this point.

Thanks, Dom

dlukauskis avatar Oct 23 '20 19:10 dlukauskis

Hi @dlukauskis . The Repex facilities were ported from YANK, but unfortunately we forgot to carry over the utilities to handle the trajectories in the netcdf file. You can take a look at this function https://github.com/choderalab/yank/blob/master/Yank/analyze.py#L1036-L1202 .

andrrizzi avatar Oct 23 '20 20:10 andrrizzi

I gave the YANK code a try but I'm getting a metadata-related error:

  File "sim_extract_trj.py", line 32, in <module>
    replica_index=0)
  File "/home/dom/Projects/Playground/SAMS/demux_test/extract_trajectory.py", line 54, in extract_trajectory
    reference_system = mmtools.utils.deserialize(metadata['reference_state']).system
KeyError: 'reference_state'

Attaching a directory with the exact code I used - demux_test.zip

dlukauskis avatar Oct 26 '20 12:10 dlukauskis

Yes, that's because YANK stores some metadata with the reference system and the topology. You will have to modify those bits and provide your own OpenMM Topology object.

andrrizzi avatar Oct 28 '20 20:10 andrrizzi

This should solve the problem (until extract_trajectory will be ported to opemmtools):

https://github.com/simomarsili/mmdemux

simomarsili avatar Dec 03 '20 09:12 simomarsili

Thanks for sharing @simomarsili !

andrrizzi avatar Dec 10 '20 11:12 andrrizzi

@andrrizzi, Is demultiplexing now included in MultistateAnalyzer? I'm still fairly new to the openmm environment (and openmmtools as well), so didn't go through the MultiStateAnalyzer methods in detail before asking.

tanmoy7989 avatar May 20 '22 05:05 tanmoy7989