Mrv export of more than one structure

User 517cf47a32

17-02-2017 14:11:42

Hello,


when I draw more than one structure in MarvinJS (means these two structures anŕe not connected with any bond) there is only one "molecule" element in the exported MRV.


Is there a chance to tell marvin to export it as two molecules? I have seen examples of mrv exports with more molecule elements (molecule id="m2")


Students are supposed to draw resonance structures and I really need them to draw these in one editor.¨


Thanks


Martin

ChemAxon 76c88f5366

20-02-2017 10:25:44

Dear Martin,


In Marvin JS only reactions are exported with separate reactant, agent, product lists, which contain all the molecules in separate molecule tag.
Marvin JS considers structures as a reaction, if there is one arrow on the canvas. 


If you can draw structures with one arrow, this could work.


The other way to export molecules separately is to export these into  MDL SDfile (CTAB v2000) format, but, please consider that in this case the order of the molecules depend on their position on the canvas, and Marvin JS only imports the first molecule from the list. (Also, SDfile do not handle arrows, so in this case the arrow will be lost, but if I understood your purpose well, this will not be a problem.)


I hope this will help.
If you need more information, please do not hesitate to contact us.


Best regards,
Eszter 

User 517cf47a32

20-02-2017 11:50:09

Dear Ezster,


thank you for your helpful answer. I guess I have to split the molecule tag into separate molecules by looking at the bonds.


Martin

ChemAxon 76c88f5366

20-02-2017 16:13:18

Hi Martin,


I consulted with my colleagues in JChem Web Services team, and it seems that if you have JChem Web Services set in your environment, there is a workaround:
With this, you can get the mrv-s containing the molecules in separate molecule tags, even if there is no reaction on the canvas.


What you need to do:


Send a POST request to JChem Web Services with the following parameters:


url:
<webs service base URL>/rest-v0/utilext/convertStream/mrv


body:


{
    "fragmented": "true",
    "data": [
        {
            "structure": source
        }
    ]
} 


You can get the molecule source if you call exportStructure() function on the editor.


 


I hope this will help.


Best regards,
Eszter 

User 517cf47a32

21-02-2017 08:26:34

Thank you for your effort... I'll definitely try this method. 


Martin

ChemAxon 76c88f5366

22-02-2017 08:20:29

Hi Martin, 


If you need further help, let us know.


Best regards,
Eszter 

User 517cf47a32

24-02-2017 10:07:34

Thanks Eszter,


I would use your help one more time, if you don't mind. The webservice you proposed works fine, but the export combines all atoms into an atomArray element, which is different from the classic mrv export, where there's an atomArray element with subelements(atom) for each atom in molecule.


I've tried to find the docs about this webservice, but it seems to be undocumented. I'm sure that there's going to be an option to export atoms individually as atom-elements. Did I miss something?


Thank you Martin

ChemAxon 76c88f5366

24-02-2017 11:41:22

Hi Martin,


In JChem Web Services, the usage of array format for the description of atoms is decided automatically upon the content of the molecule and Marvin JS exports MRV always with it. These MRVs however are exported in slightly different ways, both of these are valid MRV formats, and represent the same structure.


Could you give more details about why you would need the atomArray with atoms in separated atom tags?


That would be a great help. We might find an easy solution for the original problem.


Thank you in advance.


Best regards,
Eszter 

User 517cf47a32

24-02-2017 12:00:33

Thank for your quick response. I understand, that both formats are correct.


It just means, that I need to tweak my code a bit to support this new format, but it should not be an issue.


Martin