David, Thank you very much for the reply, very smart hack!
Sam On Wed, Aug 31, 2016 at 7:27 PM, David Hall <li...@cowsandmilk.net> wrote: > It is a bit of a hack, but for certain applications where I know it is > likely fine, I use networkx to do subgraph isomorphism while considering > only the elements and not looking at the order of the bonds. I can > trivially draw a molecule where this does the wrong thing, but the majority > of the time, it does the right thing. > > For the system you are discussing, here's an example using the attached > script: > > $ ./isomorph.py 1PE_model.sdf 1kf6_1pe.pdb > [{0: 0, > 1: 1, > 2: 2, > 3: 3, > 4: 4, > 5: 5, > 6: 6, > 7: 7, > 8: 8, > 9: 9, > 10: 10, > 11: 11, > 12: 12, > 13: 13, > 14: 14, > 15: 15}, > {0: 15, > 1: 13, > 2: 14, > 3: 12, > 4: 11, > 5: 10, > 6: 9, > 7: 8, > 8: 7, > 9: 6, > 10: 5, > 11: 4, > 12: 3, > 13: 1, > 14: 2, > 15: 0}] > > Since 1PE is symmetric, it outputs the forward ordering of the 1st -> 1st, > 2nd -> 2nd, etc. and reverse ordering of 1st->16th, 2nd -> 15th. > > Hopefully the attached script gives an idea of how to incorporate this > idea into your code. > > > On Wed, Aug 31, 2016 at 4:51 PM, Sam Tonddast-Navaei <s.tondd...@gmail.com > > wrote: > >> I am trying to read a small molecule from PDB file and match its atom >> numbers to the same molecule in a SDF file. I have tried both matching >> SMART patterns and using OBIsomorphismMapper, both work for 70% of >> cases. However there are cases for which OpenBabel can not simply get the >> right SMILES from just the PDB file (e.g. adds extra double bonds or miss >> ones). For example in PDB ID 1KF6 and ligand name IPE, if you generate >> SMILES from PDB you will get OCCO/C=C/OCCO/C=C/O/C=C/O while the correct >> one should be OCCOCCOCCOCCOCCO. I would appreciate if someone can give me >> some advise on this. >> >> Thanks, >> Sam >> >> ------------------------------------------------------------ >> ------------------ >> >> _______________________________________________ >> OpenBabel-discuss mailing list >> OpenBabel-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss >> >> >
------------------------------------------------------------------------------
_______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss