Skip to content

Commit d0b1eff

Browse files
authored
Merge pull request #3 from graeter-group/feat/update_examples
add lj params example
2 parents 961511f + 6c1a05d commit d0b1eff

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

examples/ff_params/ff_params.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
original_top = Topology(top_dict)
4242

4343
# %% [markdown]
44-
# # 1. Manipulation of partial charges
44+
# # 1. Manipulation of nonbonded parameters
45+
# ## 1.1 Manipulation of partial charges
4546
# Example: Change the charge of the CB atom of the first Ala residue and its attached H atoms
4647
# %% [markdown]
4748
# Inital charges
@@ -69,6 +70,26 @@
6970
out_path = Path("hexala_mod_charges.top")
7071
top.to_path(out_path)
7172
# %% [markdown]
73+
# ## 1.2. Manipulation of Lennard-Jones parameters
74+
# Example: Change the Lennard-Jones parameters of the CT atom type.
75+
# %% [markdown]
76+
# Inital LJ parameters:
77+
# %%
78+
top = deepcopy(original_top)
79+
print(top.ff.atomtypes["CT"])
80+
# %% [markdown]
81+
# Modify LJ parameters:
82+
# %%
83+
top.ff.atomtypes["CT"].sigma = "0.35" # New sigma value in nm
84+
top.ff.atomtypes["CT"].epsilon = "0.8" # New epsilon value in kJ mol-1
85+
86+
print(top.ff.atomtypes["CT"])
87+
# %% [markdown]
88+
# Now, let's write the modified topology to a new file, called "hexala_mod_lj.top".
89+
# %%
90+
out_path = Path("hexala_mod_lj.top")
91+
top.to_path(out_path)
92+
# %% [markdown]
7293
# # 2. Manipulation of bonded parameters
7394
# ## 2.1. Local parameter modification
7495
# Simillar to the partial charges, the force field parameters can be modified of a single bond angle or dihedral. <br>

0 commit comments

Comments
 (0)