Code Monkey home page Code Monkey logo

string-method-swarms-trajectories's People

Contributors

milafternoon avatar oliverfleetwood avatar sperezconesa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

string-method-swarms-trajectories's Issues

Pre-processing: steered MD

Given two endpoints and an optional pathway, run steered MD between them. If not pathway is present, interpolate a straight path.

Add swarm simus to work queue directly when a restrained simu has finished

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.

import src.analysis - package not found

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?

Function to clean and compress output

files to create

  • one xtc file per point and iteration. The first frame should be the restrained output coordinates. The other frames are the swarm outputcoordiantes.

To keep

  • all pull xvg files

Files to remove

  • TPR files
  • Log files
  • checkpoints
  • gro files, not for the last iteration though
  • mdp files
  • energy files etc.
  • ...

Make this a script that you can call from the command line with the iterations to clean and compress as optional arguments.

issues with dihedral angle CVs

After running the alanine dipeptide example, two issues come up:

  1. the pull code doesn't take the angles modulus 2*pi. This affects the convergence of the string
  2. After taking the modulus, we get artifacts near the periodic boundaries

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.

Do you need the end.gro for steered simulations?

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

Question about CV expressions in the alanine dipeptide example

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

Error with postprocessing when maxiter is reached

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

Add support for previous optimisations

Optimizations present in my PLUMED version of the code.

  • Distribute the points on the string to maximize transitions. Much support exists already. You need to compute the arclength_weights and pass that as an argument to the string reparametrization method.
  • Increase the number of points on the string at a fixed interval
  • Coordinate exchange between points: pick the output coordinates closest to the new restrained point instead of always extending the previous restrained simulation. This will reduce the effect of orthogonal degrees of freedom.
  • Adaptive number of swarms (lower prio).

End-points Fixed

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

Convergence metrics for strings

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.