OSRA

ChemAxon 0265132c1a

27-09-2011 18:11:43

Az Open graphics a Help fájlban nagyon röviden van elintézve, mindössze
annyit találtam róla, hogy "Tries to convert an image file to a structure
using OSRA."

Sokféle képpen próbálgattam ,de csak az  "Internal error: cannot create new
instance for the osraimage importer module" hibaüzenetet tudtam
reprodukálni.

Mit kéne ennek tudnia pontosan és hogyan?

Üdvözlettel



Gunda Tamás

ChemAxon 5433b8e56b

05-10-2011 01:52:56

Hi Jancsi and Tamas,


first of all, sorry for the late answer.


I will improve the documentation in 5.7. About OSRA the followings is important to know.


OSRA is an OCR tool that can be used by Marvin, if it is properly installed on the client that is running Marvin. It has a download page that is linked in the reffered documentation page.


The new version of OSRA (1.3.8) comes with a Windows installer, that installs the dependecies of OSRA, the older versions required some other programs to be installed to run properly, the dependencies were listed in its documentation. (As i remember, OpenBabel, and GhostScript was required when i firstly installed OSRA.)


After installing an earlier version then 1.3.8 and its requirements, an environment variable had to been set in Windows called OSRA, it had to contain the path of the osra.bat file. In Marvin prior to 5.6 version we used this variable to search the OSRA executable, and executed OSRA as a separate process to create a molfile from the image (this can be done by running 'osra.bat -f mol filepath' command also). After that we loaded the molecule that has been recognized by OSRA from the molfile output of the command.


In Marvin 5.6 we introduced an improvement, if the path of OSRA is set in the PATH environment variable then Marvin finds it also. Unfortunatelly the implementation has a mistake that will be fixed in 5.7, and because of this bug in 5.6 it is usable only when the path of the OSRA executable is set in the PATH environment variable. In 5.7 OSRA environment variable will also be used again.


As i noticed, the new installer of OSRA sets the OSRA environment variable while installing itself, so the installation would be more easier with the new versions.


If OSRA is properly installed, Marvin can load structures from image files also. The recognition of the image contents may have small mistakes, but it generates acceptable results.


I hope i described the usage and possibilities well, if you have more questions, or need more detailed information, please do not hasitate to ask.


Regards,
Istvan

User 81c70b5951

29-11-2011 03:37:22

unfortunately running OSRA from MarvinSketch is still broken in 5.7.


This is what I got in 5.7.0 I installed a few minutes ago. It's an obvious problem - the OSRA directory was appended with "\" for whatever reason - it's not going to work on Linux, nor - I suspect - on OSX.


chemaxon.formats.MolFormatException: Internal error: cannot create new instance for the png importer module
    at chemaxon.formats.MolImporter.init(MolImporter.java:553)
    at chemaxon.formats.MolImporter.<init>(MolImporter.java:138)
    at chemaxon.marvin.sketch.swing.SketchPanel.doOpenImage(SketchPanel.java:1652)
    at chemaxon.marvin.sketch.swing.actions.OpenImageAction.actionPerformed(OpenImageAction.java:34)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:374)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:829)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:873)
    at java.awt.Component.processMouseEvent(Component.java:6268)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6033)
    at java.awt.Container.processEvent(Container.java:2045)
    at java.awt.Component.dispatchEventImpl(Component.java:4629)
    at java.awt.Container.dispatchEventImpl(Container.java:2103)
    at java.awt.Component.dispatchEvent(Component.java:4455)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
    at java.awt.Container.dispatchEventImpl(Container.java:2089)
    at java.awt.Window.dispatchEventImpl(Window.java:2517)
    at java.awt.Component.dispatchEvent(Component.java:4455)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
    at java.awt.EventQueue.access$000(EventQueue.java:96)
    at java.awt.EventQueue$1.run(EventQueue.java:608)
    at java.awt.EventQueue$1.run(EventQueue.java:606)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
    at java.awt.EventQueue$2.run(EventQueue.java:622)
    at java.awt.EventQueue$2.run(EventQueue.java:620)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: java.io.IOException: An error occured in the OSRA software
The problem can be one of the following common problems:
- OSRA can not open small images, and molecules (less than 6 atoms)
- OSRA can not open all image file types perfectly, in some cases conversion to png file format helps
- to open a pdf/ps file Adobe Acrobat Reader/Ghostscript has to be installed

    at chemaxon.marvin.io.image.importer.ImageImportModule.initMolImport(ImageImportModule.java:127)
    at chemaxon.marvin.io.MRecordImporter.<init>(MRecordImporter.java:286)
    at chemaxon.formats.MolImporter.init(MolImporter.java:543)
    ... 41 more
Caused by: java.io.IOException: Cannot run program "/usr/local/bin\osra" (in directory "/usr/local/bin"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
    at java.lang.Runtime.exec(Runtime.java:610)
    at chemaxon.marvin.io.util.OSRA.readSDFFromFile(OSRA.java:168)
    at chemaxon.marvin.io.util.OSRA.readSDFFromStream(OSRA.java:138)
    at chemaxon.marvin.io.image.importer.ImageImportModule.initMolImport(ImageImportModule.java:117)
    ... 43 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
    ... 47 more

ChemAxon 5433b8e56b

08-12-2011 14:41:51

Hi,


we have made some refactoring, and improvement in the OSRA related code, it seems we have made a mistake unfortunatelly, and a platform dependent code remained in the codebase.


We will include the fix in the upcoming releases that comes after 5.7.1, sorry for the inconvenience.


Regards,
Istvan

User 81c70b5951

09-12-2011 01:47:50

Istvan,


Thank you for your reply!


 


Igor