Giter Site home page Giter Site logo

draeger-lab / escherconverter Goto Github PK

View Code? Open in Web Editor NEW
15.0 7.0 10.0 17.13 MB

A standalone program that reads files created with the graphical network editor Escher and converts them to files in community standard formats.

Home Page: https://draeger-lab.github.io/EscherConverter/

License: MIT License

Java 69.65% HTML 0.33% XSLT 21.42% Python 4.87% JavaScript 2.37% CoffeeScript 0.17% Shell 0.02% Pug 0.84% Stylus 0.34%
escher standalone flask command-line computational-biology systems-biology java converts sbml

escherconverter's Introduction

EscherConverter1.2

A standalone program that reads files created with the graphical network editor Escher and converts them to files in community standard formats.

License (MIT) Latest version DOI Build Status

Authors: Andreas Dräger, Devesh Khandelwal, Maria Heitmeier


Quick-start

Get a local copy of EscherConverter from here. As a Java™ application, the only thing needed is a valid Java(JRE) 8+ installation present. After that you can either open the JAr by double-clicking it or use it from the command line as below.

On Unix-like system (Ubuntu, Fedora, macOS, etc.):

bash$ java -jar -Xms8G -Xmx8G -Duser.language=en ./EscherConverter.jar --help

On Windows:

C:\> javaw -jar -Xms8G -Xmx8G -Duser.language=en EscherConverter-0.5 --help

Included third-party software

EscherConverter includes several third-party libraries, which we here list and acknowledge:

  • ArgParser
  • JSBML
  • libSBGN
  • Pixel-Mixer icons
  • yFiles (obfuscated)
  • Randelshofer's macOS filechooser
  • Jackson

Options include:

--help, -? Displays help information

Input and output

--input=<string> Specifies the JSON input file. If a directory is given, the conversion will be recursively performed. Accepts JSON.

--output=<string> The path to the file into which the output should be written. If the input is a directory, this must also be a directory in order to perform a recursive conversion. Accepts SBML, SBGN.

Layout

--canvas-default-height=<float [1,1E9]> Just as in the case of the width of the canvas, this value needs to be specified for cases where the JSON input file lacks an explicit specification of the canvas height.

--canvas-default-width=<float [1,1E9]> This value is used when no width has been defined for the canvas. Since the width attribute is mandatory for the layout, a default value must be provided in these cases.

--label-height=<float [1,1E9]> With this option you can specify the height of the bounding box of text labels.

--label-width=<float [1,1E9]> This option defines the width of bounding boxes for text labels.

--node-depth=<float [1,1E9]> The length of nodes along z-coordinate. Escher maps are actually two-dimensional, but in general, a layout can be three-dimensional. This value should be an arbitrary value greater than zero, because some rendering engines might not display the node if its depth is zero.

--node-label-height=<float [1,1E9]> Node labels can have a size different from general labels in the graph. Here you can specify how height the bounding box of the labels for nodes should be.

--primary-node-height=<float [1,1E9]> The primary node should be bigger than the secondary node. With this option you can specify the height of this type of nodes.

--primary-node-width=<float [1,1E9]> Escher maps distinguish between primary and secondary nodes. Primary nodes should be larger than secondary nodes and display the main flow of matter through the network. This option allows you to specify the width of primary nodes.

--reaction-label-height=<float [1,1E9]> Reaction label height

--reaction-node-ratio=<float [0,1]> This value is used as a conversion factor to determine the size of the reaction display box depending on the size of primary nodes. Height and width of reaction nodes are determined by dividing the corresponding values from the primary node size by this factor.

--secondary-node-ratio=<float [0,1]> Similar to the reaction node ratio, the size of secondary nodes (width and height) is determined by dividing the corresponding values from the primary nodes by this value.

--z=<float [-1E9,1E9]> The position on the z-axis where the entire two-dimensional graph should be drawn.

Components and their naming

--format=<string {SBGN,SBML,Escher}> The desired format for the conversion, e.g., SBML.

--layout-id=<string> In contrast to the name, this identifier does not have to be human-readable. This is a machine identifier, which must start with a letter or underscore and can only contain ASCII characters.

--layout-name=<string> This should be a human-readable name for the layout that is to be created. This name might be displayed to describe the figure and should therefore be explanatory.

--compartment-id=<string> A compartment needs to have a unique identifier, which needs to be a machine-readable Sting that must start with a letter or underscore and can only contain ASCII characters. Since the JSON file does not provide this information, this option allows you to specify the required identifier.

--compartment-name=<string> With this option it is possible to define a name for the default compartment can be that needs to be generated for the conversion to SBML. The name does not have any restrictions, i.e., any UTF-8 character can be used.

--infer-compartment-bounds=<boolean> This converter can infer where the boundaries of compartments could be drawn. To this end, it uses each node's BiGG ids to identify the compartment of all metabolites. Assuming that compartments have rectangular shapes, the algorithm can find the outermost node on each side of the box and hence obtain the boundaries of the compartment. However, this methods will fail when metabolites are drawn inside of such a box that belong to a different compartment that is actually further outside. For this reason, this option is deactivated by default.

Further options

--combine=<boolean> If the SBML file contains more than one layout, whether to combine them or not. False by default.

--extract-cobra=<boolean> If SBMl file is FBC compliant, then extract COBRA model from it. Defaults to false.

Options for the graphical interface

--check-for-updates=<boolean> If true, when application is started it checks for updates on the internet.

--gui=<boolean> If true, graphical user interface is displayed.

--log-level=<string {"OFF","SEVERE","WARNING","INFO","CONFIG","FINE","FINER","FINEST","ALL"}> Change the log-level of this application. This option will influence how fine-grained error and other log messages will be that you receive while executing this program.

--log-file=<string> This option allows you to specify a log file to which all information of the program will be written. Accepts log-File (*.log).

escherconverter's People

Contributors

dependabot[bot] avatar devetter avatar devkhan avatar draeger avatar eikept avatar mariahei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

escherconverter's Issues

Connections gone after conversion

I used KeggTranslator to convert a KGML file to SBML. Then am using the EscherConverter to convert it to JSON map file to put into Escher. However, when I load the converted map to Escher, the arrows and connectors (ie the reaction direction) are gone:

escher_img

ReconMap returns NullPointerException

When trying to convert the ReconMap SBML file to Escher, there is a NullPointerException.

Options were all set to default:
grafik

Stack trace:

12:52:16 edu.ucsd.sbrg.escher.gui.SBMLLayoutViewPanel lambda$0 --- WARNUNG: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at javax.swing.SwingWorker.get(Unknown Source)
at edu.ucsd.sbrg.escher.gui.SBMLLayoutViewPanel.lambda$0(SBMLLayoutViewPanel.java:84)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at sun.swing.AccumulativeRunnable.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at de.zbit.sbml.layout.y.c.F(YReversibleConsumption.java:50)
at de.zbit.sbml.layout.y.c.draw(YReversibleConsumption.java:41)
at de.zbit.sbml.layout.y.R.A(YAbstractSBGNArc.java:69)
at de.zbit.sbml.layout.y.R.draw(YAbstractSBGNArc.java:43)
at de.zbit.sbml.layout.y.N.buildConnectingArc(YLayoutBuilder.java:325)
at de.zbit.sbml.layout.LayoutDirector.handleReactionGlyph(LayoutDirector.java:761)
at de.zbit.sbml.layout.LayoutDirector.handleReactionGlyphs(LayoutDirector.java:708)
at de.zbit.sbml.layout.LayoutDirector.buildLayout(LayoutDirector.java:434)
at de.zbit.sbml.layout.LayoutDirector.run(LayoutDirector.java:863)
at de.zbit.sbml.layout.y.LayoutDirectionTask.doInBackground(LayoutDirectionTask.java:72)
at de.zbit.sbml.layout.y.LayoutDirectionTask.doInBackground(LayoutDirectionTask.java:34)
at javax.swing.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at javax.swing.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Conversion stops at CreateMultiMarkers if neither BoundingBox nor Curve are set

When converting the file GlycolysisLayout_small.sbml.xml from data the conversion stops at edu.ucsd.sbrg.escher.converter.SBML2Escher createMultiMarkers --- INFORMATION: creating multi-markers from species reference glyph (SpeciesReferenceGlyph_01). This is probably because in this SpeciesReferenceGlyph BoundingBox is not set and while isSetCurve = true, getCurve = [] .

Error in test SBGN file validation

The jar is runnable now, and it also shows the options properly. But the following error still shows up before starting. I've placed a test.sbgn file at the appropriate place.

java.lang.NullPointerException
    at org.sbgn.schematron.SchematronValidator.doValidation(SchematronValidator.java:72)
    at org.sbgn.schematron.SchematronValidator.validate(SchematronValidator.java:46)
    at edu.ucsd.sbrg.escher.EscherConverter.main(EscherConverter.java:163)
objc[8317]: Class SheetSupport is implemented in both <br />
<PROJECT_DIR>/EscherConverter/libquaqua64.jnilib and <PROJECT_DIR>/EscherConverter/libquaqua64.dylib. One of the two will be used. Which one is undefined.

Archive end-point in the API

Create a new end-point /convert/{convert_id}/archive which returns an archive containing all file (input, output, and logs). The Content-Type will most probably be octet-stream. Implementing this is simple, since every conversion is already stored in a separate folder with convert_id as its name an archive can be made simply either by a shell command or python.

zip is fine, but gzip will be better for larger files.

Documentation

JavaDoc is available, but it barely of any use given the nature of this project. So, we need the good old hand-written docs for usage and understanding the structure of the project.

Either one of .rst or .md can be used (because we may also host them on readthedocs).

JAR not working

If I run the EscherConverter.main(String...) from the IDE or command-line(like in Travis), everything works fine. But if I try to run the exported runnable JAR, it throws:

Error: Could not find or load main class edu.ucsd.sbrg.escher.EscherConverter

I don't what's causing this, but this is a big problem as it will be released as a JAR, so it needs to be resolved. @draeger Can you look into what might be causing this? The manifest is also correct.

Version not showing up

Trying to export SBML:

<!-- Created by EscherConverter version @app.version@ on 2016-17-22 at 15:17:22 IST with JSBML version 1.1. -->

Have to figure out why version property is not written. Will do it later.

Incompatibility with SBGN because of dependency conflict

Recently, the dependency to JDOM was updated because of a potential security issue. Unfortunately, libSBGN still relies on the older library. Consequently, the main repository is currently unable to produce SBGN nor to build correctly. This requires a fix. At best, the SBGN library needs to be updated.

NullPointerException when inferring compartment boundaries

When trying to open e_coli_core_metabolism.escher.json with inferring compartment boundaries set to true, a NullPointerException occurs:

grafik

26.07.2019 16:02:30 de.zbit.gui.GUITools showErrorMessage --- WARNUNG: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at javax.swing.SwingWorker.get(Unknown Source)
	at edu.ucsd.sbrg.escher.gui.EscherMapDisplay.lambda$0(EscherMapDisplay.java:63)
	at java.beans.PropertyChangeSupport.fire(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
	at sun.swing.AccumulativeRunnable.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
	at javax.swing.Timer.fireActionPerformed(Unknown Source)
	at javax.swing.Timer$DoPostEvent.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
	at edu.ucsd.sbrg.escher.converter.Escher2SBML.createCompartmentGlyph(Escher2SBML.java:143)
	at edu.ucsd.sbrg.escher.converter.Escher2SBML.convert(Escher2SBML.java:122)
	at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:143)
	at edu.ucsd.sbrg.escher.gui.EscherConverterWorker.doInBackground(EscherConverterWorker.java:64)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

SBML support in API

Right now, the API only support SBML <--> Escher conversion. The command line executable does support SBML export, but this is not implemented in the API (and hence, web app).

The important decision to make here is whether to allow layouts of an SBML to be downloaded (like /output/{file_id}/{layout_id}) or just the first one.

This needs to be done before #27.

Extract COBRA model from SBML

This is half-implemented, awaiting just a bug fix. The logic for this is sort of already implemented in EscherConverter.extractCobraModel(File), but the python command doesn't work.

So, only fixing that should probably be enough for this to work, but there may be other issues.

WriteEscherJson cannot create new files

When using the command line to convert from SBML to Escher and specifying a non-existent file as output, a NullPointerException occurs:
java -jar -Xms8G -Xmx8G -Duser.language=en EscherConverter-1.2.0.jar --input=hsa00630.sbml --format=Escher --output=h630Test6.json --gui=false

Exception in thread "main" java.lang.NullPointerException
        at edu.ucsd.sbrg.escher.EscherConverter.writeEscherJson(EscherConverter.java:696)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:477)
        at edu.ucsd.sbrg.escher.EscherConverter.batchProcess(EscherConverter.java:332)
        at edu.ucsd.sbrg.escher.EscherConverter.commandLineMode(EscherConverter.java:384)
        at de.zbit.Launcher.launchCommandLineMode(Launcher.java:725)
        at de.zbit.Launcher.run(Launcher.java:862)
        at de.zbit.Launcher.<init>(Launcher.java:211)
        at edu.ucsd.sbrg.escher.EscherConverter.<init>(EscherConverter.java:263)
        at edu.ucsd.sbrg.escher.EscherConverter.main(EscherConverter.java:253)

SBML format convertion into Json file

Hello everyone,
I am new to Escher converter and I was wondering if :
First, convert directly ,using a python code, a SBML file (containing a model at a genome scale) into a Json file in order to export a map of all the reactions and metabolites present in the model.
Secondly, do we have to build the map manually ? or is there a quicker way maybe using a python code library ?
Finally, I saw an automatic pipeline using escher allowing the user to graphically change the fluxes and predict an objective function using the FBA nor the FVA. Is there any documentation on this pipeline ?
Thanks in advance guys :-)

WARNING: java.lang.IllegalArgumentException: Invalid label bounds

Hi, I get a WARNING: java.lang.IllegalArgumentException: Invalid label bounds error when I am trying to convert my SBML file to a map JSON file. I used KeggTranslator to convert a KGML file to SBML_L3V1. Then am using the EscherConverter to convert it to JSON map file to put into Escher. Yet I get the following error:

11-Jan-2019 10:44:38 AM edu.ucsd.sbrg.escher.gui.SBMLLayoutViewPanel lambda$setSBMLLayout$19 --- WARNING: java.lang.IllegalArgumentException: Invalid label bounds: y.A.I.L[anchorX=NaN;anchorY=NaN;width=160.0;height=20.0;upX=0.0;upY=-1.0]
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Invalid label bounds: y.A.I.L[anchorX=NaN;anchorY=NaN;width=160.0;height=20.0;upX=0.0;upY=-1.0]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at javax.swing.SwingWorker.get(SwingWorker.java:602)
	at edu.ucsd.sbrg.escher.gui.SBMLLayoutViewPanel.lambda$setSBMLLayout$19(SBMLLayoutViewPanel.java:85)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(SwingWorker.java:854)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(SwingWorker.java:860)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
	at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
	at javax.swing.Timer.fireActionPerformed(Timer.java:313)
	at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.IllegalArgumentException: Invalid label bounds: y.A.I.L[anchorX=NaN;anchorY=NaN;width=160.0;height=20.0;upX=0.0;upY=-1.0]
	at y.A.F.h.A(Unknown Source)
	at y.A.H.w.D(Unknown Source)
	at de.zbit.sbml.layout.y.M.A(YLayoutBuilder.java:595)
	at de.zbit.sbml.layout.y.M.builderEnd(YLayoutBuilder.java:760)
	at de.zbit.sbml.layout.LayoutDirector.buildLayout(LayoutDirector.java:441)
	at de.zbit.sbml.layout.LayoutDirector.run(LayoutDirector.java:795)
	at de.zbit.sbml.layout.y.LayoutDirectionTask.doInBackground(LayoutDirectionTask.java:72)
	at de.zbit.sbml.layout.y.LayoutDirectionTask.doInBackground(LayoutDirectionTask.java:34)
	at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at javax.swing.SwingWorker.run(SwingWorker.java:334)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I have also attached my output from KeggTranslator.

hsa00630.sbml.zip

Any help is much appreciated.

Inability to detect nodes leads to NullPointerException

When trying to convert a sample file from the Newt project like for example the Neuronal muscle signalling from SBGN-ML to SBML, a NullPointerException is returned, presumably because a node cannot be found when preprocessing reactions:

17.07.2019 11:20:52 edu.ucsd.sbrg.escher.converter.Escher2Standard preProcessReaction --- WARNUNG: Metabolite 'choline' in reaction 'R0' lacks a corresponding node.
17.07.2019 11:20:52 de.zbit.gui.GUITools showErrorMessage --- WARNUNG: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at javax.swing.SwingWorker.get(Unknown Source)
	at edu.ucsd.sbrg.escher.gui.EscherMapDisplay.lambda$0(EscherMapDisplay.java:63)
	at java.beans.PropertyChangeSupport.fire(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
	at sun.swing.AccumulativeRunnable.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
	at javax.swing.Timer.fireActionPerformed(Unknown Source)
	at javax.swing.Timer$DoPostEvent.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
	at edu.ucsd.sbrg.escher.converter.Escher2Standard.preProcessReaction(Escher2Standard.java:237)
	at edu.ucsd.sbrg.escher.converter.Escher2Standard.preprocessDataStructure(Escher2Standard.java:217)
	at edu.ucsd.sbrg.escher.converter.Escher2SBML.convert(Escher2SBML.java:100)
	at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:143)
	at edu.ucsd.sbrg.escher.gui.EscherConverterWorker.doInBackground(EscherConverterWorker.java:64)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at javax.swing.SwingWorker.get(Unknown Source)
	at edu.ucsd.sbrg.escher.gui.EscherMapDisplay.lambda$0(EscherMapDisplay.java:63)
	at java.beans.PropertyChangeSupport.fire(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
	at sun.swing.AccumulativeRunnable.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
	at javax.swing.Timer.fireActionPerformed(Unknown Source)
	at javax.swing.Timer$DoPostEvent.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
	at edu.ucsd.sbrg.escher.converter.Escher2Standard.preProcessReaction(Escher2Standard.java:237)
	at edu.ucsd.sbrg.escher.converter.Escher2Standard.preprocessDataStructure(Escher2Standard.java:217)
	at edu.ucsd.sbrg.escher.converter.Escher2SBML.convert(Escher2SBML.java:100)
	at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:143)
	at edu.ucsd.sbrg.escher.gui.EscherConverterWorker.doInBackground(EscherConverterWorker.java:64)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Conversion SBML -> Escher creates mistake in file

Apparently, something goes wrong in the conversion from SBML to Escher.
Converting from SBML to Escher works:
java -jar -Xms8G -Xmx8G -Duser.language=en EscherConverter-1.2.1.jar --input=GlycolysisLayout_small.sbml.xml --format=Escher --output=glycolysis.json --gui=false
But going back doesn't work, so presumably, the converted output of the first command is wrong:
java -jar -Xms8G -Xmx8G -Duser.language=en EscherConverter-1.2.1.jar --input=glycolysis.json --format=SBML --output=glycolysis.sbml --gui=false

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:658)
        at de.zbit.sbml.util.SBMLtools.toSId(SBMLtools.java:255)
        at edu.ucsd.sbrg.escher.converter.Escher2SBML.createSpeciesReferenceGlyphs(Escher2SBML.java:681)
        at edu.ucsd.sbrg.escher.converter.Escher2SBML.convertReaction(Escher2SBML.java:278)
        at edu.ucsd.sbrg.escher.converter.Escher2SBML.convert(Escher2SBML.java:112)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:143)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:195)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:450)
        at edu.ucsd.sbrg.escher.EscherConverter.batchProcess(EscherConverter.java:327)
        at edu.ucsd.sbrg.escher.EscherConverter.commandLineMode(EscherConverter.java:384)
        at de.zbit.Launcher.launchCommandLineMode(Launcher.java:725)
        at de.zbit.Launcher.run(Launcher.java:862)
        at de.zbit.Launcher.<init>(Launcher.java:211)
        at edu.ucsd.sbrg.escher.EscherConverter.<init>(EscherConverter.java:263)
        at edu.ucsd.sbrg.escher.EscherConverter.main(EscherConverter.java:253)

The reason for this error is a mistake in a metabolite, which presumably is caused by the first conversion:
Metabolite [coefficient=NaN, id=, nodeRefId=null]

Build broken after jdom upgrade

jdom was upgraded to jdom2 in this commit.

edu.ucsd.sbrg.escher.util.Validator expects a org.jdom.JDOMException, but it's moved to org.jdom2.JDOMException. org.sbgn raises this exception, so we can't simply replace the import. Because of this, the build fails.

We will have to upgrade/modify the SBGN lib, or find another way.

Complete re-write of web-app's front-end

The not-at-all good looking client-side of the web-app needs to be written properly. Initially it was written quickly without caring about design, best practices, or maintenance. And I must be blamed for that.

Important points to consider:

  • Using a data-binding library like Rivets instead of DOM manipulation (which will(has) inherently lead to callback mess).
  • The current CSS library Picnic is fine, but it can be changed. It just needs to be lightweight.
  • The most important thing to remember is to keep it light (it weighs ~40 KB right now).

Not able to build

So, I was trying to build this project using IntelliJ IDEA with Maven build system. At first, it didn't auto-detect any libs, so I manually added the jars in the libs directory. But now it throwing the following error:

image

Also, when I looked into the jar, there wasn't any package named actioncommand, what could be the problem?

/cc @draeger @zakandrewking

Reading input file json file

I have imported a json file into EscherConverter 1.2.0. On the bottom left it says it is reading the input file... I was wondering how long does this process usually take or is there something wrong?

testOct31.json

Converting .json file to .sbml and back returns an IllegalArgumentException

When converting a .json file to .sbml and then converting this .sbml file back to .json, the following error is returned:
java.lang.IllegalArgumentException: Cannot register layout.

Options are set to default:
grafik

Stack trace:

ERROR (Model.java:4689) - An element of type model with the id "Escher_Layout" is already present in this model "Escher_Layout". The new element of type layout will not be added to the model.
25.04.2019 10:36:53 de.zbit.gui.GUITools showErrorMessage --- WARNUNG: java.lang.IllegalArgumentException: Cannot register layout.
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Cannot register layout.
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at javax.swing.SwingWorker.get(Unknown Source)
	at edu.ucsd.sbrg.escher.gui.EscherMapDisplay.lambda$0(EscherMapDisplay.java:62)
	at java.beans.PropertyChangeSupport.fire(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
	at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
	at sun.swing.AccumulativeRunnable.run(Unknown Source)
	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
	at javax.swing.Timer.fireActionPerformed(Unknown Source)
	at javax.swing.Timer$DoPostEvent.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Cannot register layout.
	at org.sbml.jsbml.AbstractSBase.registerChild(AbstractSBase.java:2221)
	at org.sbml.jsbml.ListOf.add(ListOf.java:445)
	at org.sbml.jsbml.ext.layout.LayoutModelPlugin.addLayout(LayoutModelPlugin.java:102)
	at org.sbml.jsbml.ext.layout.LayoutModelPlugin.createLayout(LayoutModelPlugin.java:124)
	at edu.ucsd.sbrg.escher.converter.Escher2SBML.initLayout(Escher2SBML.java:948)
	at edu.ucsd.sbrg.escher.converter.Escher2SBML.convert(Escher2SBML.java:105)
	at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:142)
	at edu.ucsd.sbrg.escher.gui.EscherConverterWorker.doInBackground(EscherConverterWorker.java:63)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Problem in SBGN file detection

The SBFileFilter.isSBGNFile(File) method returns false on SBGN-ML Milestone 1 files.

I traced back through the library, and found out that the regex for matching the head of SBGN files is:

<sbgn[\s]+[\s\w\p{ASCII}]*xmlns[\s]*=[\s]*["']http[s]?://sbgn.org/libsbgn/[0-9]+[0-9]*\.[0-9]+[0-9]*[/]?["'][\s]*[\s\w\p{ASCII}]*>

which matches <sbgn xmlns="http://sbgn.org/libsbgn/0.2">, but doesn't matches <sbgn xmlns="http://sbgn.org/libsbgn/pd/0.1">.

Live version returns a 403 Forbidden

Hello,

Just to let you know that the link in the README toward the live version of EscherConverter returns a 403 Forbidden error for me:

Forbidden

You don't have permission to access / on this server.

Possible causes of this error include:

    The request was forbidden by rules in the .htaccess file.
    The directory you requested does not have an index.html or index.php file.
    The permissions on the file or directory are incorrect.

For details about why the request was forbidden, see the Apache error log at:

/srv/users/SYSUSER/log/APPNAME/APPNAME_apache.error.log

Is that an expected behaviour?

Wishlist

This is a tracker issue for the tasks which are at current priority before starting to actually implement the conversion. Refer this.

To-Do:

Higher Priority:

  • Refactor #7
  • Code cleanup #7
  • Unit tests (In progress, always will be) #1
  • Continous Integration (Travis, CircleCI, etc.) c80124f

Near future:

  • JSON-Schema validator
  • Generic classes (not sure right now)
  • Migrate JSON library (maybe) #11

Main tasks:

  • SBGN -> Escher conversion #12 (partially working)
  • SBML -> Escher conversion #13 (partially working)
  • Schematron validation (See #5)

Later half:

  • Web app
  • Front-end

NOTE: All of these topics will be discussed in their own issue/PR, this is just a tracker for their progress.

Will keep adding as we go.
Please make changes as you think are necessary.

/cc @zakandrewking @draeger

Code coverage using unit tests

I noticed this repo does not have any unit tests. Has it always been like this or have they been removed or somewhere else. Should I start adding some? I'll open a WIP PR so you can review and for discussion before merging into master.

/cc @draeger @zakandrewking

Setting --gui=false returns JsonParseException

When using the command line with normal input and output options and independent of the --format option, setting gui=false returns the following error:

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.FileInputStream@6b2ea799; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1586)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:521)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:450)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2628)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:854)
        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:748)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2926)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2873)
        at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:1719)
        at edu.ucsd.sbrg.escher.EscherConverter.parseEscherJson(EscherConverter.java:231)
        at edu.ucsd.sbrg.escher.EscherConverter.parseEscherJson(EscherConverter.java:209)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:196)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:458)
        at edu.ucsd.sbrg.escher.EscherConverter.batchProcess(EscherConverter.java:333)
        at edu.ucsd.sbrg.escher.EscherConverter.commandLineMode(EscherConverter.java:385)
        at de.zbit.Launcher.launchCommandLineMode(Launcher.java:725)
        at de.zbit.Launcher.run(Launcher.java:862)
        at de.zbit.Launcher.<init>(Launcher.java:211)
        at edu.ucsd.sbrg.escher.EscherConverter.<init>(EscherConverter.java:264)
        at edu.ucsd.sbrg.escher.EscherConverter.main(EscherConverter.java:254)

Add end-point to get COBRA model

/convert/{convert_id}/output/{file_id}/cobra should return a COBRA model in a JSON file if the corresponding file_id is an FBC compliant SBML file.

This will be done after #26 is fixed.

Conversion from JSON to SBML stays at Reading input file

Converting some json files to SBML leads to the conversion getting stuck at reading input file in the gui or to a NullPointerException in the command line:
java -jar -Xms8G -Xmx8G -Duser.language=en EscherConverter-1.2.1.jar --input=e_coli_core.escher.json --format=SBML --output=ecoli.sbml --gui=false

Exception in thread "main" java.lang.NullPointerException
        at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:1899)
        at edu.ucsd.sbrg.escher.EscherConverter.parseEscherJson(EscherConverter.java:232)
        at edu.ucsd.sbrg.escher.EscherConverter.parseEscherJson(EscherConverter.java:208)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:195)
        at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:450)
        at edu.ucsd.sbrg.escher.EscherConverter.batchProcess(EscherConverter.java:327)
        at edu.ucsd.sbrg.escher.EscherConverter.commandLineMode(EscherConverter.java:384)
        at de.zbit.Launcher.launchCommandLineMode(Launcher.java:725)
        at de.zbit.Launcher.run(Launcher.java:862)
        at de.zbit.Launcher.<init>(Launcher.java:211)
        at edu.ucsd.sbrg.escher.EscherConverter.<init>(EscherConverter.java:263)
        at edu.ucsd.sbrg.escher.EscherConverter.main(EscherConverter.java:253)

Problem with parsing BIGG IDs

Appearantly, EscherConverter incorrecly assignes compartments to metabolites with BIGG IDs of the following type:

  • "dhadrp_m_c"m
  • "y_glu_tyr_c"tyr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.