diff --git a/examples/ff_params/ff_params.py b/examples/ff_params/ff_params.py index 6645684..5aee324 100644 --- a/examples/ff_params/ff_params.py +++ b/examples/ff_params/ff_params.py @@ -41,7 +41,8 @@ original_top = Topology(top_dict) # %% [markdown] -# # 1. Manipulation of partial charges +# # 1. Manipulation of nonbonded parameters +# ## 1.1 Manipulation of partial charges # Example: Change the charge of the CB atom of the first Ala residue and its attached H atoms # %% [markdown] # Inital charges @@ -69,6 +70,26 @@ out_path = Path("hexala_mod_charges.top") top.to_path(out_path) # %% [markdown] +# ## 1.2. Manipulation of Lennard-Jones parameters +# Example: Change the Lennard-Jones parameters of the CT atom type. +# %% [markdown] +# Inital LJ parameters: +# %% +top = deepcopy(original_top) +print(top.ff.atomtypes["CT"]) +# %% [markdown] +# Modify LJ parameters: +# %% +top.ff.atomtypes["CT"].sigma = "0.35" # New sigma value in nm +top.ff.atomtypes["CT"].epsilon = "0.8" # New epsilon value in kJ mol-1 + +print(top.ff.atomtypes["CT"]) +# %% [markdown] +# Now, let's write the modified topology to a new file, called "hexala_mod_lj.top". +# %% +out_path = Path("hexala_mod_lj.top") +top.to_path(out_path) +# %% [markdown] # # 2. Manipulation of bonded parameters # ## 2.1. Local parameter modification # Simillar to the partial charges, the force field parameters can be modified of a single bond angle or dihedral.