problems using Group, ZMatrix

Konrad Hinsen hinsen@ibs.ibs.fr
Sat, 14 Mar 1998 19:57:47 +0100


>  What I want is a quick and dirty way of deducing from the bond info
> enough configuration info to display the topology of a group, plus a
> general purpose way of putting groups together to form a molecule.
> Do you think it would be reasonable to have the quick and dirty method
> add the configuration info to the group object, or would it be better
> to create an incomplete molecule object? Do you have any thoughts

Definitely the first. There is no reason not to define configurations
for groups; I just didn't do it because I saw no (immediate) need.
On the other hand, there are good reasons for requiring molecules
to be complete, mostly to allow error checking in various places.

In fact, defining configurations for groups just as for molecules
is a trivial matter (for me ;-) Assembling a molecule from groups
requires some more thought. It's not difficult to implement (proteins
are already constructed from groups), but first a reaonsable set
of operations must be defined. Given that you can create groups
with definite configurations, how would you want to assemble them?
You'd have to specify the relative positions of all groups plus
the bonds between them.

When starting with MMTK, I planned a "molecular assembly" module that
would allow such operations. I even wanted to add enough information
to the group definitions to allow an intelligent automatic assembly
from parts. However, this ambitious project was quickly dismissed as
not essential enough for my own work to be worth the effort...

> about what it would take to convert your apparently protein specific
> way of putting groups together into something that would work with
> arbitrary chemical parts?

There is very little code that is specific to proteins (just the module
Protein.py). All that is missing is some top-layer "assembly
functions" to let you use the functionality that is essentially
already there.

>  Also, the only entry that came with the Molecules directory was water.
> A larger set of sample molecules would certainly be nice.

Right. I have a few more, but I left them out of the distribution
because there are no parameters for them in the Amber force field.

Here's chloroform for example:

-- Molecules/chloroform ---------------------------------------------------
name = 'chloroform'

structure = \
    "    H   \n" + \
    "    |   \n" + \
    "    C   \n" + \
    "  / | \\ \n" + \
    "Cl Cl Cl\n"

H   = Atom('H')
C   = Atom('C')
Cl1 = Atom('Cl')
Cl2 = Atom('Cl')
Cl3 = Atom('Cl')

bonds = [Bond(C, H), Bond(C, Cl1), Bond(C, Cl2), Bond(C, Cl3)]

pdbmap = [('CLF', {'H': H, 'C': C, 'CL1': Cl1, 'CL2': Cl2, 'CL3': Cl3})]

configurations = {
	'default': ZMatrix([[C],
	                    [H,   C, 1.1*Ang],
                            [Cl1, C, 1.758*Ang, H, 107.57*deg],
                            [Cl2, C, 1.758*Ang, H, 107.57*deg, Cl1,  120*deg],
                            [Cl3, C, 1.758*Ang, H, 107.57*deg, Cl1, -120*deg]])
	}

-- Molecules/acetone ------------------------------------------------------

Or acetone:

---------------------------------------------------------------------------
name = 'acetone'

structure = \
   " H11    O     H31 \n" + \
   "    \\   ||   /    \n" + \
   "H12-C1--C2--C3-H32\n" + \
   "    /        \\    \n" + \
   " H13          H33 \n"

O   = Atom('O')
C1  = Atom('C')
C2  = Atom('C')
C3  = Atom('C')
H11 = Atom('H')
H12 = Atom('H')
H13 = Atom('H')
H31 = Atom('H')
H32 = Atom('H')
H33 = Atom('H')

bonds = [Bond(O, C2), Bond(C1, C2), Bond(C2, C3),
	 Bond(C1, H11), Bond(C1, H12), Bond(C1, H13),
	 Bond(C3, H31), Bond(C3, H32), Bond(C3, H33)]

pdbmap = [('ACT', {'O': O, 'C1': C1, 'C2': C2, 'C3': C3,
		   'H11': H11, 'H12': H12, 'H13': H13,
		   'H31': H31, 'H32', H32, 'H33': H33})]

configurations = {
    'default': PDBFile('acetone.pdb')
    }
---------------------------------------------------------------------------

For acetone you also need some PDB file - I was too lazy to type
in the Z-Matrix definition...

>  Also, the README mentions a COPYRIGHT file, but I can't find any
> file named COPYRIGHT.

Ooops, I forgot to put it into the distribution. It will be in the
next release. Take the Python copyright notice and replace references
to CWI, CNRI, and Guido van Rossum by references to me, and you
have it ;-)

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------