Moltemplate Execution

Hello all,

I wanted to create lammps data file for spc/e water model with ions via moltemplate.

When I executed this for small no. of water molecules I found some errors in system.lt file. (snapshot has attached as 22 sept.png).

And one another issue I am facing that is for large no. of water molecules (2089) the file generation is with held from 2 hours. It is not progressing further. (22sept 41.png)

Please help me in this regard.

Thanks.

Regards

Varsha

22sept.png

22sept 41.png

Cc:

Hello all,

I wanted to create lammps data file for spc/e water model with ions via moltemplate.

When I executed this for small no. of water molecules I found some errors in system.lt file. (snapshot has attached as 22 sept.png).

And one another issue I am facing that is for large no. of water molecules (2089) the file generation is with held from 2 hours. It is not progressing further. (22sept 41.png)

Please help me in this regard.

Thanks.

Regards

Varsha

22sept.png

22sept 41.png

Dear Varsha

   move() commands appear in many of the moltemplate examples so far,
but it sounds like you don't need them. Remove the lines containing
.move() in your system.lt file:

  --- explanation ---

   If you are reading the coordinates of your molecules from a file,
then just use:

  ---- "system.lt" ----
wat = new SPCE [446]

kions = new KIons [9]

clions = new ClIons [9]

... and make sure that the coordinates of the kions and clions appear
AFTER the coordinates of you water molecules. (Your PDB, XYZ, or .RAW
file should contain coordinates in the same order the "new" commands
appear in your system.lt file.)

    If you are -not- reading the coordinates from a file, then the
.move() commands are necessary to control the position of each
molecule and prevent them from overlapping (which they do by default).

  --- speed issues ---

   The number of copies of each molecule is the product of the number
in each [] bracket following the "new" command. (This is similar to
multidimensional arrays in C++).
So in your "system.lt" file, you requested moltemplate to create
446000 (446x10x10x10) SPCE (water) molecules, 72 (9x2x2x2) "ClIon" and
"KIon" "molecules"(atoms). That's why it's taking so long (and using
so much memory). (Even so, I am somewhat ashamed that a system with
1.5 million atoms currently takes moltemplate 2 hours. If more people
are simulating these large systems, then I'll devote more effort in
making moltemplate run faster.)

Cheers
Andrew

Dear Andrew,

Thanks a lot for your response.

First I tried with pdb file to take atom’s coordinates and time I didn’t mention “move” command in the script (system.lt)

But when I received the output file (system.data), I found some errors in atom’s coordinates. The reason of this is - that pdb file was incorrect which I used.

So I tried it with “move” command so that I can get atom’s coordinates in the moltemplate itself.

I have not any choice if I will remove “move” command from system.lt .

Please help me out. I would be always thankful to you.

Thanks & Regards,

Varsha

And yes Andrew now I am running this execution in cluster. Therefore, It will not take that much time for me.

Dear Andrew,

Thanks a lot for your response.

First I tried with pdb file to take atom’s coordinates and time I didn’t mention “move” command in the script (system.lt)

But when I received the output file (system.data), I found some errors in atom’s coordinates. The reason of this is - that pdb file was incorrect which I used.

So I tried it with “move” command so that I can get atom’s coordinates in the moltemplate itself.

I have not any choice if I will remove “move” command from system.lt .

Please help me out. I would be always thankful to you.

And yes Andrew now I am running this execution in cluster. Therefore, It will not take that much time for me.

Thanks & Regards,

R. Varsha

Thanks a lot for your response.
First I tried with pdb file to take atom's coordinates and time I didn't
mention "move" command in the script (system.lt)
But when I received the output file (system.data), I found some errors in
atom's coordinates. The reason of this is - that pdb file was incorrect
which I used.
So I tried it with "move" command so that I can get atom's coordinates in
the moltemplate itself.
I have not any choice if I will remove "move" command from system.lt .

I have not added a way for moltemplate to modify the coordinates of
atoms that you are reading from a PDB (or XYZ or RAW) file.

I suggest you should either fix the problem with your PDB file, or use
.move() commands for the entire system.lt file.

Alternatively, you CAN use moltemplate to generate a system where SOME
of the coordinates come from a PDB file, and other coordinates are
created using moltemplate's "move()" commands, although it's a little
more tricky.

Below I sketch how you could do that. (I have not actually tried the
procedure that I outline below, but it should definitely work.
However you may have to correct mistakes in my awk commands. The awk
commands should fit on one line, but they may get split into 2 lines
in the process of emailing them.)

1) Create an LT file (eg, "system_excerpt.lt") containing only the
molecules whose coordinates are missing from your PDB file. (This LT
file will contain the molecules whose position you control with
"move()" commands.) Use moltemplate.sh to generate a DATA file for
these atoms:

moltemplate.sh system_except.lt

2) Then use a text editor to cut out the "Atoms" section of the data
file (eg "system_excerpt.data"), and use "awk", or "cut"+"paste" or
"pizza.py", to extract the columns corresponding to the atom
coordinates from that data file, and finally save them in a new simple
3-column text file (eg "coords_excerpt.raw").
A faster way to accomplish the same thing is to use the following commands:

extract_lammps_data.py Atoms < system_excerpt.data > Atoms.txt
awk '{print $4" "$5" "$6}' < Atoms.txt > coords_excerpt.raw

3) Do the same thing with your PDB file to create a 3-column text file
with the PDB atom coordinates (eg "coords_pdb.raw"). One way to do
that is using awk:

awk '/^ATOM |^HETATM/{print substr($0,31,8)" "substr($0,39,8)"
"substr($0,47,8)}' \
    < YOUR_FILE.pdb > coords_pdb.raw

4) THEN append the text from your 3-column coordinate file extracted
from your DATA file to the 3-column coordinate file extracted from
your PDB file, and save the result in a new file (eg "coords.raw".

cat coords_excerpt.raw coords_pdb.raw > coords.raw

5) Finally use your "system.lt" file (the file which includes all of
the molecules in your system including some which came from your PDB
file), listed in the order that they appear in the ".raw" file you
just created (hopefully). Run moltemplate on this file:

moltemplate.sh -raw coords.raw system.lt

This should generate files you can use with LAMMPS (eg"system.data",
"system.in.init", "system.in.settings") However I'm not sure this
helps with your issue.

Cheers

Andrew

1 Like

Dear Andrew,

Thanks a ton to explain everything in such a nice manner.

Yeah, the above solution which you described seems so tricky definitely. And one another thing is that my pdb file contains a large number of atoms so its difficult to sort out incorrect atom coordinates from that enormous data. ( to create system_excerpt.lt )

And I am littile confused here that will system_excerpt.lt file contain ‘import’ command for spce.lt & ions.lt like in system.lt or will only contain “.move( )” command.?

Thanks & Regards,

R. Varsha

Dear Andrew,

I went through the first option that is to fix the issues in my pdb file. Therefore, I checked my pdb file very carefully, there are no any incorrect positions of atoms. I found the issues in system.data file regarding atom’s coordinates. I think…at the time of processing of moltemplate, something went wrong. Thats why I got incorrect system.data file. It is not taking correctly the atom coordinates values from pdb file.

Here I have attached my pdb file & system.data file.

Please help me to debug the issue. I would be always thankful to you if will get correct data from moltemplate.

Thanks & Regards,

Varsha

ionized.pdb (490 KB)

system.data (351 KB)

Dear Andrew,

I went through the first option that is to fix the issues in my pdb file. Therefore, I checked my pdb file very carefully, there are no any incorrect positions of atoms. I found the issues in system.data file regarding atom’s coordinates. I think…at the time of processing of moltemplate, something went wrong. Thats why I got incorrect system.data file. It is not taking correctly the atom coordinates values from pdb file.

Here I have attached my pdb file & system.data file.

Please help me to debug the issue. I would be always thankful to you if will get correct data from moltemplate.

Thanks & Regards,

Varsha

ionized.pdb (490 KB)

system.data (351 KB)

hi guys,

i think this is becoming very specific and not really of interest to all of the lammps-users subscribers.
this i suggest that you please move this thread off the mailing list. especially, if you keep attaching large uncompressed files.

thanks,
axel.

Hello Axel,

I am creating data for lammps via moltemplate. Then whats the problem in this thread. And you are not responsible for moltemplate …right? So its better that let Andrew make an answer.

Thanks,

R. Varsha

Hello Axel,

I am creating data for lammps via moltemplate. Then whats the problem in
this thread.

​the problem is that you are asking something that is very specific to you.​

And you are not responsible for moltemplate ...right? So its better that
let Andrew make an answer.

​yes, but please note that this is the "lammps-users" mailing list and not
the "moltemplate-users" mailing list.
all i am suggesting is, that you stop copying the lammps-users mailing list
and especially stop polluting people's inboxes with (large) attachments,
that they don't care​ about.

nothing is keeping you from e-mailing andrew directly, and since it is only
his answer that you want, then it is just logical, that you should only
e-mail him.

axel.

Yes exactly every person has a different issue which will be obviously specific to his or her.

And people can delete the mails from their inboxes…I think.

And I didn’t mention that only Andrew will answer. If someone knows something regarding the problem, they can also answer.

Thanks.

why are you so upset? last time i checked, it is not a civil right to be allowed to post to this mailing list.

​as a mailing list maintainer, was simply reminding you, that your discussion has become off-topic for this particular mailing list
and i was reminding you to be less selfish and more considerate toward the ~850 other people ​on this list.

I confess. I get a little bit fatigued as well. We should probably
move this discussion off the mailing list.