from kimmdy.parsing import read_top
from kimmdy.topology.topology import Topology
from pathlib import Path
from kimmdy.tools import write_top_as_dot
Visualize Topologies
Capped Alanine with a radical
= read_top(Path('../../tests/test_files/test_topology/Ala_R_prm.top'), use_gmx_dir=False)
ala_top = Topology(ala_top)
top
"ala-top.dot") write_top_as_dot(top,
Multiple molecules
= read_top(Path('../../tests/test_files/test_topology/urea.top'), use_gmx_dir=False)
urea_dict = Topology(urea_dict)
urea "urea-top.dot") write_top_as_dot(urea,
When we want to run reactions within molecules that are either separate moleculetypes or multiples of the same moleculetype, KIMMDY can combine those into a single moleculetype and make multiples explicit.
i.e. if we have a topology with two molecules of urea defined as:
[ system ]
Urea in Water
[ molecules ]
;molecule name nr.
Urea 2
SOL 1000
= read_top(Path('../../tests/test_files/test_topology/urea-times-2.top'), use_gmx_dir=False)
urea_dict = Topology(urea_dict)
urea "urea-2-top.dot") write_top_as_dot(urea,
We end up with
This way, explicit atom numbers match up with the atom numbers in the coordinate file (or rather, line numbers - 2, since the numbers in the actual atomnr
column can overflow due to the fixed-width file format).