graphical arrows converting to reaction arrows

User 870ab5b546

11-08-2016 19:38:14

In newer versions of MarvinSketch, it appears that you have erased the distinction between a graphical arrow and a reaction arrow. If I draw a structure with one arrow, Marvin now automatically converts it to a reaction arrow. I understand your motive for doing so, but is there an option to prevent this conversion? Our code wasn't written to handle reaction arrows. 

User 870ab5b546

15-08-2016 14:37:43

No response? This change in MarvinSketch, its new inability to draw a single graphical arrow, has broken large swaths of our program.


I also notice that if the drawing on which I am placing a reaction arrow contains rectangles or electron-flow arrows, then MarvinSketch adds multiple copies of those objects. For example, starting with:


<?xml version="1.0" encoding="UTF-8"?>
<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_16_02_15.xsd" version="ChemAxon file format v16.02.15, generated by v16.8.1.0">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16" elementType="C C C C C C C C C C C C C C C C" x2="-5.841057372428283 -7.279996498549455 -8.820003882920272 -9.908943104408875 -9.908943104408875 -8.820003882920272 -7.279996498549455 -5.782723975516662 3.0256095406042487 1.9366703191156454 0.3966629347448283 -0.6922762867437751 -0.6922762867437751 0.3966629347448283 1.9366703191156454 3.0256095406042487" y2="1.5283370473737783 2.150609570406571 2.150609570406571 1.0616703489179677 -0.47833703545284934 -1.5672762569414527 -1.5672762569414527 -1.0616703787202901 1.0033370265121526 2.092276248000756 2.092276248000756 1.0033370265121526 -0.5366703578586645 -1.6256095793472678 -1.6256095793472678 -0.5366703578586645"/>
<bondArray>
<bond id="b1" atomRefs2="a1 a2" order="2"/>
<bond id="b2" atomRefs2="a2 a3" order="1"/>
<bond id="b3" atomRefs2="a3 a4" order="2"/>
<bond id="b4" atomRefs2="a4 a5" order="1"/>
<bond id="b5" atomRefs2="a5 a6" order="2"/>
<bond id="b6" atomRefs2="a6 a7" order="1"/>
<bond id="b7" atomRefs2="a7 a8" order="2"/>
<bond id="b8" atomRefs2="a9 a10" order="1"/>
<bond id="b9" atomRefs2="a16 a9" order="1"/>
<bond id="b10" atomRefs2="a10 a11" order="2"/>
<bond id="b11" atomRefs2="a11 a12" order="1"/>
<bond id="b12" atomRefs2="a12 a13" order="2"/>
<bond id="b13" atomRefs2="a13 a14" order="1"/>
<bond id="b14" atomRefs2="a14 a15" order="2"/>
<bond id="b15" atomRefs2="a15 a16" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
<MEFlow id="o2" arcAngle="150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a1 m1.a2"/>
<MAtomSetPoint atomRefs="m1.a1 m1.a8"/>
</MEFlow>
<MEFlow id="o3" arcAngle="-150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a7 m1.a8"/>
<MAtomSetPoint atomRefs="m1.a6 m1.a7"/>
</MEFlow>
<MEFlow id="o4" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a5 m1.a6"/>
<MAtomSetPoint atomRefs="m1.a4 m1.a5"/>
</MEFlow>
<MEFlow id="o5" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a3 m1.a4"/>
<MAtomSetPoint atomRefs="m1.a2 m1.a3"/>
</MEFlow>
<MEFlow id="o6" arcAngle="-150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a10 m1.a11"/>
<MAtomSetPoint atomRefs="m1.a10 m1.a15"/>
</MEFlow>
<MEFlow id="o7" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a14 m1.a15"/>
<MAtomSetPoint atomRefs="m1.a13 m1.a14"/>
</MEFlow>
<MEFlow id="o8" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a12 m1.a13"/>
<MAtomSetPoint atomRefs="m1.a11 m1.a12"/>
</MEFlow>
<MRectangle id="o9">
<MPoint x="-11.319999694824219" y="2.9200000762939453"/>
<MPoint x="-4.039999961853027" y="2.9200000762939453"/>
<MPoint x="-4.039999961853027" y="-2.759999990463257"/>
<MPoint x="-11.319999694824219" y="-2.759999990463257"/>
</MRectangle>
<MRectangle id="o10">
<MPoint x="-1.9600000381469727" y="2.799999952316284"/>
<MPoint x="4.320000171661377" y="2.799999952316284"/>
<MPoint x="4.320000171661377" y="-3.200000047683716"/>
<MPoint x="-1.9600000381469727" y="-3.200000047683716"/>
</MRectangle>
</MDocument>
</cml>

If I add an arrow:


<?xml version="1.0" encoding="UTF-8"?>
<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_16_02_15.xsd" version="ChemAxon file format v16.02.15, generated by v16.8.1.0">
<MDocument>
<MChemicalStruct>
<reaction>
<arrow type="DEFAULT" x1="-4.68" y1="-1.7199999999999998" x2="-1.1199999999999992" y2="-1.96"/>
<reactantList>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8" elementType="C C C C C C C C" x2="-5.841057372428283 -7.279996498549455 -8.820003882920272 -9.908943104408875 -9.908943104408875 -8.820003882920272 -7.279996498549455 -5.782723975516662" y2="1.5283370473737783 2.150609570406571 2.150609570406571 1.0616703489179677 -0.47833703545284934 -1.5672762569414527 -1.5672762569414527 -1.0616703787202901"/>
<bondArray>
<bond id="b1" atomRefs2="a1 a2" order="2"/>
<bond id="b2" atomRefs2="a2 a3" order="1"/>
<bond id="b3" atomRefs2="a3 a4" order="2"/>
<bond id="b4" atomRefs2="a4 a5" order="1"/>
<bond id="b5" atomRefs2="a5 a6" order="2"/>
<bond id="b6" atomRefs2="a6 a7" order="1"/>
<bond id="b7" atomRefs2="a7 a8" order="2"/>
</bondArray>
</molecule>
</reactantList>
<productList>
<molecule molID="m2">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8" elementType="C C C C C C C C" x2="3.0256095406042487 1.9366703191156454 0.3966629347448283 -0.6922762867437751 -0.6922762867437751 0.3966629347448283 1.9366703191156454 3.0256095406042487" y2="1.0033370265121526 2.092276248000756 2.092276248000756 1.0033370265121526 -0.5366703578586645 -1.6256095793472678 -1.6256095793472678 -0.5366703578586645"/>
<bondArray>
<bond id="b1" atomRefs2="a1 a2" order="1"/>
<bond id="b2" atomRefs2="a8 a1" order="1"/>
<bond id="b3" atomRefs2="a2 a3" order="2"/>
<bond id="b4" atomRefs2="a3 a4" order="1"/>
<bond id="b5" atomRefs2="a4 a5" order="2"/>
<bond id="b6" atomRefs2="a5 a6" order="1"/>
<bond id="b7" atomRefs2="a6 a7" order="2"/>
<bond id="b8" atomRefs2="a7 a8" order="1"/>
</bondArray>
</molecule>
</productList>
</reaction>
</MChemicalStruct>
<MEFlow id="o2" arcAngle="150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a1 m1.a2"/>
<MAtomSetPoint atomRefs="m1.a1 m1.a8"/>
</MEFlow>
<MEFlow id="o3" arcAngle="-150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a7 m1.a8"/>
<MAtomSetPoint atomRefs="m1.a6 m1.a7"/>
</MEFlow>
<MEFlow id="o4" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a5 m1.a6"/>
<MAtomSetPoint atomRefs="m1.a4 m1.a5"/>
</MEFlow>
<MEFlow id="o5" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a3 m1.a4"/>
<MAtomSetPoint atomRefs="m1.a2 m1.a3"/>
</MEFlow>
<MEFlow id="o6" arcAngle="-150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m2.a2 m2.a3"/>
<MAtomSetPoint atomRefs="m2.a2 m2.a7"/>
</MEFlow>
<MEFlow id="o7" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m2.a6 m2.a7"/>
<MAtomSetPoint atomRefs="m2.a5 m2.a6"/>
</MEFlow>
<MEFlow id="o8" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m2.a4 m2.a5"/>
<MAtomSetPoint atomRefs="m2.a3 m2.a4"/>
</MEFlow>
<MRectangle id="o9">
<MPoint x="-11.319999694824219" y="2.9200000762939453"/>
<MPoint x="-4.039999961853027" y="2.9200000762939453"/>
<MPoint x="-4.039999961853027" y="-2.759999990463257"/>
<MPoint x="-11.319999694824219" y="-2.759999990463257"/>
</MRectangle>
<MRectangle id="o10">
<MPoint x="-1.9600000381469727" y="2.799999952316284"/>
<MPoint x="4.320000171661377" y="2.799999952316284"/>
<MPoint x="4.320000171661377" y="-3.200000047683716"/>
<MPoint x="-1.9600000381469727" y="-3.200000047683716"/>
</MRectangle>
<MEFlow id="o11" arcAngle="150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a1 m1.a2"/>
<MAtomSetPoint atomRefs="m1.a1 m1.a8"/>
</MEFlow>
<MEFlow id="o12" arcAngle="-150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a7 m1.a8"/>
<MAtomSetPoint atomRefs="m1.a6 m1.a7"/>
</MEFlow>
<MEFlow id="o13" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a5 m1.a6"/>
<MAtomSetPoint atomRefs="m1.a4 m1.a5"/>
</MEFlow>
<MEFlow id="o14" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a3 m1.a4"/>
<MAtomSetPoint atomRefs="m1.a2 m1.a3"/>
</MEFlow>
<MEFlow id="o15" arcAngle="-150.0" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m2.a2 m2.a3"/>
<MAtomSetPoint atomRefs="m2.a2 m2.a7"/>
</MEFlow>
<MEFlow id="o16" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m2.a6 m2.a7"/>
<MAtomSetPoint atomRefs="m2.a5 m2.a6"/>
</MEFlow>
<MEFlow id="o17" arcAngle="-162.41555060999994" headSkip="0.15" headLength="0.5" headWidth="0.4" tailSkip="0.15" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m2.a4 m2.a5"/>
<MAtomSetPoint atomRefs="m2.a3 m2.a4"/>
</MEFlow>
<MRectangle id="o18">
<MPoint x="-11.319999694824219" y="2.9200000762939453"/>
<MPoint x="-4.039999961853027" y="2.9200000762939453"/>
<MPoint x="-4.039999961853027" y="-2.759999990463257"/>
<MPoint x="-11.319999694824219" y="-2.759999990463257"/>
</MRectangle>
<MRectangle id="o19">
<MPoint x="-1.9600000381469727" y="2.799999952316284"/>
<MPoint x="4.320000171661377" y="2.799999952316284"/>
<MPoint x="4.320000171661377" y="-3.200000047683716"/>
<MPoint x="-1.9600000381469727" y="-3.200000047683716"/>
</MRectangle>
<MRArrow id="o20" headLength="0.5" headWidth="0.3">
<MPoint x="-4.68" y="-1.7199999999999998"/>
<MPoint x="-1.1199999999999992" y="-1.96"/>
</MRArrow>
</MDocument>
</cml>

This bug also breaks our code completely.


Using Marvin 16.8.1 and 16.8.8, both desktop and browser applet.

ChemAxon f052bdfe3c

15-08-2016 15:00:45

I apologise for the late answer and I am sorry for the inconveniences.  We need a bit more time to analyse this and see the possible solutions.


Best regards,


Efi

User 870ab5b546

15-08-2016 15:15:55

Thanks. I note that these problems are avoided in MarvinJS by setting:


marvinSketcherInstance.setServices({
reactionconvertws: null
});

User 870ab5b546

17-08-2016 16:42:35

I might be able to undo some of the damage if I could replace the reaction arrow with a regular graphical arrow. However, the Java API shows that the class for the reaction arrow, chemaxon.struc.graphics.MRArrow, is hidden. For example, in the API for RxnMolecule, I see the method:


chemaxon.struc.graphics.MRArrowgetReactionArrow(boolean generate)
Gets the reaction arrow of this reaction with the possibility to generate an arrow if the arrow is not yet set.

But there is no API for MRArrow:


chemaxon.struc.graphics


Please advise. 

ChemAxon f052bdfe3c

20-08-2016 03:32:22

In the current representation, if there is one arrow i the canvas it is always interpreted  as reaction arrow not only during export/import. It does not lead to problem in the UI since you can turn off the automatic plus signs. Would it solve your problem if we provide this settings in the Applet as you asked for it in forum topic: https://www.chemaxon.com/forum/ftopic15388.html&highlight=  ? 


As far as the duplicated graphical objects are concerned, this is a bug in our code and we will fix it ASAP. 


Best regards,


Efi

User 870ab5b546

20-08-2016 15:08:58










ehoffmann wrote:

In the current representation, if there is one arrow i the canvas it is always interpreted  as reaction arrow not only during export/import. It does not lead to problem in the UI since you can turn off the automatic plus signs. Would it solve your problem if we provide this settings in the Applet as you asked for it in forum topic: https://www.chemaxon.com/forum/ftopic15388.html&highlight=  ? 


 



What I really want is a Javascript msketch_param() command that tells MarvinSketch to interpret a single arrow as a graphical arrow, not a reaction arrow, much like the MarvinJS command noted above. Such a command will also take care of the extraneous + signs. If I can't have that, I need the MRArrow class to be public so I can write a method that replaces an MRArrow in an MDocument with an MPolyline; I will also need an msketch_param() command that turns off the display of + signs.

ChemAxon f052bdfe3c

25-08-2016 08:49:24

I suppose these request related to https://www.chemaxon.com/forum/ftopic15388.html&highlight= and preserving molecular property in a reaction.


Am I correct? We cannot change back the current behaviour, but probably can give you a suitable solution for the original problem.  Could you write down to original workflow which you cannot full fill currently because of our recent changes or can we have a TC sometimes early next week where the developers can understand the whole problem? 


Thank you,


Efi

User 870ab5b546

25-08-2016 14:25:52

In mechanism, synthesis, and resonance questions, a student might submit a response that looks like the figure below. We use the MRectangles in the response to establish the stages of the response, we fragment the Molecule and place the fragments into each stage (guided by their physical locations), and we use the graphical arrows to place the stages in the proper sequence.


Now that MarvinSketch replaces the graphical arrow (class MPolyline) with a reaction arrow (MRArrow), we have no way of determining the order of the stages. We could write new code to look for an MRArrow if no MPolylines are found, or to replace MRArrows with MPolylines that start and end at the same positions, but the MRArrow class is private, so we can't. 


There is also a potential problem that replacing an MRArrow with an MPolyline would create inconsistencies in a Molecule that is also a RxnMolecule. 


As I am writing this, I realize that the reaction arrow naturally divides the molecule fragments into their respective stages, but to take advantage of this feature, I would have to write a whole new set of code just to handle the case of responses with a single arrow, and I'd really rather not do that. 


In MarvinJS, I can turn off the conversion of a single graphical arrow to a reaction arrow with a single Javascript command. Ideally, I would like the same feature in MarvinSketch. If I can't have that, at least make the MRArrow class public so that I can replace the MRArrow with an MPolyline. 

ChemAxon f052bdfe3c

30-08-2016 15:06:19

Thank you for the explanation, we are checking what we can do. I will let you know if we find a solution.