Problem with positive Charged Smiles

User fca35de8d7

23-10-2013 17:45:09

Hello,


when we open a SMILEs of a positive charged molecule we got the following exeption:


Molfile cannot be loaded because an error occured:
chemaxon.formats.MolFormatException: Cannot read molecule file.

#ffffffffffffffff

STACK TRACE:
chemaxon.formats.MolFormatException: Cannot read molecule file.
    at chemaxon.formats.MolInputStream.a(Unknown Source)
    at chemaxon.formats.MolInputStream.<init>(Unknown Source)
    at chemaxon.marvin.util.MolLoader.a(Unknown Source)
    at chemaxon.marvin.util.MolLoader.run(Unknown Source)
    at chemaxon.marvin.common.swing.MolPanel.startLoader(Unknown Source)
    at chemaxon.marvin.view.swing.ViewPanel.startstop(Unknown Source)
    at chemaxon.marvin.applet.JMView.createGUI(Unknown Source)
    at chemaxon.marvin.applet.AbstractMarvinApplet.init(Unknown Source)
    at chemaxon.marvin.applet.JMViewLaunch.showApplet(Unknown Source)
    at chemaxon.marvin.applet.AppletLaunch$3.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: chemaxon.formats.MolFormatException: Cannot recognize format (?)
Unrecognized file contents:
Cc1ccc(OCCN2C(=O)c3cccc(c3C2=O)[N ]([O-])=O)cc1
    at chemaxon.formats.recognizer.RecognitionSubsystem.getFormat(Unknown Source)
    at chemaxon.formats.MolInputStream.c(Unknown Source)
    at chemaxon.formats.MolInputStream.a(Unknown Source)
    ... 23 more


 


The original SMILES is:


C(c1cc2ccccc2c2ccccc12)[P+](c1ccccc1)(c1ccccc1)c1ccccc1


and the code is:


<!-- et CODEBASE="js/marvin" ARCHIVE="appletlaunch.jar" CODE="chemaxon/marvin/applet/JMViewLaunch" WIDTH=300 HEIGHT=300>
<PARAM NAME="mol" VALUE=<%=smiles%> >
<strong>Your browser does not support the applet tag.</strong>
</app -->



 


How can we fix that Problem?


Thanks for help.


 


Bernd

ChemAxon 4fa3cf533c

24-10-2013 09:14:19

Hello,


From the stack trace, it seems that it is not the same molecule, its not 


C(c1cc2ccccc2c2ccccc12)[P+](c1ccccc1)(c1ccccc1)c1ccccc1


but instead 


Cc1ccc(OCCN2C(=O)c3cccc(c3C2=O)[N ]([O-])=O)cc1


and the problem is that there is one space after the second nitrogen between the brackets.




Best regards,


Tamas Fazekas-Vigh

User bc64e3e7cf

24-10-2013 09:29:58

Hello tfazekas,


 


i get this Problem too always when the Structure has positive charge ??


like



[O-][N+](=O)c1cc(ccc1Cl)S(=O)(=O)C(F)F

[O-][N+](=O)c1ccc(OCCCl)c(OCCCl)c1

CC(C1CC1)N(C(=O)c1ccccc1[N+]([O-])=O)c1ccccc1


and the same will happen if we have P+


i tried with MolHandler to get a MoleculeObject from Smiles but
i get the same Result --> Exception


ERROR:
Molfile cannot be loaded because an error occured:
chemaxon.formats.MolFormatException: Cannot read molecule file.

#ffffffffffffffff

STACK TRACE:
chemaxon.formats.MolFormatException: Cannot read molecule file.
    at chemaxon.formats.MolInputStream.a(Unknown Source)
    at chemaxon.formats.MolInputStream.<init>(Unknown Source)
    at chemaxon.marvin.util.MolLoader.a(Unknown Source)
    at chemaxon.marvin.util.MolLoader.run(Unknown Source)
    at chemaxon.marvin.common.swing.MolPanel.startLoader(Unknown Source)
    at chemaxon.marvin.view.swing.ViewPanel.startstop(Unknown Source)
    at chemaxon.marvin.applet.JMView.createGUI(Unknown Source)
    at chemaxon.marvin.applet.AbstractMarvinApplet.init(Unknown Source)
    at chemaxon.marvin.applet.JMViewLaunch.showApplet(Unknown Source)
    at chemaxon.marvin.applet.AppletLaunch$3.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: chemaxon.formats.MolFormatException: Cannot recognize format (?)
Unrecognized file contents:
Molecule@22df4e2c[16a,16b]
    at chemaxon.formats.recognizer.RecognitionSubsystem.getFormat(Unknown Source)
    at chemaxon.formats.MolInputStream.c(Unknown Source)
    at chemaxon.formats.MolInputStream.a(Unknown Source)
    ... 23 more


with best Regards,

Raed



User fca35de8d7

24-10-2013 10:39:19

Ups, this was my fault:


the original smiles was:


Cc1ccc(OCCN2C(=O)c3cccc(c3C2=O)[N+]([O-])=O)cc1


 


but the stack trace show that the plus is replaced by a space with the shown code.


Thanks


 


Bernd

ChemAxon 4fa3cf533c

24-10-2013 11:47:28

Which Marvin version did you use ? I tried to reproduce your case with 6.1 and 6.0 but it did not threw any exception.


 


 


 


Tamás Fazekas-Vígh 

User fca35de8d7

24-10-2013 12:40:50

Hello,


we use 6.1, 6.0 and 5.12..


How did you transfer the SMILES string into the applet?


We saw that we have the correct string in the Page source but during the interpretation of the source in the browser we lost the plus!?


We found some copy and paste problems in the first code example on the threat.




Here the Corrected code:


<applet CODEBASE="js/marvin" ARCHIVE="appletlaunch.jar" CODE="chemaxon/marvin/applet/JMViewLaunch" WIDTH=300 HEIGHT=300>
<PARAM NAME="mol" VALUE=<%=smiles%> >
<strong>Your browser does not support the applet tag.</strong>
</applet>



 


 


Thanks for help,


 


Bernd

User bc64e3e7cf

29-10-2013 13:29:18

Hi ,


you can start JavaScript to show the Structure (Molecule) as smiles in MarvinView if it has a positive Charge


without Exception but if you want to show the Structure with Applet and the Structure has a positive Cahrge


you can't do that because you will get an Exception  ?


i tried with it and always i get the same result as i mention Exception, i prefer to use Applet


because if you get Java-update in your Browser JS doesn't work well sometimes.


i speak only about WebApplication e.g JSP (No Swing & AWT or Desktop/-Application).


 


thanks,


Raed

ChemAxon 4fa3cf533c

30-10-2013 10:23:37

The problem is described here : http://stackoverflow.com/questions/7842547/request-parameter-losing-plus-sign


When we deploy the applet using marvin.js we encode the string what you give to the applet by a param, so the plus sign is not lost, however if you deploy manually within an applet tag this conversion doesn't happen.


I recommend to use marvin.js to deploy the applet, or try to apply the solution mentioned in the stackoverflow link.


Hope this helps,


Tamas Fazekas-Vigh

User bc64e3e7cf

30-10-2013 13:29:53

Hello Tamas Fazekas-Vigh


thanks alot for your Answer, i tried it and it goes well as i read here


http://stackoverflow.com/questions/7842547/request-parameter-losing-plus-sign


 


 


thank you.


Raed