[MMTK] building molecules from PDB

Konrad Hinsen hinsen@cnrs-orleans.fr
Thu, 4 Mar 1999 14:47:54 +0100


> It's very simple to build a protein from a pdb file.  However, what about
> a small molecule?  I've built Molecule files for a bunch of model compounds

You didn't miss anything; there is indeed no such function in the
current version of mmtk. There will be in the next one though, and
since it's trivial to adapt to the old version, here's the function
you need, with an example script:

from mmtk import *

def moleculesFromPDBSequence(sequence, molecule_name, pdb_code):
    import PDB, ConfigIO, ChemicalObjects, Collection, string
    pdb_conf = sequence.unknownResidues()
    molecules = Collection.Collection()
    for r in pdb_conf:
        if string.upper(r.name) == string.upper(pdb_code):
            m = ChemicalObjects.Molecule(molecule_name)
            ConfigIO.PDBConfiguration(PDB.PDBConfiguration([r])).applyTo(m)
            molecules.addObject(m)
    return molecules

seq = PDBFile('acetylacetone.pdb').readSequenceWithConfiguration()
m = moleculesFromPDBSequence(seq, 'acetylacetone', 'AAE')

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------