LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] SPC/e water model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] SPC/e water model


From: Andrew Jewett <jewett@...1937...>
Date: Mon, 18 Sep 2017 16:28:01 -0700

 Your most recent question sounds like a VMD question.  I don't know enough about VMD to answer it.

Fortunately, perhaps I don't need to.  The issue has nothing to do with PSF files.  Neither LAMMPS, not moltemplate read or care about PSF files.  You can run your simulations without them.  (I have only ever needed PSF files to view my molecules in VMD.)

However if you are adding ions, then you will need to inform LAMMPS and moltemplate about them.  The simplest way to do that is to modify your "system.lt" file this way:
 ---- "system.lt" file: ----

import "spce.lt"
import "ions.lt"

wat = new SPCE [260]
na = new NaIon [3]
cl = new ClIon [3]

 ---- end of "system.lt" file ----

(Again, "3" and "260" are the number of ions and water molecules in this example.)

   --- ions.lt ---

For a working example of the "ions.lt" file, see this link:

http://moltemplate.org/examples/waterSPCE+Na+Cl/
   ...or if that link is broken, try this one:
https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_explicit_parameters/waterSPCE%2BNa%2BCl

The "ions.lt" file contains additional pair_coeff commands to define Lennard Jones parameters for these atoms.  Later on, as your system gets more complicated, you may decide it is more convenient to use a canned force field that already contains definitions for all these atom types by replacing the "import ions.lt" line with one of these choices:

import "oplsaa.lt"  #(OPLS boss4.8 force field)
#   -or- 
import "gaff.lt"    #(AMBER force field)

#(...and rename your @atom types accordingly)


Cheers
Andrew
More force fields are planned.  Right now, there are two scripts distributed with moltemplate which have been written to add more force field support  (tinkerparm2lt.py and emcprm2lt.py) these scripts can convert some of the other force fields  distributed with TINKER and EMC into moltemplate format.  But force field conversion can be arduous work, and some force fields contain terms which are not yet implemented in lammps.

On Sep 18, 2017 12:18 AM, "R. Varsha" <varsharani.0909@...24...> wrote:
Attachments are here

On Mon, Sep 18, 2017 at 12:42 PM, R. Varsha <varsharani.0909@...24...> wrote:
Hello Andrew,

I have generated lammps data file (system.data) for spc/e water model through moltemplate. And I can visualize that in VMD by topo command which is as follows-
in TK console > topo readlammpsdata system.data full

Now I want to add ions in that water box. For that first we need pdb and psf files for that system as inputs to autoionize.
I have created pdb and psf files in VMD by using following commands-
animate write pdb system.pdb
animate write psf system.psf

These files has been generated successfully.
But When I did autoionize to add ions. I got error that my psf file is in charmm format & it should be in x-plor format.
I tried other commands also to get x-plor format of psf such as
writepsf x-plor system.psf
writepsf X-PLOR system.psf
writepsf card name "system-xplor.psf" xplor

but nothing happened with these commands

So first my query is that NAMD and VMD generates psf file in x-plor format by default ..then why my psf file is not created in x-plor format.
And secondly how can I convert psf file format from charmm to xplor.

Thanks

Regards,
Varsha

On Fri, Sep 15, 2017 at 8:54 AM, Andrew Jewett <jewett@...1937...> wrote:
On Wed, Sep 13, 2017 at 10:49 PM, R. Varsha <varsharani.0909@...24...> wrote:
> Dear Andrew,
> I went through moltemplate to create spc/e water model data file by loading
> the pdb file which I had created in the VMD already.  I got the data file
> for spc/e water model. But here I am unable to get files related to spc/e
> water box so that I can see that water box in vmd.

If you have already installed moltemplate, then all you need to do is

1) Create a file "system.lt" with these contents:

 ---- "system.lt" file: ----

import "spce.lt"

wat = new SPCE [260]

 ---- end of "system.lt" file ----

(In this example, "260" is the number of water molecules in the PDB
file you created by vmd.  Change it for your PDB)

2) Then run moltemplate this way:

moltemplate.sh -pdb YOURFILE.pdb system.lt

That's all there is to it.

This works because several of the most popular force fields (like
"oplsaa.lt" and "gaff.lt") and water models ("spce.lt" and
"tip3p_2004.lt") are included in a subdirectory that moltemplate.sh
looks in whenever it can't find a file you requested.  If you get the
chance, you really should take a look at the contents of the the
"spce.lt" file (in the "force_fields" subdirectory).  It includes the
settings that Steve mentioned.  For one thing you may need to modify
the "spce.lt" file if later you want to mix SPC/E water with molecules
that use a slightly different (but equivalent) pair_style.  (For
example, the OPLSAA force field uses pair_style lj/cut/coul/long
instead of lj/charmm/coul/long, currently used by default in spce.lt.
The "force_field_OPLSAA/waterSPCE+methane/moltemplate_files/"
directory has a customized version of "spce.lt" for use with OPLSAA.)

Unfortunately, you would not even know these files exist or where to
find them if you installed moltemplate the easy way using:

pip install moltemplate

...all of the examples and documentation will be omitted or hidden
from view.  I'm not sure how to handle this issue.  If I start getting
a lot more questions like this, I'll remove the pip/pypi installation
option.

Cheers

Andrew

> And when I use the first approach that is vmd topotools to generate data
> file for that water box which is TIP3P, I found some errors in that. I am
> interested to know that how can I convert this data file into spc/e data in
> VMD.
>
> On Thu, Sep 14, 2017 at 1:18 AM, Steve Plimpton <sjplimp@...24...> wrote:
>>
>> I don't know about the VMD part, but on the LAMMPS
>> side you just need a few different params in your
>> pair style for SPC/E vs TIP3P,  See Section howto 6.7
>> thru 6.9.
>>
>> Steve
>>
>> On Wed, Sep 13, 2017 at 2:27 AM, Andrew Jewett <jewett@...1937...> wrote:
>>>
>>> My impression was that once you have generated the atom coordinates in
>>> VMD, you would use Axel's topotools to create the LAMMPS data file and input
>>> script with the force field parameters.  Since you choose these force field
>>> parameters manually, they could be either TIP3P or SPC/E, or anything else
>>> you desire.
>>>
>>> Alternatively you could save the coordinated as an .XYZ or .PDB file and
>>> load them into moltemplate and then choose SPC/E or TIP3P water.  Those
>>> water models are already included with moltemplate, so you don't have to
>>> specify the parameters manually.  There's an example/tutorial how to do this
>>> included with moltemplate.  Currently, you can also get the files for that
>>> example here:
>>>
>>> https://github.com/jewettaij/moltemplate/tree/master/examples/file_conversion_examples/read_PDB_file_examples/waterSPCE_from_PDBfile
>>> (The URL for these files could change in the future.)
>>>
>>> This exact topic is also discussed in chapter 4 of the moltemplate
>>> manual.  This is the main introductory chapter, and it is only a few pages
>>> long.
>>>
>>> I hope this gets you started.
>>> Cheers.
>>>
>>> Andrew
>>>
>>> On Sep 12, 2017 11:57 PM, "R. Varsha" <varsharani.0909@...29....> wrote:
>>>>
>>>> Hello everyone,
>>>>
>>>> I want spc/e water model for my simulation. I have created a water box
>>>> in VMD but it is TIP3P by default.
>>>> Is there a way to create spc/e water model in vmd.?
>>>>
>>>>
>>>> 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
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> 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
>>>
>>
>