Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes #55

Merged
merged 10 commits into from
Dec 24, 2019
Merged

Minor changes #55

merged 10 commits into from
Dec 24, 2019

Conversation

DEVetter
Copy link
Contributor

Should fix issues #51 and #52

David Emanuel Vetter and others added 9 commits October 10, 2019 15:02
The file seems to be malformatted: it is missing meta-info and canvas-information: Added a Log-entry to inform the user (in GUI too) and an IOException with a corresponding message.

Should malformatted files like this be parsed in any additional way?
(would previously keep saying that it is reading the file, when it has already stopped doing so)
Should empty files even be accepted by the fileFilters?
Can now set the --ignore-validation option to true (default is false), to try converting even if validation fails. If kept as false, and validation fails, conversion will be aborted with a warning, but without an exception.
Species reference glyphs without an assignd role (i.e. null) will now be set to UNDEFINED role, with a warning.
For me, issue draeger-lab#51 does not work out the same: Already going from SBML to Escher causes problems.
The file GlycolysisLayout_small.sbml.xml seems entirely dysfunctional: It was missing a speciesGlyph and still backconversion (when ignoring validation) does not work, as Escher2Standard will enter into an infinite while-loop.
The program shows correct behaviour if --ignore-validation is not set (i.e. it does not even try to convert, because validation fails).
Added a little warning to the ignore-validation-help-entry
I redid the examplefile (with Escher; content is only approximately equal: Previously, the file contained only the malformatted layout for the first two reactions), now it does no longer cause problems.
(whyever they were deleted in the first place)
Copy link
Member

@draeger draeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check Restored inspection profile fails - seemingly because of the Java version used. My impression is that Oracle's JDK 8 is no longer supported because of the updated licenses. Any chance to change that to open JDK?

@@ -228,6 +228,10 @@ public static EscherMap parseEscherJson(InputStream stream)
// An Escher array contains meta-info about the map as the first object and the actual map as
// second map.
JsonNode escherJson = objectMapper.readTree(stream);
if(escherJson.get(0) == null) {
logger.severe(format(bundle.getString("EscherConverter.missingMetaInfo")));
throw new IOException("Missing or misplaced meta-info: File is malformatted"){};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be preferable to use the message String from the bundle also for the IOException. Creating a variable of type String first to load the message could help.

Comment on lines 234 to 235
logger.severe(format(bundle.getString("EscherConverter.missingMetaInfo")));
throw new IOException("Missing or misplaced meta-info: File is malformatted"){};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reuse the String from the bundle also for the IOException.

@@ -35,46 +35,52 @@
<position x="50" y="190"/>
<dimensions width="270" height="20"/>
</boundingBox>
</speciesGlyph>
<speciesGlyph id="glyph_F6P" species="Fructose-6-phosphate">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The identation seems to use too many spaces.

@draeger draeger merged commit 072e3e5 into draeger-lab:master Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants