delemottelab / string-method-swarms-trajectories Goto Github PK
View Code? Open in Web Editor NEWA python implementation of the string method with swarms of trajectories using GROMACS
License: MIT License
A python implementation of the string method with swarms of trajectories using GROMACS
License: MIT License
Given two endpoints and an optional pathway, run steered MD between them. If not pathway is present, interpolate a straight path.
I think this can be useful for ensemble simulations in general
Now we perform the string method one step at the time. For example, all grompp calls have to finish before any mdrun call starts. All restrained simus need to finish before any swarm simu starts. It would be more computationally efficient if we add the new jobs to the work queue as soon as the blocking step has finished. In my plumed-based version of the string code I managed this by having a Job class that the queue handles. The job has a list of jobs that should be sumbitted once it's finished. So the StringRunner would conifgure all jobs and their dependencies, then invoke the Master-Slave MPI wokers only once per iteration.
This is especially useful if the number of points on the string is not divisible by the number of worker MPI ranks.
Hello Oliver,
How is the rate of pulling determined? Does it just depend on the number of steps in steered.mdp?
Thanks,
Sergio
Hi all,
When running examples/start-up/string_check.ipynb
, one of the lines package-loading includes:
import src.analysis as spc
This package includes functions like: strings_time_series
, rmsd_strings_time_series
, strings_to_SF_IG
. However, this package does not seem to be included in the Github project. Am I missing something?
files to create
To keep
Files to remove
Make this a script that you can call from the command line with the iterations to clean and compress as optional arguments.
After running the alanine dipeptide example, two issues come up:
For dihedral angles which have a good margin to the periodic boundaries this is not a problem.
One workaround during postprocessing is to convert every angle to two variables by taking the sine and cosine. This does not work in the pull code atm though.
Hello,
Do you need the end.gro for steered simulations? In the documentation only start.gro is mentioned. I guess you could avoid needing it but then you should add some keywords in steered.mdp which is not documented.
Thanks!
Sergio
Hi,
In the alanine dipeptide example, six string files with different numbers of points and chosen CVs are presented .
I can see that string0_radians.txt is the selected Phi and Psi in the unit of radian, and string0_radians_scaled.txt seems to be the linear transformation of string0_radians.txt from [-pi, pi] to [0, 1] (which I suppose is not for direct use in simulation run), while the other four string files clearly use different expressions of CVs.
I wonder what are the CV expressions of these string files, and how should we modify the config correspondingly in order to use them to see the effect of changing number of points? Also, maybe it's helpful to add some more documentations to describe their usage :).
Thanks
Works better in dev/prod environment IMO and its easier to package.
Hello,
When a string simulation reaches maxiter. This error is generated.
2020-11-26 05:36:29 stringmethod-0-INFO: Stopping all workers for step swarms_mdrun
2020-11-26 05:36:30 stringmethod-0-INFO: Convergence between iteration 299 and 300: 0.04407884625578595
2020-11-26 05:36:30 stringmethod-1-DEBUG: Using config Config(simu_id='adp', string_dir='strings', md_dir='md', mdp_dir='mdp', topology_dir='topology', postprocessing_dir='postprocessing', swarm_size=32, max_iterations=300, fixed_endpoints=True, steered_md_target_path='strings/string0.txt', steered_md_start_coordinates='confout.gro', version='1.0.0', log_level='DEBUG')
2020-11-26 05:36:30 stringmethod-2-DEBUG: Using config Config(simu_id='adp', string_dir='strings', md_dir='md', mdp_dir='mdp', topology_dir='topology', postprocessing_dir='postprocessing', swarm_size=32, max_iterations=300, fixed_endpoints=True, steered_md_target_path='strings/string0.txt', steered_md_start_coordinates='confout.gro', version='1.0.0', log_level='DEBUG')
2020-11-26 05:36:30 stringmethod-3-DEBUG: Using config Config(simu_id='adp', string_dir='strings', md_dir='md', mdp_dir='mdp', topology_dir='topology', postprocessing_dir='postprocessing', swarm_size=32, max_iterations=300, fixed_endpoints=True, steered_md_target_path='strings/string0.txt', steered_md_start_coordinates='confout.gro', version='1.0.0', log_level='DEBUG')
2020-11-26 05:36:30 stringmethod-0-DEBUG: Using config Config(simu_id='adp', string_dir='strings', md_dir='md', mdp_dir='mdp', topology_dir='topology', postprocessing_dir='postprocessing', swarm_size=32, max_iterations=300, fixed_endpoints=True, steered_md_target_path='strings/string0.txt', steered_md_start_coordinates='confout.gro', version='1.0.0', log_level='DEBUG')
2020-11-26 05:36:30 stringmethod-4-DEBUG: Using config Config(simu_id='adp', string_dir='strings', md_dir='md', mdp_dir='mdp', topology_dir='topology', postprocessing_dir='postprocessing', swarm_size=32, max_iterations=300, fixed_endpoints=True, steered_md_target_path='strings/string0.txt', steered_md_start_coordinates='confout.gro', version='1.0.0', log_level='DEBUG')
2020-11-26 05:41:20 stringmethod-0-INFO: No output files found for iteration 301. Not looking further
2020-11-26 05:41:20 stringmethod-1-ERROR: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last):
File "../../main.py", line 53, in <module>
run(conf, args.start_mode, args.iteration)
File "../../main.py", line 22, in run
return run(conf, start_mode='postprocessing')
File "../../main.py", line 27, in run
postprocessing.run(conf)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/__init__.py", line 11, in run
tc = TransitionCountCalculator.from_config(config=config, cv_coordinates=ce.cv_coordinates)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/base.py", line 33, in from_config
return clazz(postprocessing_dir=config.postprocessing_dir, **kwargs)
File "<string>", line 10, in __init__
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/transition_count_calculation.py", line 30, in __post_init__
if len(self.cv_coordinates.shape) < 3:
AttributeError: 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-1-ERROR: Script failed with message 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-3-ERROR: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last):
File "../../main.py", line 53, in <module>
run(conf, args.start_mode, args.iteration)
File "../../main.py", line 22, in run
return run(conf, start_mode='postprocessing')
File "../../main.py", line 27, in run
postprocessing.run(conf)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/__init__.py", line 11, in run
tc = TransitionCountCalculator.from_config(config=config, cv_coordinates=ce.cv_coordinates)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/base.py", line 33, in from_config
return clazz(postprocessing_dir=config.postprocessing_dir, **kwargs)
File "<string>", line 10, in __init__
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/transition_count_calculation.py", line 30, in __post_init__
if len(self.cv_coordinates.shape) < 3:
AttributeError: 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-3-ERROR: Script failed with message 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-4-ERROR: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last):
File "../../main.py", line 53, in <module>
run(conf, args.start_mode, args.iteration)
File "../../main.py", line 22, in run
return run(conf, start_mode='postprocessing')
File "../../main.py", line 27, in run
postprocessing.run(conf)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/__init__.py", line 11, in run
tc = TransitionCountCalculator.from_config(config=config, cv_coordinates=ce.cv_coordinates)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/base.py", line 33, in from_config
return clazz(postprocessing_dir=config.postprocessing_dir, **kwargs)
File "<string>", line 10, in __init__
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/transition_count_calculation.py", line 30, in __post_init__
if len(self.cv_coordinates.shape) < 3:
AttributeError: 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-4-ERROR: Script failed with message 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-2-ERROR: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last):
File "../../main.py", line 53, in <module>
run(conf, args.start_mode, args.iteration)
File "../../main.py", line 22, in run
return run(conf, start_mode='postprocessing')
File "../../main.py", line 27, in run
postprocessing.run(conf)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/__init__.py", line 11, in run
tc = TransitionCountCalculator.from_config(config=config, cv_coordinates=ce.cv_coordinates)
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/base.py", line 33, in from_config
return clazz(postprocessing_dir=config.postprocessing_dir, **kwargs)
File "<string>", line 10, in __init__
File "/data/sperez/Projects/string_simulations/string-method-gmxapi/stringmethod/postprocessing/transition_count_calculation.py", line 30, in __post_init__
if len(self.cv_coordinates.shape) < 3:
AttributeError: 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:20 stringmethod-2-ERROR: Script failed with message 'NoneType' object has no attribute 'shape'
2020-11-26 05:41:39 stringmethod-0-WARNING: Found 280 accessible states, 620 inaccessible states and 0 states with no starting points.
2020-11-26 05:42:14 stringmethod-0-DEBUG: Converged with master equation after 5185 iterations
2020-11-26 05:42:14 stringmethod-0-INFO: ----------------Finished------------
Thanks,
Sergio
Optimizations present in my PLUMED version of the code.
Should be easy to just add that as an input file option to mdrun
Hello Oliver,
If the endpoints are fixed, does this mean that no restrained simulations are run from those points? How do you sample the region around the endpoints just by swarms that fall into them. Would it be possible to only have the restrained simulations at the endpoints or is this not worth it?
Thanks!
Sergio
Implement some simple convergence metric for the strings, e.g. by comparing the strings between iterations or the rolling average.
We probably want to scale the strings with the max/min values for each CV.
Save to numpy files
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.