Layout / Clean 2D should consider electron flow arrows

User 44bb556150

27-07-2007 22:59:21

When the system generates a 2D layout for a molecule or reaction, it should consider electron flow arrows, and particularly, any bonds that *will* be formed.





Attached is the file for 2 molecules and the electron flow arrows to indicate a Diels-Alder reaction. The 2 molecules considered independently are layed out well and the arrows all technically have the correct sources and sinks.





Considered altogether however, the layout has issues. It is especially clear as the dashed (forming) bond intersect each other.





I've already thought of and tested a cheap algorithm to get around this, and was going to try hacking it together myself, but it seems like it would be more appropriate to patch the underlying layout engine. The idea is...





(1) Identify where all of the new bonds would be formed by the electron flows (this apparently is already doable since MarvinView knows where to put the dashed bonds)


(2) Actually add explicit "bonds" in place of these forming ones, but set them to some other type (i.e., the "any" bond type).


(3) Run the Clean 2D layout engine on the total diagram, including these formed bonds.


(4) Remove the explicitly added forming bonds, to revert back to a normal state.





The above should produce a decent layout. An example of the above algorithm applied is attached (mockLayout). One remaining issue is that the 2 reacting molecules tend to look too close together. If possible, the explicitly added "forming" bonds should be locked to a bond length of 2.5-3.0 Angstroms before generating the layout to address this issue as well.

User f359e526a1

28-07-2007 11:22:41

Hello, thank you for the suggestion, I tried with the new version and seems even the new cleaning algorithm is not producing good images. So I forward you request to my colleague who is implementing the cleaning related things.

User 44bb556150

10-10-2008 01:10:43

I was hoping this feature would be added to the inherent cleaning engine, but it apparently has not yet. I finally went ahead and tried composing my own custom version of the clean function around the standard one which seems to mostly produce the my desired effect.





I attached a code snippet of the method I put together for this purpose. I'm hoping that something comparable can be integrated into the built-in molecule.clean function.

ChemAxon 25dcd765a3

12-10-2008 19:18:28

Hi,





Thank you very much for the effort you made to make the cleaning code more correct. I will examine the code and include it to the Clean2D algorithm. I hope I can manage to do it to the next minor release Marvin 5.1.3.





Andras

ChemAxon 25dcd765a3

15-10-2008 16:17:24

Hi,





I have included your code into the cleaning process.


I really appreciate your important contribution!





Andras