import of chemdraw data is reversing reactant order

User d5d3760021

07-10-2016 19:38:08

My program allows users to sketch a reaction in ChemDraw and import into Marvin, however, I'm finding that they can't re-order their reactants. I pasted some sample code below which isolates the issue. If I open the amos_rxn.cdxml in ChemDraw or MarvinSketch, the amine is the 1st reactant, and the acid is the 2nd. In the code below, the rdf format has the acid first, and then the amine.


Are there some special parameters I need when I call importMol? Even if I pass "cdxml" as an input option, I get no error, but the behavior is the same.


Normally, I'd upgrade my version of Marvin, but that's not an option for me at the moment (I'm waiting for some other fixes from you).


Thanks!


 


   @Test
   public void testChemDraw2Marvin() throws Exception {
      byte[] sdData = null;// = outputData.get(exchangeFormat);
      try {
         sdData = Files.readAllBytes(Paths.get("amos_rxn.cdxml"));
      } catch (IOException e) {
         e.printStackTrace();
      }

      System.out.println(new String(sdData));
      chemaxon.struc.Molecule molecule = MolImporter.importMol(sdData);
      System.out.println(MolExporter.exportToFormat(molecule, "rdf"));      
   }


Product Version:
MarvinView 6.0.1
Build Date:
2013-06-21
Internal build id:
6.0.1_b94
Operating System:
x86 Windows 8 6.2
Java:
Oracle Corporation Java 1.7.0_79
Memory:
870.0M maximum, 82.3M total, 34.9M free
Environment:
Application
Browser:
-

ChemAxon 7936325a45

12-10-2016 09:07:42

Hi Amos,


First of all sorry for the late response, but please give us a bit more time. Currently I still have no idea, I try to find a solution which does not need update.


Best regards,
István 

ChemAxon cfb2ce1d3d

13-10-2016 15:03:44

Hi Amos,


What was the drawing order in ChemDraw?


 


Kind regards


Zsolt

ChemAxon cfb2ce1d3d

13-10-2016 15:10:20










zkuti wrote:

Hi Amos,


What was the drawing order in ChemDraw?


 


Kind regards


Zsolt



 


 


OK, please ignore this.

User d5d3760021

13-10-2016 15:11:32

Our needs require users to be able to draw in any order and re-order as they like.


 


I don't recall the sketching order for this case. This case originated from a user but then I manipulated the files trying to understand what was happening too. Have you been able to reproduce the problem I'm seeing? Would it be helpful if I regenerated the files keeping closer track of the order I did it in?

ChemAxon cfb2ce1d3d

17-10-2016 07:39:34

It seems change of ordering happens during export to rdf. Export to simple reaction file (rxn, V2000) preserves order.


I am investigating it.


 


KInd regards


Zsolt

User d5d3760021

17-10-2016 11:48:00

Hello Zsolt,


Thank you for the advice and for investigating this problem. Yes, I tested the rxn format and see that it preserves the order as expected, but it has a different problem in our use case:


https://www.chemaxon.com/forum/viewpost65545.html#65545


In the meantime, I've been exploring atom.setRgroup(rgroup); where rgroup is extracted using a regex from the original text. This approach was suggested to me by a colleague on a different project. This seems to work for now, although I'd prefer to have something more robust eventually.


For what it's worth, I think I tried the .skc format, and I couldn't switch orders there either, but I wasn't careful about my testing. The .skc format, as written by ChemDraw, ends up changing colors in Marvin anyway compared to other file formats, so it wasn't as attractive.


Thank you,


Amos.

ChemAxon cfb2ce1d3d

19-10-2016 06:24:24

Hi Amos,


I am glad you could find some workaround for the time being because although I've found where this unwanted reordering happens it is still to be decided how to resolve it.


We will let you know when the fix is available.


 


Kind regards


Zsolt

User d5d3760021

24-01-2017 14:50:56

Hello Zsolt,


Any update on this issue?


 


Our workaround doesn't work in cases where we don't have code, e.g., copy/paste directly between the ChemDraw viewer and Marvin.


 


Thanks,


Amos.

ChemAxon cfb2ce1d3d

26-01-2017 09:43:25










nitroamos wrote:

Hello Zsolt,


Any update on this issue?


 


Our workaround doesn't work in cases where we don't have code, e.g., copy/paste directly between the ChemDraw viewer and Marvin.


 


Thanks,


Amos.



Hi Amos,


Unfortunately I cannot report any progress on this, it is still on our todo list.


 


Kind regards


Zsolt