Luckily, there is a program dedicated to this task: Packmol. It uses simple text input files to define a system. The syntax is very easy to learn but writing the files by hand is a tedious task. Many of the required calculations can be automated and I started writing the Avogadro packmol plugin to do just that. The plugin should allow novice users to create complex systems and should also allow experienced users to make small adjustments (e.g. adding keywords, parameters).
The work flow of the plugin is as follows:
- Configure parameters in a wizard:

The plugin allows you to browse for all required files. This allows all files to be copied to a temporarily location to make sure all files are found. The screen shot shows the wizard for the most basic systems containing solvent and optionally solute.
- Clicking "Generate input file" shows the generated input file

If a new structure is added in the Text Mode tab, the plugin will ask for the file's location when the user clicks run. The syntax highlighting is there to prevent typing errors, it really helps :-)
- Clicking "Run Packmol" starts the program and shows the progress in the Output tab:

Once the program finishes, the resulting file is opened in Avogadro.
The result from the input file seen in the screen shot looks like:

One of the most important calculations required is the number of molecules required to fill a given volume. Given the density, molecular weight and volume, the number of molecules can easily be calculated using Avogadro's number. (This is the same calculation the volume guesser on packmol's site uses AFAIK)
The next step towards more complex systems would be to add solute and counter ions. I'm not completely sure how to subtract the volume taken by solute from the solvents volume. Computing the solute's volume might be an option. Ideas are welcome. :-)
Lipid bilayers are the next kind of system that can be created with packmol. This requires some more knowledge of the packmol syntax but it is still human readable. Before continuing, it might be good to review the bilayer input example from the packmol website. It has comments explaining how to the constraints are used to define the system. The wizard dialog currently looks like:

Currently only 1 "polar solvent" type and 1 "lipid" type are allowed but the idea is that this could allow for mixtures of lipids and so on.
To orient the lipids in the correct way, constraints are needed on specific atoms. This is currently a limitation since a user still has to specify the atom indexes for the polar head and lipophilic tail. In the screen shot below, the indexes have already been filled in.

The required indexes can easily be determined by opening the lipid structure file and enabling the label display type in Avogadro though.

The result from the input above (rendered with POV-Ray):

The next logical step would be to insert a membrane protein between the lipids. This requires the orientation and position of the protein in the membrane to be known. From the protein database files, there is no easy way to determine this. In many cases, the orientations of proteins in membrane (OPM) database provides exactly this. From their website:
The original PDB coordinates are transformed so that the calculated membrane normal coincides with the Z axis, and the origin of coordinates corresponds to the middle of membrane.
This is how the plugin generates the lipid bilayer which allows the protein to be inserted with only a few lines added:

Again, the volume of the protein isn't considered yet. Using slightly lower numbers should work for now. After waiting a while the result should look like:



The source code can be found here.
(The files from the OPM database contain dummy atoms marking where the membrane should be. Make sure to remove these if you try to replicate this)
12 comments:
That is very cool!
Does Avogadro interface with any MD package? It would be great to be able to see a system jiggling around on the screen as the MD simulation progresses. I'm thinking here mainly of a simple system for teaching purposes, rather than hard-core calculations.
> Does Avogadro interface with any MD package?
Not yet. I'm working on a gromacs plugin but this code is on a hard disk I can't access for the moment due to a broken mainboard :-( As soon as I find a way to retrieve the code or get a replacement mainboard I'll continue working on it. I should have pushed it to github sooner...
Great post! I saw Packmol mentioned on FriendFeed earlier, and this is nice material indeed! Jealous it's not in Bioclipse ;)
Great work guys!
Great post, and I'm looking forward to seeing this plugin as a standard feature in future versions of Avogadro. I've been using Avogadro to teach a computational chemistry class, and having packmol there to create initial structures would simplify some of the things we do by hand.
Now I just need to write the OpenMD plugin...
@dan: I think many people are interested in using Avogadro for teaching purposes. It would be great if you could write up your tutorials on the Avogadro wiki.
Nice post.
Another very nice package is pDynamo.
It can do molecular mechanics, semiempirical (pm3, pm6), dft.
http://www.pdynamo.org/mainpages/
Following up on the MD package interface. An open source MD package that may be considered is the Sandia LAMMPS effort (lammps.sandia.gov). Works with very large systems. LAMMPS is in great need of a good front-end like Avogadro.
I just found Avogadro, and this sounds like a very important extension. How do I try this out? Is there a way to use the make files with a binary install, or do I need to compile Avogadro from source?
I am bit novice to this. Could you tell me the step by step instruction on how to install this plugin with avogadro? Is it possible to install in Windows?
thanks
dxs
It most useful for chemical research persons. You may use Avogadro's Number Calculator To solve it's problems simply.
Please write an instruction how to install your plugin (for dummies)
Will be just useful to write some instructions on how to install the plugin.
Best Regards
Post a Comment