LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Fwd: Moltemplate Execution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Fwd: Moltemplate Execution


From: "R. Varsha" <varsharani.0909@...24...>
Date: Sat, 7 Oct 2017 01:55:33 +0530

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

On Thu, Oct 5, 2017 at 12:08 AM, R. Varsha <varsharani.0909@...24...> wrote:
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


On Wed, Oct 4, 2017 at 7:47 AM, R. Varsha <varsharani.0909@...24...> wrote:
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

On Tue, Oct 3, 2017 at 5:38 AM, Andrew Jewett <jewett@...1937...> wrote:
On Mon, Oct 2, 2017 at 1:59 AM, R. Varsha <varsharani.0909@...24...> wrote:
> 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


> 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
>
> On Thu, Sep 28, 2017 at 3:21 PM, R. Varsha <varsharani.0909@...24...>
> wrote:
>>
>> And yes Andrew now I am running this execution in cluster. Therefore, It
>> will not take that much time for me.
>>
>> On Thu, Sep 28, 2017 at 3:18 PM, R. Varsha <varsharani.0909@...24...>
>> wrote:
>>>
>>> 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
>>>
>>> On Thu, Sep 28, 2017 at 5:45 AM, Andrew Jewett <jewett@...1937...>
>>> wrote:
>>>>
>>>> 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
>>>>
>>>> On Tue, Sep 26, 2017 at 3:28 PM, R. Varsha <varsharani.0909@...24...>
>>>> wrote:
>>>> > ---------- Forwarded message ----------
>>>> > From: "R. Varsha" <varsharani.0909@...24...>
>>>> > Date: 22 Sep 2017 13:55
>>>> > Subject: Moltemplate Execution
>>>> > To: "LAMMPS Users Mailing List" <lammps-users@...42...e.net>
>>>> > 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
>>>> >
>>>> >
>>>> > ------------------------------------------------------------------------------
>>>> > Check out the vibrant tech community on one of the world's most
>>>> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> > _______________________________________________
>>>> > lammps-users mailing list
>>>> > lammps-users@...655....net
>>>> > https://lists.sourceforge.net/lists/listinfo/lammps-users
>>>> >
>>>
>>>
>>
>



Attachment: ionized.pdb
Description: Protein Databank data

Attachment: system.data
Description: Binary data