Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to support running cosolvent simulations in a high-throughput manner #15

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

itaneja2
Copy link

Description:
To enable running cosolvent simulations in a high-throughput manner, we added functionality to allow the user to setup simulations whose number of copies of each components is iteratively adjusted if the initial conditions do not yield a valid starting configuration. In addition, we adjusted the logic of the add_cosolvents function such that it terminates if it is unable to add a molecule after a certain number of pre-specified attempts.

Changes:

  • New Features:
    • Added flag iteratively_adjust_copies such that if it is true, the number of copies of each components is iteratively reduced by a constant multiplicative factor until an valid initial configuration is reached. This feature is tied to the function add_cosolvents_adaptive. If the user does not have hard constraints on initial copy numbers but rather wants to create a 'crowded' cosolvent environment in an automated fashion, this flag should be set to true.
  • Bug Fixes:
    • add_cosolvents now terminates if it is unable to add a molecule after a certain number of pre-specified attempts. Previously, if a molecule was unable to be added, it would repeatedly be attempted to be added until successful. However, this effectively led to an infinite loop if the initial copy numbers or concentrations were too high.
  • Updates:
    • Cleaned up the function _to_openmm_topology. Prior, there was a lot of unnecessary code that was not executed. In addition, all cosolvents are now assigned a single chain named S
    • The maximum number of attempted trials per halton move is now a parameter whose default value is set to 1e4. This was based on the empirical observation that moves are generally accepted within thousands of attempts.
  • Other Changes:
    • The script create_cosolvent_system now takes in 4 additional arguments.
      • num_simulation_steps
      • traj_write_freq
      • time_step
      • iteratively_adjust_copies

@@ -26,13 +26,15 @@
dnaResidues = ['DA', 'DG', 'DC', 'DT', 'DI']

class CosolventMolecule(object):
def __init__(self, name: str, smiles: str=None, mol_filename: str=None, resname: str=None, copies: int=None, concentration: float=None):
def __init__(self, name: str, smiles: str=None, mol_save_dir: str = None, mol_filename: str=None, resname: str=None, copies: int=None, concentration: float=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

"""Converts an openff topology to openmm without specifying a different chain for each residue.

:param off_topology: Openff Topology
:type off_topology: openff.Topology
:param starting_id: starting index
:type starting_id: int
:param chain_id: chain_id for solvent molecules
:type chain_id: str
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary. Keep it as original

cosolvkit/cosolvent_system.py Outdated Show resolved Hide resolved
chain = last_chain
else:
chain = omm_topology.addChain(atom_chain_id)
atom_residue_name = molecule.name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@nbruciaferri nbruciaferri merged commit 29eae19 into master Jul 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants