Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
1f4090a0
Commit
1f4090a0
authored
Jan 06, 2022
by
Piotr Gawron
Browse files
when target or source of AF reaction is invalid provide warning instead of exception
parent
46c8bb18
Changes
2
Hide whitespace changes
Inline
Side-by-side
converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlParser.java
View file @
1f4090a0
...
...
@@ -244,7 +244,9 @@ public class SbgnmlXmlParser {
for
(
Arc
arc
:
activityFlowArcs
)
{
try
{
Reaction
r
=
createActivityFlowReaction
(
arc
,
model
);
model
.
addReaction
(
r
);
if
(
r
!=
null
)
{
model
.
addReaction
(
r
);
}
}
catch
(
Exception
e
)
{
throw
new
InvalidInputDataExecption
(
"Unable to parse the reaction: "
+
arc
.
getId
(),
e
);
}
...
...
@@ -301,11 +303,19 @@ public class SbgnmlXmlParser {
}
Glyph
source
=
getSourceGlyph
(
arc
);
if
(
model
.
getElementByElementId
(
source
.
getId
())
==
null
)
{
logger
.
warn
(
new
SbgnLogMarker
(
ProjectLogEntryType
.
PARSING_ISSUE
,
arc
,
model
),
"Cannot find source element. Skipping arc."
);
return
null
;
}
Reactant
reactant
=
new
Reactant
(
model
.
getElementByElementId
(
source
.
getId
()));
reactant
.
setLine
(
new
PolylineData
(
reactantPoints
));
result
.
addReactant
(
reactant
);
Glyph
target
=
getTargetGlyph
(
arc
);
if
(
model
.
getElementByElementId
(
target
.
getId
())
==
null
)
{
logger
.
warn
(
new
SbgnLogMarker
(
ProjectLogEntryType
.
PARSING_ISSUE
,
arc
,
model
),
"Cannot find target element. Skipping arc."
);
return
null
;
}
Product
product
=
new
Product
(
model
.
getElementByElementId
(
target
.
getId
()));
product
.
setLine
(
parseLine
(
arc
,
productPoints
));
result
.
addProduct
(
product
);
...
...
converter-SBGNML/testFiles/sbgnmlParserTestFiles/generated/production__and__unspecified_entity.sbgn
0 → 100644
View file @
1f4090a0
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<sbgn
xmlns=
"http://sbgn.org/libsbgn/0.2"
>
<map
language=
"process description"
>
<glyph
id=
"n59"
class=
"macromolecule"
>
<label
text=
"C4"
/>
<bbox
x=
"662.16473"
y=
"277.00546"
w=
"80"
h=
"40"
/>
</glyph>
<glyph
id=
"n61"
class=
"and"
>
<label
text=
"C4a"
/>
<bbox
x=
"662.16473"
y=
"472.85104"
w=
"80"
h=
"40"
/>
</glyph>
<glyph
id=
"glyph3"
orientation=
"vertical"
class=
"process"
>
<bbox
y=
"448.0"
x=
"478.0"
h=
"24.0"
w=
"24.0"
/>
<port
y=
"436.0"
x=
"490.0"
id=
"glyph3.1"
/>
<port
y=
"484.0"
x=
"490.0"
id=
"glyph3.2"
/>
</glyph>
<arc
id=
"e28"
class=
"production"
source=
"n59"
target=
"n61"
>
<start
x=
"702.16473"
y=
"317.50546"
/>
<end
x=
"702.16473"
y=
"382.92825"
/>
</arc>
</map>
</sbgn>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment