Developer's guide for basic handling of chemical structures

User 9d8db04821

16-10-2008 13:54:34

Hi,





I am currently using CheAxon's library for (very) basic handling of structures and reactions, i.e., reading form file and comparing, modifying, etc. exisitng structures or creating new structures from scratch. Nothing as fancy as databases, Markush queries, etc.





It seems like only the API is available as documentation for the fundamental chemaxon.struc package. While I am generally able to find my way through the framework in a lot of instances the API alone is not enough and I have to use "trial and error" - trying a method to see what it does.





As a practical example I would like to merge a number of fragments into one multi-fragment molecule. From the API I have found


Code:



 void clonecopy(CGraph g)


          Makes another molecule identical to this one.


 void clonecopy(int[] iatoms, MoleculeGraph g)


          Copies the specified atoms and bonds of this graph to another one.


 void clonelesscopy(CGraph g)


          Copies to selection.








but the description of these methods is hardly enough to really understand what they do. Also I was not able to find any method which gives the valency of an atom - I mean the number used internally to add implicit hydrogens and to do valence checks, etc. Or how the internals operate - it is mentioned that an instance of MolAtom can represent more than one atom, but I was not able to find how this works and what implications it does or does not have. The list is quite long, these just a few examples from the top of my head.





The rather long introduction above leads (finally :) to my question. Isn't there a kind of developers guide covering things as basic as creating molecules in memory, merging two molecules together, working with atoms, bonds, selections, and, in general, covering the chemaxon.struc package?





Thank you in advance,





Dim

ChemAxon a3d59b832c

16-10-2008 14:00:40

Hi Dim,





I moved your question to the appropriate forum where my colleagues will answer soon.





Best regards,


Szabolcs

ChemAxon e500b51457

20-10-2008 09:25:23

Dear Dim,





We are continuously improving the API documentation and started to write Developer’s Guide of core classes covering some topics you mentioned about molecule representation.





However only a few topics are covered by now under the following location:





http://www.chemaxon.com/marvin/help/developer/core/





Valence check can be set either on MolAtom or on MoleculeGraph via MolAtom.valenceCheck or MoleculeGraph.valenceCheck.


The calculated value can be asked with MolAtom.getValence().


What do you mean exactly when mentioning “MolAtom can represent more than one atom”?


Would you like to create an abbreviated group (for example Ala) or an R-group?


Example code for abbreviated group creation (CreateGroup.java) can be found here:


http://www.chemaxon.com/forum/viewpost16870.html&highlight=abbreviated#16870





I hope this helps, let me know if you need more help.





Best regards,


Erika.

User 9d8db04821

20-10-2008 13:46:34

Dear Erika,





Thank you for you reply. I will have a look at the documents you have linked to.





About the atoms - I was referring to the following from the API (although this was just an example and I've now noticed that this method is actually protected and returns always 1, but to answer your question):





Code:
countAllAtoms


protected int countAllAtoms()Counts all atoms represented by this atom.





Returns:


1


Since:


Marvin 3.0








To avoid discussing particular details, I think my original question can be rewritten as "If I want to redevelop the complete JChem package (which I definitely don't want :) using only the core classes from chemaxon.struc and without access to the source code where do I start?"





I hope it is clearer that way. Thank you once again for your answer,





Dim