<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">Thank you Eric for your answer!
<div dir="auto"><br>
</div>
<div dir="auto">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.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks again, </div>
<div dir="auto">Jaime. </div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El vie., 8 mar. 2019 2:19, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a>> escribió:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;line-break:after-white-space">Hi Jaime,
<div><span class="m_8289349206248550408Apple-tab-span" style="white-space:pre-wrap"></span>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.<br>
<div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div><span class="m_8289349206248550408Apple-tab-span" style="white-space:pre-wrap"></span>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 <a href="https://en.wikipedia.org/wiki/JOELib" target="_blank" rel="noreferrer">JOELib</a> or <a href="https://en.wikipedia.org/wiki/Open_Babel" target="_blank" rel="noreferrer">Open Babel</a> and apply it to other candidate fragments.</div>
</div>
</div>
<div><br>
</div>
<div>—Eric</div>
<div><br>
</div>
<div>
<div>
<div style="word-wrap:break-word;line-break:after-white-space">
<div><span class="m_8289349206248550408Apple-tab-span" style="white-space:pre-wrap"></span>Eric Pettersen</div>
<div><span class="m_8289349206248550408Apple-tab-span" style="white-space:pre-wrap"></span>UCSF Computer Graphics Lab</div>
</div>
</div>
<br>
<blockquote type="cite">
<div>On Mar 7, 2019, at 4:06 AM, Jaime Rodríguez-Guerra Pedregal <<a href="mailto:Jaime.RodriguezGuerra@uab.cat" target="_blank" rel="noreferrer">Jaime.RodriguezGuerra@uab.cat</a>> wrote:</div>
<br class="m_8289349206248550408Apple-interchange-newline">
<div>
<div>
<div dir="ltr">
<div>Dear Chimera team,</div>
<div><br>
</div>
<div>I have two questions regarding the same idea. <br>
</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>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
<a href="http://atom.element.name/" target="_blank" rel="noreferrer">atom.element.name</a>) 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.</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>I guess that both questions would lead to the same result, because it seems that I will need a chemical graph anyway.</div>
<div><br>
</div>
<div>Thank you in advance,</div>
<div>Jaime.<br>
</div>
<div><br>
</div>
</div>
</div>
_______________________________________________<br>
Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" target="_blank" rel="noreferrer">
Chimera-users@cgl.ucsf.edu</a><br>
Manage subscription: <a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" target="_blank" rel="noreferrer">
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</body>
</html>