Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion examples/ff_params/ff_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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. <br>
Expand Down