[Chimera-users] Deterministic traversal of a chemical graph

Jaime Rodríguez-Guerra Pedregal Jaime.RodriguezGuerra at uab.cat
Thu Mar 7 17:35:45 PST 2019

Thank you Eric for your answer!

In the end I have used an approach like you suggested, but using RDKit to generate canonical SMILES (rdkit.Chem.MolToSmiles) for each candidate and then compare the resulting strings. RDKit also provides a way to generate canonical orderings (rdkit.Chem.CanonicalRankAtoms) and, as a result, atom names by using that key.

Thanks again,

El vie., 8 mar. 2019 2:19, Eric Pettersen <pett at cgl.ucsf.edu<mailto:pett at cgl.ucsf.edu>> escribió:
Hi Jaime,
As you probably surmised, the answers are no and no.  The graph-traversal code in Chimera was not intended for topological comparison.  It is used to draw certain kinds of depictions (e.g. wireframe) efficiently.  It makes no attempt to use topologically equivalent atoms as roots nor keep traversal order of topologically identical fragments the same.
Chemical graph comparison is a hard problem in general (particularly in 3D), but it’s possible you might be able to work up a SMARTS query based on one fragment using either JOELib<https://en.wikipedia.org/wiki/JOELib> or Open Babel<https://en.wikipedia.org/wiki/Open_Babel> and apply it to other candidate fragments.


Eric Pettersen
UCSF Computer Graphics Lab

On Mar 7, 2019, at 4:06 AM, Jaime Rodríguez-Guerra Pedregal <Jaime.RodriguezGuerra at uab.cat<mailto:Jaime.RodriguezGuerra at uab.cat>> wrote:

Dear Chimera team,

I have two questions regarding the same idea.

I am trying to develop a script to find topologically equivalent residues in a structure (e.g. MOF, cages, and so on). To do this, I am using SplitMolecule.split.split_connected and then comparing the resulting pieces by number of atoms, empirical formula and, ultimately, I would like to compare the chemical graph (i.e. test for graph isomorphism). Is there any built-in function/object for that in Chimera?

Since I didn't want to overcomplicate the algorithm, for now I am trusting that there won't be isomers in the structure and the empirical formula (actually a collections.Counter applied to atom.element.name<http://atom.element.name/>) is enough of a test.This is working ok but, in some cases, the resulting pieces have totally different atom names because they come from a unified generic residue that encompasses all the pieces. As a result, I want to rename them in the same way consistently.

My first attempt at this consists of finding the chimera.Root atom of each piece and then using chimera.Molecule.traverseAtoms to iterate over the piece. However, I've found that the Root is not always the same (topologically speaking) atom, so the naming scheme differs from piece to piece. Is there anyway to guarantee topologically equivalent traversals?

I guess that both questions would lead to the same result, because it seems that I will need a chemical graph anyway.

Thank you in advance,

Chimera-users mailing list: Chimera-users at cgl.ucsf.edu<mailto:Chimera-users at cgl.ucsf.edu>
Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190308/5ae3b1ba/attachment.html>

More information about the Chimera-users mailing list