Posted: Fri Jul 27, 2007 11:59 pmPost subject: Layout / Clean 2D should consider electron flow arrows
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.
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.
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.
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.
Volfi ChemAxon personnel
Joined: 07 Jun 2004
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum