Date: Thu Dec 07 2023 - 09:37:08 CST

Yes, it is resolved. Actually, there was no issue at all, the improper assignments were correct. But when I was looking at it in the vmd I forgot to keep in mind about the difference in the indices in the data file and vmd indices. Thanks,


Get Outlook for Android<;!!DZ3fjg!4fR64itqzy76ME-K2A1o2EXBm99uZivXO4TIwyaiLohQ2pl-ByOqQXFE-6JZr8pWBkm2zwdXJt5zBrwQVGYuYA$ >
From: Diego Gomes <>
Sent: Thursday, December 7, 2023 9:01:44 PM
Cc: <>
Subject: Re: vmd-l: Issue assigning impropers with topotools

[You don't often get email from Learn why this is important at;!!DZ3fjg!4fR64itqzy76ME-K2A1o2EXBm99uZivXO4TIwyaiLohQ2pl-ByOqQXFE-6JZr8pWBkm2zwdXJt5zBrwMVHbHnA$ ]

Hi Shivan, did you get this issue resolved?

During the improper dihedral assignment, make sure to notice that
"index" starts from 0, while "serial" starts from 1.


On Tue, Nov 21, 2023 at 12:58 AM SHIVAM TIWARI <> wrote:
> Dear all,
> I want to generate a lammps input file for sodium laurate molecules solvated in a box of water. I generated the initial coordinates with packmol. The topotools is guessing the bonds, angles and dihedrals correctly for this system. But sodium laurate has an improper which I am trying to assign explicitly with following section of code in my script:
> set lau [atomselect top "resname LAU"]
> set res_list [lsort -unique [$lau get residue]]
> foreach r $res_list {
> set improp_ats [atomselect top "residue $r and name C12 O1 O2 C11"]
> set improp_ids [$improp_ats get index]
> topo addimproper [lindex $improp_ids 1] [lindex $improp_ids 2] [lindex $improp_ids 3] [lindex $improp_ids 0]
> $improp_ats delete
> $improp_ids delete
> }
> The script is generating the desired output. However, when I am checking the indices of impropers from the output file visually in vmd (with command "index 95687 95688 95689 95690) one of the atoms(C11) belongs to a different residue of sodium laurate. However, if i check these indices with the command "serial 95687 95688 95689 95690" in vmd representation, it shows the correct group of atoms. Can anybody help rectify this.
> regards,

Diego Enry B. Gomes, PhD
Department of Physics at Auburn University &
NIH Center for Macromolecular Modeling and Visualization
Leach Science Center - Ste. 3182 - Auburn, AL