Mechanism arrows

User 5efe442094

30-07-2004 11:25:05

Is it possible to draw mechanism arrows in MarvinSketch?





If not, are there any plans to include this?





Thanks,


Gemma

ChemAxon d76e6e95eb

30-07-2004 13:55:16

Marvin version 3.5 will support curved electron flow arrows (single electrons/electron pairs), which can be connected to atoms, bonds, and forming bonds between atoms. Is that what you need?

User 5efe442094

30-07-2004 14:01:36

Yes, when do you plan to release version 3.5?

ChemAxon d76e6e95eb

30-07-2004 16:57:06

You can try this feature in an early alpha version here: http://www.chemaxon.hu/shared/alpha/marvin/doc/dev/example-sketch1.1.html, or dowload it from here: http://www.chemaxon.hu/shared/alpha/index.html. Check those sites again next week, since we will upload a newer version having some improvements for the electron flow drawing.





The release date of Marvin 3.5 has not been decided yet.

User 10d15e5b19

20-04-2011 20:20:52

How do you get mechanism arrows into the SMILES text?

User 870ab5b546

21-04-2011 16:35:41

You don't.  You need to use the MRV format.

ChemAxon 990acf0dec

22-04-2011 13:00:37

Correct. Thanks Bob for the answer!


Akos

User 10d15e5b19

22-04-2011 13:38:54

I am looking for a way to grade a expression (that involves electron flow arrows) using something like  SMILES.  The grading program (Moodle) can grade a string of characters, but not a file. 


Any suggestions?


Thanks,
Justin

User 870ab5b546

22-04-2011 13:55:28

Yes: use the MRV format if you want to extract information about the electron-flow arrows.  The MRV format produces a much longer string, but it's still a string.  


However, MRV format includes xyz coordinates and much other chemically extraneous information, so seemingly identical drawings are not going to produce identical strings.  As a result, you can't just compare two MRV strings to one another to determine whether they represent the same drawing.  If you want to see if two MRV strings represent the same drawing, you need to write Java programs using JChem.

User 10d15e5b19

22-04-2011 13:58:47

bobgr,


     Thanks for the information.  I will wait until a universal format comes available.


Cheers,


Justin

User 870ab5b546

22-04-2011 14:10:05

ChemAxon folks: You already have a ChemAxon SMILES format that extends the regular SMILES format.  Would it be so difficult to extend it further to encode electron-flow arrows? I don't imagine it would be so difficult: you would need to encode the source (1-2 atoms), the sink (1-2 atoms), and the number of electrons that the arrow represents.  E.g., [O-].CBr <1;1:2;2 2:3;3;2> would represent HO attacking CH3Br and displacing Br.  

ChemAxon 25dcd765a3

26-04-2011 14:58:29

Dear All,


As Bob mentioned it would be possible to encode reaction flow arrow in cxsmiles. We can encode the source (1-2 atoms), the sink (1-2 atoms), and the number of electrons that the arrow represents. I have recorded this feature request for the release 5.7. I cannot promise that it will be ready before that as we are overloaded with different tasks.

User 10d15e5b19

26-04-2011 18:09:59

volfi,


    Thank you so much for looking into adding this feature!  I look forward to using it!


Justin

User cbb759276f

07-03-2013 17:19:29










volfi wrote:

Dear All,


As Bob mentioned it would be possible to encode reaction flow arrow in cxsmiles. We can encode the source (1-2 atoms), the sink (1-2 atoms), and the number of electrons that the arrow represents. I have recorded this feature request for the release 5.7. I cannot promise that it will be ready before that as we are overloaded with different tasks.



 


Just wondering if capture of electron flow in cxsmiles has been implemented yet?


 

ChemAxon 25dcd765a3

08-03-2013 15:48:06










ucc_chemistry wrote:

Just wondering if capture of electron flow in cxsmiles has been implemented yet?



Not yet.


Actually, we still have plenty of high priority issues so I can't promise much, but I have increased the priority.

User cbb759276f

12-09-2013 13:00:24

Hi again,


 


I was wondering if we are any closer to seeing an implementation of curly arrows in cxsmiles with the release of Marvin 6.x?


 


Thanks!


 

ChemAxon a202a732bf

12-09-2013 16:31:36

Dear Tim,


could you please specify what you mean by curly arrow? Do you mean just a graphical arrow, the electron flow arrow or a reaction arrow?


Thank you,


Zsuzsa

User cbb759276f

12-09-2013 17:06:10

Hi Zsuzsa


 


By 'curly arrows' I mean electron flow arrows. In other words, could an organic reaction mechanism be captured in cxsmiles format as suggested in post #12 by volfi above?


 

ChemAxon a202a732bf

16-09-2013 07:58:25

Dear Tim,


Unfortunately storage of electron flow arrows in cxsmiles format haven't been implemented yet because we are still overloaded with higher priority issues. But we would really like to help, so could you please specify what you need it for? Maybe we could find another solution to your problem.


Best regards,


Zsuzsa

User 7ed9461a8c

30-09-2013 08:47:49

It is always vital that you use the MRV format when dealing with file formats molecule handling.

User 2a534e670b

10-10-2013 07:46:39

i agree it!

User cbb759276f

10-10-2013 08:50:01

Hi Zszabo,

Ideally I want to able to capture electron flow (e.g. a reaction mechanism) in ASCII format which can then be redirected to a VLE (e.g. Blackboard) for marking. I would rather not use .mrv as parsing the file for the required information is too difficult to implement. 


ChemAxon a202a732bf

15-10-2013 16:08:20

Hi Tim,



we would like to suggest a workaround for your problem, for this we need more understanding of your workflow, so please answer a few more questions:



  1. How do you generate the cxsmiles format of the molecule that you want to redirect to the VLM: do you use Marvin Sketcher (or some other GUI) or is it generated by direct use of the ChemAxon API?

  2. Same on the other side: when parsing the redirected molecule, do you use your own cxsmiles parser implementation or do you import it  using the ChemAxon API?


By having answers to these questions we hope to give you guidance about where and how electron flow information can be obtained.


Best regards,


Zsuzsa

User cbb759276f

17-04-2014 21:59:31

Hi Zsuzsa,


Apologies for the (very!) slow response.


I
am currently using the MarvinSketch Applet embedded into a webpage. When the student clicks a button, I use the following to generate the SMILES string in a separate panel:


 ONCLICK="exportMol('cxsmiles:-H')"


 


The students then simply 'copy and paste' the SMILES string
into the VLE.


 


Thanks!

ChemAxon d26931946c

28-04-2014 19:35:18

Hi Tim,


You could try to export to mrv like this:


"exportMol('mrv:-H')"


This will result in a 3 line xml which is bigger, but can be copied too.


I feel there could be a more user friendly solution to integrate Marvni to a VLE than this copy-paste method.


Can you share some information about the system so we can help with that?


Best regards,


Peter

User 870ab5b546

01-07-2014 23:29:20

Another way to solve this problem might be to create a new JMSketch method, getEFlows(), which can be invoked in JavaScript. It would return an array of objects representing the electron-flow arrows. Each object could consist, for example, of an array of three members consisting of the source, the sink, and the number of electrons. The source and the sink could each be an array of one or two atom index numbers, depending on whether the source/sink was an atom, bond, or incipient bond.


With this method, Tim could use JavaScript to extract the electron-flow arrow information separately from the SMILES code describing the compound. I'm assuming that the atom indices in the SMILES code would be the same as in the original drawing; if not, he would have to write some additional code.


With this solution, you don't need to extend CXSMILES.


I would add, the methods addEFlow(eFlowDescriptor) and removeEFlow(eFlowIndex) would also be useful.

User cbb759276f

02-07-2014 13:48:39










gezapeti wrote:

Hi Tim,


You could try to export to mrv like this:


"exportMol('mrv:-H')"


This will result in a 3 line xml which is bigger, but can be copied too.


I feel there could be a more user friendly solution to integrate Marvni to a VLE than this copy-paste method.


Can you share some information about the system so we can help with that?


Best regards,


Peter



 


Hi Peter,


To be honest, I'm not really worried about integration of Marvin with the VLE. My main interest is the ability to capture electron-flow in a relatively simple manner.


I had a look at your approach exportMol('mrv:-H'), but if I'm not mistaken, this approach generates different  "strings" for the same molecule if  they are drawn in different locations/orientations? Hence, it can't be used to directly compare a student-generated answer with tutor-generated answer??


 


2-methylpropane


<?xml version="1.0" encoding="windows-1252"?><cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/help/formats/schema/mrvSchema_6_2_0.xsd" version="ChemAxon file format v6.2, generated by v6.2.1">
<MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4" elementType="C C C C" x2="-1.0449999570846558 0.28867916474337996 1.6223582865714152 0.28867916474338073" y2="4.289999961853027 5.059999961853027 4.2899999618530265 6.599999961853027"></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="1"></bond><bond id="b2" atomRefs2="a2 a3" order="1"></bond><bond id="b3" atomRefs2="a2 a4" order="1"></bond></bondArray></molecule></MChemicalStruct></MDocument>
</cml>


 


2-methylpropane (in a different location)


<?xml version="1.0" encoding="windows-1252"?><cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/help/formats/schema/mrvSchema_6_2_0.xsd" version="ChemAxon file format v6.2, generated by v6.2.1">
<MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4" elementType="C C C C" x2="0.38499999046325684 1.7186791122912926 3.0523582341193283 1.7186791122912926" y2="-1.0449999570846558 -0.27499995708465585 -1.0449999570846558 1.2650000429153443"></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="1"></bond><bond id="b2" atomRefs2="a2 a3" order="1"></bond><bond id="b3" atomRefs2="a2 a4" order="1"></bond></bondArray></molecule></MChemicalStruct></MDocument>
</cml>


 


 

User 870ab5b546

02-07-2014 13:55:49

Hi Tim,


You can export the string twice, once in MRV and once in SMILES. You can get the electron-flow arrow starting and ending points from the MRV. (You may need to write an XML parser yourself to get that information.) The atom indices in Marvin should be the same as in SMILES. However, even the SMILES string will differ depending on in what sequence the student drew the atoms (which determines the atom indices). To be able to compare a student's drawing to a standard one, you may need Unique SMILES, but then your atom indices will be rearranged. So you may need to export the string three times.


-- Bob

User cbb759276f

02-07-2014 14:48:01










bobgr wrote:

Hi Tim,


You can export the string twice, once in MRV and once in SMILES. You can get the electron-flow arrow starting and ending points from the MRV. (You may need to write an XML parser yourself to get that information.) The atom indices in Marvin should be the same as in SMILES. However, even the SMILES string will differ depending on in what sequence the student drew the atoms (which determines the atom indices). To be able to compare a student's drawing to a standard one, you may need Unique SMILES, but then your atom indices will be rearranged. So you may need to export the string three times.


-- Bob



Hi Bob,


 


Thanks for the the detailed reply - I fear that this level is beyond my capabilities. For reference, I've attached a sample reaction scheme of propene reacting with a proton and the corresponding SMILES and MRV output. I don't know how to go about mapping the electron flow in the MRV output onto the SMILES output in this case.


 


Tim


 


SMILES:


[H+].CC=C


 


MRV:


<?xml version="1.0" encoding="windows-1252"?><cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/help/formats/schema/mrvSchema_6_2_0.xsd" version="ChemAxon file format v6.2, generated by v6.2.1">
<MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4" elementType="C C C H" formalCharge="0 0 0 1" x2="-4.949999809265137 -3.616320687437101 -6.283678931093172 2.4200000762939453" y2="4.014999866485596 4.784999866485595 4.784999866485596 4.400000095367432"></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="2"></bond><bond id="b2" atomRefs2="a1 a3" order="1"></bond></bondArray></molecule></MChemicalStruct><MEFlow id="o2" arcAngle="-140.0" headSkip="0.25" headLength="0.5" headWidth="0.4" tailSkip="0.25" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0"><MAtomSetPoint atomRefs="m1.a1 m1.a2"></MAtomSetPoint><MAtomSetPoint atomRefs="m1.a2 m1.a4" weights="0.25 0.75"></MAtomSetPoint></MEFlow></MDocument>
</cml>

User 870ab5b546

02-07-2014 16:06:28

Never too late to learn how to program!


In your example, this part describes the electron-flow arrow (I added return characters to make it easier to read; you can export with the return characters included by adding the export option P):


<MEFlow id="o2" arcAngle="-140.0" headSkip="0.25" headLength="0.5" headWidth="0.4" tailSkip="0.25" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a1 m1.a2"></MAtomSetPoint>
<MAtomSetPoint atomRefs="m1.a2 m1.a4" weights="0.25 0.75"></MAtomSetPoint>
</MEFlow>

The middle two lines indicate the electron source and sink, respectively. The atomRefs attribute within each MAtomSetPoint tag tells you which atoms are involved with the electron-flow arrow. In your example, the electron source is a bond between atom 1 of molecule 1 and atom 2 of molecule 1. The electron sink is a bond between atom 2 of molecule 1 and atom 4 of molecule 1. (In MRV, "molecule" is not what you or I think of as a molecule. Suffice it to say, I think you are unlikely ever to have more than one "molecule" in your drawing.) If the electron source or sink were an atom, only one atom would be listed in the atomRefs attribute.


The attributes in the MEFlow tag in the first line are irrelevant for your purposes, with one exception. If you use a one-electron arrow, you will have an attrbute headFlags with a value of 2, like this:


  <MEFlow id="o1" arcAngle="254.77468199999998" headSkip="0.44999999999999996" headFlags="2" headLength="0.5" headWidth="0.4" tailSkip="0.44999999999999996" baseElectronContainerIndex="-1" baseElectronIndexInContainer="0">
<MAtomSetPoint atomRefs="m1.a1 m1.a2"/>
<MAtomSetPoint atomRefs="m1.a2"/>
</MEFlow>

As for parsing the MRV, you can do something like this:


var parser = new DOMParser();
var xmlDoc = parser.parseFromString(mrv.replace(/\\n/g, ''), 'text/xml');
var flowsArray = xmlDoc.getElementsByTagName("MEFlow");
for (var flowNum = 0; flowNum < flowNodes.length; flowNum++) {
var srcSink = flowArray[flowNum].childNodes;
var srcAtomsStr = srcSink[0].getAttribute("atomRefs”);
var srcAtomsStr = srcSink[1].getAttribute("atomRefs”);
etc.
}

I'm not sure this code will work exactly as I wrote it, but it gives you a general idea. 


A further problem: I notice that the atom indices in the MRV do not correspond to the atom indices in the SMILES. I believe you must be using an output method that canonicalizes the SMILES string so that a structure gives a unique string no matter in what sequence one draws the atoms. I understand that you need unique SMILES to compare your SMILES string to a known string, but you need to preserve the atom order for the method I have suggested. One solution would be to store the electron-flow information as a property of each atom involved, but this solution has two problems: (1) there doesn't appear to be a JavaScript command that allows you to set atom property values (ChemAxon folks, please correct me if I'm wrong), and (2) it requires that the atom properties then be exported into the unique SMILES string, and I don't know if that happens. You could solve problem (1) by manipulating the MRV string directly using the JavaScript parser methods I referenced above. You would need to experiment to see if you can solve problem 2. Maybe the ChemAxon folks have some additional suggestions for making this work.

ChemAxon d26931946c

02-07-2014 17:18:26

Hi,


SMILES does not keeps the atom indexes by default, so mapping an MRV to SMILES is not that easy.


Hence, it can't be used to directly compare a student-generated answer with tutor-generated answer??

Yes, MRV contains the coordinates and keeps the atom indexes too, so a direct string comparison is not possible with it. However it's possible to compare if two molecules are identical with our API. The complexity of the problem depends on several things. E.g. if we can assume that the two structures are identical and we only have to check if the electron flows are placed between the same atoms with the same direction, it's very easy. ( In this case the student gets a structure and only have to draw the arrows )


If we have to map the two structures to each other, it makes the issue a bit more complicated, but it's still not impossible.


I'm happy to provide you a code that does this comparison if you let me know more of the details.


Regards,


Peter

User 870ab5b546

02-07-2014 17:44:11










gezapeti wrote:

SMILES does not keeps the atom indexes by default, so mapping an MRV to SMILES is not that easy.



Oh, of course, because adjacent atoms in a structure must be adjacent in SMILES, but they needn't be in MRV. So SMILES to MRV preserves atom indices, but not MRV to SMILES.


And yes, I agree that the Java API provides a much safer and easier way to compare structures and electron-flow arrows, but Tim apparently doesn't want to go that route.

User cbb759276f

02-07-2014 18:09:54










gezapeti wrote:

Hi,


SMILES does not keeps the atom indexes by default, so mapping an MRV to SMILES is not that easy.


Hence, it can't be used to directly compare a student-generated answer with tutor-generated answer??

Yes, MRV contains the coordinates and keeps the atom indexes too, so a direct string comparison is not possible with it. However it's possible to compare if two molecules are identical with our API. The complexity of the problem depends on several things. E.g. if we can assume that the two structures are identical and we only have to check if the electron flows are placed between the same atoms with the same direction, it's very easy. ( In this case the student gets a structure and only have to draw the arrows )


If we have to map the two structures to each other, it makes the issue a bit more complicated, but it's still not impossible.


I'm happy to provide you a code that does this comparison if you let me know more of the details.


Regards,


Peter



Hi Peter,


Ideally, the code would compare both structures and electron flow. The more closely the setup mimics a traditional written answer, the more useful it is as a teaching tool. That's why the extended cxsmiles proposed by Bob and volfi earlier is this thread is so attractive - it captures both and allows for direct comparison.


 


Tim

User cbb759276f

07-06-2015 20:31:10










gezapeti wrote:

If we have to map the two structures to each other, it makes the issue a bit more complicated, but it's still not impossible.


I'm happy to provide you a code that does this comparison if you let me know more of the details.


Regards,


Peter



Hi Peter,


How would you go about comparing two MRVs if the molecules are the same, but the co-ordinates are different?


Thanks!

User 870ab5b546

08-06-2015 00:12:48

The best way to compare two structures to see if they are identical is to use JChem search methods (and write some simple Java code). JChem search methods also allow you to specify what you mean by "identical"; for example, is (R)-2-butanol identical to 2-butanol with unspecified stereochemistry? (The answer could be different under different circumstances.) Is benzene with alternating double bonds the same as benzene with a toilet bowl description? JChem search methods also allow you to see if a student's structure is this or that, e.g., cyclohexane or cyclohexene, or, methanol or methylamine. 


Visit this page to see a page that takes two structures drawn in Marvin JS (or you can switch to MarvinSketch) and compares them using JChem search methods. The Java code on this page is pretty simple; it doesn't use anything much but JChem methods. The Javascript is a little more complex, but not much more so.