Construction of a new macromolecule (protein)

User e7455c8684

11-11-2008 19:08:44

How do I construct a new macromolecule on the fly instead of from a pdb file?


I do have the coordinates, residue types, etc.





I noticed there is a constructor for Macromolecule, but the documentation is limited:


Code:



MacroMolecule(int modelCount, java.util.Hashtable chains, int[] residueCountPerChain, int[] atomCountPerChain, java.util.Hashtable heteroGroups, int[] atomCountPerHeteroGroup)


          Creates an empty MacroMoleculeobject.





It doesn't mention what should be put into the Hashtables.





thanks.

ChemAxon efa1591b5a

12-11-2008 08:49:11

MacroMolecule was not intended to go public. But it happened somehow, so now we support it. :-)





Basically, you add individual atoms one by one using the addAtom() method: http://www.chemaxon.com/jchem/doc/api/chemaxon/marvin/modules/MacroMolecule.html#addAtom().





Life gets complicated if your molecule contains several chains, hetero groups, water molecules etc., check all other add*() methods.





Regarding the constructor parameters are as follows:


- modelCount: number of models in your protein (i.e. conformations), typically this value is 1


- chains: a hash table that associates chain names with their indexes, these are pairs like ('A',1), ('B',2) etc.


- residueCountPerChain: an integer array that is indexed by the chain index (see above chains hash table) and each element contains the number of residues in the chain


- atomCountPerChain: an integer array, one value per chain, the number of atoms in the chain


- heteroGroups: a hash table similar to chains, but this one describes hetero groups (like ligands, ions etc) the same way, ie. associates the name of the hetero group with its index


- atomCountPerHeteroGroup: similar to atomCountPerChain





I admit that this constructor is fairly complex and for typical usage it's not convenient. We will consider to add a simpler constructor to MacroMolecule tht better support the on-fly structure build up.





All suggestions are warmly welcome. Based on your requests we are happy to add more functionality to MacroMolecule to better support usage scenarios different from PDB import.





I hope this helps.


Regards


Miklos

User e7455c8684

12-11-2008 20:02:58

Thanks for the quick response.





I would suggest to use Protein as inherited class other than enclosed class, also add a toPDBFormat method will be very helpful.





mvargyas wrote:
MacroMolecule was not intended to go public. But it happened somehow, so now we support it. :-)





Basically, you add individual atoms one by one using the addAtom() method: http://www.chemaxon.com/jchem/doc/api/chemaxon/marvin/modules/MacroMolecule.html#addAtom().





Life gets complicated if your molecule contains several chains, hetero groups, water molecules etc., check all other add*() methods.





Regarding the constructor parameters are as follows:


- modelCount: number of models in your protein (i.e. conformations), typically this value is 1


- chains: a hash table that associates chain names with their indexes, these are pairs like ('A',1), ('B',2) etc.


- residueCountPerChain: an integer array that is indexed by the chain index (see above chains hash table) and each element contains the number of residues in the chain


- atomCountPerChain: an integer array, one value per chain, the number of atoms in the chain


- heteroGroups: a hash table similar to chains, but this one describes hetero groups (like ligands, ions etc) the same way, ie. associates the name of the hetero group with its index


- atomCountPerHeteroGroup: similar to atomCountPerChain





I admit that this constructor is fairly complex and for typical usage it's not convenient. We will consider to add a simpler constructor to MacroMolecule tht better support the on-fly structure build up.





All suggestions are warmly welcome. Based on your requests we are happy to add more functionality to MacroMolecule to better support usage scenarios different from PDB import.





I hope this helps.


Regards


Miklos

ChemAxon efa1591b5a

13-11-2008 14:07:40

I agree that he current monolithic monster class with the trillions of embedded classes is very hard to manage. However, it is not planned to re-implement the MacroMolecule class in the near future.





Regarding toPRB method, in the present API you may call toMolecule() first then pass the molecule object to the MolExporter to convert it to PDB.





Thank you for your feedback, please keep reporting us bugs as well as missing features to help us improve our class library.





Regards


Miklos