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.
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.