Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
effb00bf
Commit
effb00bf
authored
Jan 24, 2020
by
Piotr Gawron
Browse files
prefixing should be done only on unprefixed reactions
parent
526c96e9
Pipeline
#20015
failed with stage
in 11 minutes and 47 seconds
Changes
6
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
effb00bf
...
...
@@ -4,6 +4,8 @@ minerva (14.0.8) stable; urgency=medium
* Bug fix: upload of data overlay with two entries having different uniprot
identifier but pointing to the same gene crashed (#1083)
* Bug fix: don'
t
allow
to
remove
plugin
twice
(#
1081
)
*
Bug
fix
:
upload
of
SBML
file
with
very
short
reaction
length
could
produce
a
map
that
couldn
't be exported to SBML anymore (#1078)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 23 Jan 2020 12:00:00 +0200
...
...
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParser.java
View file @
effb00bf
...
...
@@ -633,9 +633,8 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
}
protected
Reaction
parse
(
org
.
sbml
.
jsbml
.
Reaction
sbmlReaction
)
throws
InvalidInputDataExecption
{
Reaction
reaction
=
new
Reaction
();
Reaction
reaction
=
new
Reaction
(
sbmlReaction
.
getId
()
);
assignBioEntityData
(
sbmlReaction
,
reaction
);
reaction
.
setIdReaction
(
sbmlReaction
.
getId
());
reaction
.
setReversible
(
sbmlReaction
.
isReversible
());
if
(
sbmlReaction
.
getKineticLaw
()
!=
null
)
{
if
(
sbmlReaction
.
getKineticLaw
().
getMath
()
==
null
)
{
...
...
converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/SbmlParserTest.java
View file @
effb00bf
...
...
@@ -12,8 +12,7 @@ import org.junit.Test;
import
lcsb.mapviewer.commands.CreateHierarchyCommand
;
import
lcsb.mapviewer.common.Configuration
;
import
lcsb.mapviewer.converter.ConverterParams
;
import
lcsb.mapviewer.converter.InvalidInputDataExecption
;
import
lcsb.mapviewer.converter.*
;
import
lcsb.mapviewer.model.map.compartment.Compartment
;
import
lcsb.mapviewer.model.map.model.Model
;
import
lcsb.mapviewer.model.map.reaction.*
;
...
...
@@ -232,4 +231,11 @@ public class SbmlParserTest extends SbmlTestFunctions {
reactant
.
getLine
().
getBeginPoint
().
distance
(
120
,
40
),
Configuration
.
EPSILON
);
}
@Test
public
void
xxx
()
throws
FileNotFoundException
,
InvalidInputDataExecption
,
ConverterException
{
Model
m
=
parser
.
createModel
(
new
ConverterParams
().
filename
(
"testFiles/problematic_layout.xml"
));
String
xml
=
parser
.
model2String
(
m
);
assertNotNull
(
xml
);
}
}
converter-sbml/testFiles/problematic_layout.xml
0 → 100644
View file @
effb00bf
This diff is collapsed.
Click to expand it.
model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplyLayoutModelCommand.java
View file @
effb00bf
...
...
@@ -109,10 +109,6 @@ public abstract class ApplyLayoutModelCommand extends ModelCommand {
return
addReactionPrefixes
;
}
public
void
setAddReactionPrefixes
(
boolean
addReactionPrefixes
)
{
this
.
addReactionPrefixes
=
addReactionPrefixes
;
}
protected
String
getNextId
()
{
return
(
idCounter
++)
+
""
;
}
...
...
model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java
View file @
effb00bf
...
...
@@ -5,6 +5,7 @@ import java.util.*;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.hibernate.sql.ordering.antlr.GeneratedOrderByLexer
;
import
lcsb.mapviewer.commands.CommandExecutionException
;
import
lcsb.mapviewer.common.Configuration
;
...
...
@@ -23,6 +24,7 @@ import lcsb.mapviewer.model.map.reaction.type.*;
import
lcsb.mapviewer.model.map.species.*
;
import
lcsb.mapviewer.model.map.species.field.ModificationResidue
;
import
lcsb.mapviewer.model.map.species.field.SpeciesWithModificationResidue
;
import
lcsb.mapviewer.modelutils.map.ElementUtils
;
public
class
ApplySimpleLayoutModelCommand
extends
ApplyLayoutModelCommand
{
...
...
@@ -218,9 +220,13 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
modifyModifiers
(
reaction
,
middle
);
if
(
super
.
isAddReactionPrefixes
())
{
super
.
getModel
().
removeReaction
(
reaction
);
reaction
.
setIdReaction
(
"reaction_glyph_"
+
getNextId
()
+
"__"
+
reaction
.
getIdReaction
());
super
.
getModel
().
addReaction
(
reaction
);
if
(
reaction
.
getIdReaction
().
contains
(
"__"
))
{
logger
.
warn
(
new
ElementUtils
().
getElementTag
(
reaction
)
+
"Reaction identifier already prefixed"
);
}
else
{
super
.
getModel
().
removeReaction
(
reaction
);
reaction
.
setIdReaction
(
"reaction_glyph_"
+
getNextId
()
+
"__"
+
reaction
.
getIdReaction
());
super
.
getModel
().
addReaction
(
reaction
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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