matthiaskoenig / cy3sbml

cy3sbml: SBML for Cytoscape 3
GNU Lesser General Public License v3.0
13 stars 2 forks source link

Error in parsing filename if no model id exists on windows #295

Open davidhoksza opened 4 years ago

davidhoksza commented 4 years ago

I tried to upload the attached valid SBML file with cy3sbml in Cytoscape 3.7.2. and got the following parsing error

  Task (org.cy3sbml.SBMLReaderTask@698f9f49) title: cy3sbml reader
  Task (org.cy3sbml.SBMLReaderTask@698f9f49) progress: 0%
  CyNetwork w/ public tables created: ID = 110
  CyNetwork w/ public tables created: Base Graph ID = 126
  Task (org.cy3sbml.SBMLReaderTask@698f9f49) progress: 40%
  Exception executing task: cy3sbml reader failed to build a SBML model. Please validate the file in the online SBML validator at 'http://www.sbml.org/validator/'and report the issue at 'https://github.com/matthiaskoenig/cy3sbml/issues'java.util.regex.PatternSyntaxException: Unexpected internal error near index 1 \

F100-aspirin-V003B-SBGNv02.sbgn.sbml.txt

matthiaskoenig commented 4 years ago

@davidhoksza I just tried the file and loads without issues.

Could you check this with the latest version of cy3sbml in a clean installation. I.e. delete

You should have cy3sbml-v0.3.0

davidhoksza commented 4 years ago

@matthiaskoenig I am actually on Windows and that might be the problem. Possibly something encoding-related? Anyway, I tried to reinstall both Cytoscape and the plugin (yes, I have 0.3.0) and the issue remains...

davidhoksza commented 4 years ago

@matthiaskoenig Actually, I am having the same issue with the "Hornberg 2005 (ERK cascade) L2V1 BIOMD0000000084" example which comes with cy3sbml. The other examples work just fine.

matthiaskoenig commented 4 years ago

Thanks for the bug report. I could reproduce the error on Windows in a virtual machine. This is a very strange error indeed where there are some problems in parsing the file name if there is no model id. I will submit a bugfix soon.

For now just give your model a model id then everything should work, i.e., add the id attribute to your model <model areaUnits="area_unit" ... -> <model id="test" areaUnits="area_unit" which will fix the problem with the model on win (see file attached). F100-aspirin-V003B-SBGNv02.sbgn_with_model_id.sbml.txt

The full stack trace is attached below for me to debug.

WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
layout (Layout) is unknown! Some data might be lost.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'x' on t
he element position is not part of the SBML specifications (XMLNode) or has an i
nvalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'y' on t
he element position is not part of the SBML specifications (XMLNode) or has an i
nvalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'z' on t
he element position is not part of the SBML specifications (XMLNode) or has an i
nvalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'height'
 on the element dimensions is not part of the SBML specifications (XMLNode) or h
as an invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'width'
on the element dimensions is not part of the SBML specifications (XMLNode) or ha
s an invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'type' o
n the element element is not part of the SBML specifications (XMLNode) or has an
 invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'type' o
n the element element is not part of the SBML specifications (XMLNode) or has an
 invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'type' o
n the element element is not part of the SBML specifications (XMLNode) or has an
 invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'type' o
n the element element is not part of the SBML specifications (XMLNode) or has an
 invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'x' on t
he element position is not part of the SBML specifications (XMLNode) or has an i
nvalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'y' on t
he element position is not part of the SBML specifications (XMLNode) or has an i
nvalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'z' on t
he element position is not part of the SBML specifications (XMLNode) or has an i
nvalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'height'
 on the element dimensions is not part of the SBML specifications (XMLNode) or h
as an invalid value.
 WARN (AbstractReaderWriter.java:105) - processAttribute: The attribute 'width'
on the element dimensions is not part of the SBML specifications (XMLNode) or ha
s an invalid value.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
model (Model) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
 WARN (XMLNodeReader.java:261) - The type of String 'annotation' on the element
species (Species) is unknown! Some data might be lost.
WARN  (org.cy3sbml.SBMLReaderTask) - Layouts found, but not yet supported.
ERROR (org.cy3sbml.SBMLReaderTask) - Could not read SBML into Cytoscape!
java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
        at java.util.regex.Pattern.error(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.util.regex.Pattern.<init>(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.lang.String.split(Unknown Source)
        at java.lang.String.split(Unknown Source)
        at org.cy3sbml.SBMLReaderTask.getNetworkName(SBMLReaderTask.java:544)
        at org.cy3sbml.SBMLReaderTask.addAllNetworks(SBMLReaderTask.java:438)
        at org.cy3sbml.SBMLReaderTask.createNetworksFromModel(SBMLReaderTask.jav
a:393)
        at org.cy3sbml.SBMLReaderTask.run(SBMLReaderTask.java:293)
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.inne
rRun(JDialogTaskManager.java:337)
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.run(
JDialogTaskManager.java:352)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.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.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
        at java.util.regex.Pattern.error(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.util.regex.Pattern.<init>(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.lang.String.split(Unknown Source)
        at java.lang.String.split(Unknown Source)
        at org.cy3sbml.SBMLReaderTask.getNetworkName(SBMLReaderTask.java:544)
        at org.cy3sbml.SBMLReaderTask.addAllNetworks(SBMLReaderTask.java:438)
        at org.cy3sbml.SBMLReaderTask.createNetworksFromModel(SBMLReaderTask.jav
a:393)
        at org.cy3sbml.SBMLReaderTask.run(SBMLReaderTask.java:293)
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.inne
rRun(JDialogTaskManager.java:337)
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.run(
JDialogTaskManager.java:352)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.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)
org.cy3sbml.SBMLReaderError: cy3sbml reader failed to build a SBML model. Please
 validate the file in the online SBML validator at 'http://www.sbml.org/validato
r/'and report the issue at 'https://github.com/matthiaskoenig/cy3sbml/issues'jav
a.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
        at org.cy3sbml.SBMLReaderTask.run(SBMLReaderTask.java:365) ~[?:?]
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.inne
rRun(JDialogTaskManager.java:337) ~[87:org.cytoscape.work-swing-impl:3.7.2]
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.run(
JDialogTaskManager.java:352) [87:org.cytoscape.work-swing-impl:3.7.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
?:?]
        at java.util.concurrent.FutureTask.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) [?:?]
org.cy3sbml.SBMLReaderError: cy3sbml reader failed to build a SBML model. Please
 validate the file in the online SBML validator at 'http://www.sbml.org/validato
r/'and report the issue at 'https://github.com/matthiaskoenig/cy3sbml/issues'jav
a.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
        at org.cy3sbml.SBMLReaderTask.run(SBMLReaderTask.java:365)
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.inne
rRun(JDialogTaskManager.java:337)
        at org.cytoscape.work.internal.task.JDialogTaskManager$TaskRunnable.run(
JDialogTaskManager.java:352)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.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)
davidhoksza commented 4 years ago

Great. Thanks for looking into the problem so fast!