Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1289 Some molecules rendered with bonds overlapping each other

cdk-1.4.x
open
nobody
1
2014-02-15
2013-01-17
Klas Jönsson
No

Some molecules gets rendered (in 2D) in such a way that some of their bonds are overlapping each other. This results in a quite ugly image of the molecule.
I've written a patch (see the attachment) containing a test that fails if any of the ten molecules created in the test method has any bonds overlapping each other. As it is now eight of the ten molecules fails.

1 Attachments

Related

Bugs: #1289

Discussion

  • John May
    John May
    2013-01-17

    • labels: --> sdg, Structure Diagram Generator
     
  • John May
    John May
    2013-01-17

    I don't think it is possible to draw those which fail in 2D whilst preserving bond lengths? With cases like adamantan-1-amine I think it is much better drawn like this then making the bonds in one of the rings longer.

    I'm aware that there is a unit test in master to expose an issue in the UniversalIsomorphismTester but both these cases are flaws in the algorithms and should not really be in unit tests. The structure-diagram-generator also completely clobbers stereo-conformation but we can't easily fix it.

    Maybe it would be a nice to introduce a groovy script which demonstrates known issues that we can't really fix?

     
  • I have not looked at the structures yet... Klas, can you post images online?

    Many molecules do not easily allow SDG indeed... we have a templating scheme... adamantane happens to be one of the templates... we would need to check of Bioclipse properly loads the templates...

    But, the 2D template library is not that large, and may need extension...

     
  • Klas Jönsson
    Klas Jönsson
    2013-01-18

    I can post images online, if I know where to post them...
    And looking at some of the molecules I used in the for the unit test in 3D,
    I'm not sure if it's even possibly to draw them in a nice way in 2D.

    Btw, there's the link to the Bioclipse bug for this:
    http://pele.farmbio.uu.se/bugzilla36/show_bug.cgi?id=3443

    2013/1/18 Egon Willighagen egonw@users.sf.net

    I have not looked at the structures yet... Klas, can you post images
    online?

    Many molecules do not easily allow SDG indeed... we have a templating
    scheme... adamantane happens to be one of the templates... we would need to
    check of Bioclipse properly loads the templates...

    But, the 2D template library is not that large, and may need extension...

    Status: open
    Labels: sdg Structure Diagram Generator
    Created: Thu Jan 17, 2013 02:50 PM UTC by Klas Jönsson
    Last Updated: Thu Jan 17, 2013 09:06 PM UTC
    Owner: nobody

    Some molecules gets rendered (in 2D) in such a way that some of their
    bonds are overlapping each other. This results in a quite ugly image of the
    molecule.
    I've written a patch (see the attachment) containing a test that fails if
    any of the ten molecules created in the test method has any bonds
    overlapping each other. As it is now eight of the ten molecules fails.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/cdk/bugs/1289/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/prefs/

     

    Related

    Bugs: #1289

    • Ola reported that the templates are not working at this moment. I will look at that asap.

       
  • Ben Wolfe
    Ben Wolfe
    2014-02-14

    One case where increasing bond lengths makes sense is crowded organometallics. A common example would be Ru(bipy)3 type compounds. Using sdg on

    C(NCCCCC(NC(OC(C)(C)C)=O)C([O-])=O)(=O)c1cc2[n]([Ru+2]34([n]5c2cc(C)cc5)([n]2c(c5[n]4cccc5)cccc2)[n]2c(c4[n]3cccc4)cccc2)cc1
    

    leads to overlapping bonds and overlapping atoms. Increasing the bond length for atoms connected to Ru seems like it would solve a lot of display issues. An example of how a good sdg handles this can be shown by the nih Chemical Identifier Resolver: http://cactus.nci.nih.gov/chemical/structure/C(NCCCCC(NC(OC(C)(C)C)=O)C(%5BO-%5D)=O)(=O)c1cc2%5Bn%5D(%5BRu+2%5D34(%5Bn%5D5c2cc(C)cc5)(%5Bn%5D2c(c5%5Bn%5D4cccc5)cccc2)%5Bn%5D2c(c4%5Bn%5D3cccc4)cccc2)cc1/image

     
    Last edit: John May 2014-02-14
  • Ben Wolfe
    Ben Wolfe
    2014-02-14

    I learned recently the smiles I posted above is a bit odd. A better example of what I was trying to illustrate is:
    "C(NCCCCC(NC(OC(C)(C)C)=O)C([O-])=O)(=O)C9=CC7=N([N]6=C(C5=CC=CC=[N]45)C=CC=C6)[N]8=CC=C(C=C78)C)C=C9"

    I realize organometallics are a problem in general, but that doesn't mean they aren't common or important. There are several sdgs I have used that can layout this molecule nicely, it would be great to work towards that in the cdk as priority permits.

     
    • John May
      John May
      2014-02-14

      Yep definitely.

      A colleague has been looking at implementing the parts from the Alex Clark paper - https://www.chemcomp.com/journal/depictor.htm. Unfortunately it’s outside of his funding so it’s not a priority at the moment.

      J

       
  • Ben Wolfe
    Ben Wolfe
    2014-02-15

    That looks really promising... and complicated. I hope someone gets the time for it. Unfortunately the subject matter and complexity of the problem really limits the number of people who have the computer science and chemistry education/skill to implement it. I would take a crack at it if I understood any more than the highest level overview of what was said in the description. Organometallics aren't really well represented in the J. Chem. Inf. Model., 2006, 46 (3), pp 1107–1123 paper describing how the algorithm works.

     
  • Ben Wolfe
    Ben Wolfe
    2014-02-15

    Yes, CACTVS seems very nice. Now if it could only be written in java and be open source.