Comments (4)
It looks like this will require a change in the interface.
We currently have run_example.py
call code like this (which will presumably be moved into a Sampler
class):
# Initialization
alchemical_engine = alchemical_engine_library.AlchemicalEliminationEngine(alchemical_metadata)
ncmc_engine = ncmc_switching.NCMCEngine(temperature=temperature, timestep=switching_timestep, nsteps=switching_nsteps, functions=switching_functions)
...
# annihilation of old atoms
old_alchemical_system = alchemical_engine.make_alchemical_system(system, top_proposal, direction='delete')
[ncmc_old_positions, ncmc_elimination_logp] = ncmc_engine.integrate(old_alchemical_system, positions, direction='delete')
...
# creation of new atoms
new_alchemical_system = alchemical_engine.make_alchemical_system(top_proposal.new_system, top_proposal, direction='create')
[ncmc_new_positions, ncmc_introduction_logp] = ncmc_engine.integrate(new_alchemical_system, geometry_proposal.new_positions, direction='create')
Here are some possibilities:
- Option 1. Have
AlchemicalEngine.make_alchemical_system()
also return thelogP
for changing the system from real to alchemical. This would require additional arguments (temperature
). - Option 2. Have
NCMCEngine.integrate()
also incorporate thelogP
for changing the system from real to alchemical. This would require additional arguments (real_system
). - Option 3. Combine
AlchemicalEngine
withNCMCEngine
and merge these calls into a single call:
# Initialization
ncmc_engine = AlchemicalNCMCEngine(temperature=temperature, timestep=switching_timestep, nsteps=switching_nsteps, functions=switching_functions)
...
# annihilation of old atoms
[ncmc_old_positions, ncmc_elimination_logp] = ncmc_engine.integrate(top_proposal, positions, direction='delete')
...
# creation of new atoms
[ncmc_new_positions, ncmc_introduction_logp] = ncmc_engine.integrate(top_proposal, geometry_proposal.new_positions, direction='create')
I actually like Option 3 even if it means a bit more refactoring, since it reduces the number of arguments that must be specified multiple times and eliminates some intermediate variables (old_alchemical_system
, new_alchemical_system
) that are never used again. I'm not sure if there are really any disadvantages to this.
from perses.
Options 2 and 3 are both fine, IMO.
Re: option 2, I think that now that we have a convenience class for topology proposals that include both new and old systems, requiring real_system
is not really a burden at all.
Re: option 3, I think this is probably the best option. Modular code is great, though as you've noted before, the AlchemicalEliminationEngine
is just a thin bit of code around AbsoluteAlchemicalFactory
anyway, so it might be less error-prone and more straightforward to just combine the two--especially since we'll always be starting and ending at "real" states.
I'm +1 on option 3.
from perses.
Great. I'll try implementing option 3 and see if I run into any showstoppers.
from perses.
Looks like this is resolved.
from perses.
Related Issues (20)
- Integrate new atom mappers HOT 7
- Write initial initial and final structures in subdir
- AtomMapper fails when scaffolds have radicals HOT 1
- Creating legacy 0.10.x branch for longer term support -- main branch will become `gufe` refactor HOT 1
- Make sure we merge latest 0.10 branch before working on 0.11 refactor
- perses with mpi HOT 1
- Duplicate instances of `self._setup_complex_phase()` in relative_setup.py HOT 2
- Make `offline-freq` be the same as `checkpoint_interval` by default HOT 1
- Migrate from PDB to PDBx/mmcif HOT 1
- Protein mutation protocol for alchemiscale HOT 1
- Adapt MPi example with perses at least for protein mutation HOT 1
- Fix potential bug in counterion implementation: get_water_indices()
- Allow user to specify list of atom indices to override default behavior for selecting the REST region
- Support for use of custom force fields (e.g., one generated from openff-bespokefit) HOT 5
- Error with spectator ligands HOT 8
- Allow specification of mapping dictionary in the pipeline
- Update README? HOT 1
- Retrieving exact topology used for an endpoint in a relative transformation HOT 11
- Improved reporting and state detection when passing tautomers as `old_residue`
- IndexError with `_vacdg_history` if there is no vacuum trajectory HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perses.