Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
01132dad
Commit
01132dad
authored
May 28, 2019
by
Piotr Gawron
Browse files
import from wikipathways provides center line
parent
1d1e8893
Changes
1
Hide whitespace changes
Inline
Side-by-side
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelContructor.java
View file @
01132dad
...
...
@@ -20,8 +20,10 @@ import lcsb.mapviewer.common.Configuration;
import
lcsb.mapviewer.common.Pair
;
import
lcsb.mapviewer.common.exception.InvalidArgumentException
;
import
lcsb.mapviewer.common.exception.InvalidStateException
;
import
lcsb.mapviewer.common.geometry.PointTransformation
;
import
lcsb.mapviewer.converter.ConverterException
;
import
lcsb.mapviewer.converter.model.celldesigner.geometry.CellDesignerAliasConverter
;
import
lcsb.mapviewer.converter.model.celldesigner.geometry.ReactionCellDesignerConverter
;
import
lcsb.mapviewer.converter.model.celldesigner.reaction.ReactionLineData
;
import
lcsb.mapviewer.converter.model.celldesigner.types.ModifierType
;
import
lcsb.mapviewer.converter.model.celldesigner.types.ModifierTypeUtils
;
...
...
@@ -123,6 +125,8 @@ public class ModelContructor {
*/
private
BiopaxParser
biopaxParser
=
new
BiopaxParser
();
private
PointTransformation
pt
=
new
PointTransformation
();
/**
* List of {@link Shape#shape shapes} that are not supported to be part of a
* {@link Complex complex}.
...
...
@@ -767,6 +771,8 @@ public class ModelContructor {
}
}
createReactionCenterLine
(
reaction
);
ModifierTypeUtils
mtu
=
new
ModifierTypeUtils
();
for
(
Modifier
m
:
reaction
.
getModifiers
())
{
m
.
getLine
().
setEndPoint
(
m
.
getLine
().
getPoints
().
get
(
m
.
getLine
().
getPoints
().
size
()
-
2
));
...
...
@@ -776,6 +782,32 @@ public class ModelContructor {
return
reaction
;
}
private
void
createReactionCenterLine
(
Reaction
reaction
)
{
AbstractNode
input
=
reaction
.
getReactants
().
get
(
0
);
AbstractNode
output
=
reaction
.
getProducts
().
get
(
0
);
for
(
NodeOperator
operator
:
reaction
.
getOperators
())
{
if
(
operator
.
isReactantOperator
())
{
input
=
operator
;
}
else
if
(
operator
.
isProductOperator
())
{
output
=
operator
;
}
}
PolylineData
line
=
new
PolylineData
();
input
.
getLine
().
trimEnd
(
ReactionCellDesignerConverter
.
RECT_SIZE
/
2
-
1
);
line
.
addPoint
(
pt
.
copyPoint
(
input
.
getLine
().
getEndPoint
()));
if
(
output
instanceof
NodeOperator
)
{
output
.
getLine
().
trimEnd
(
ReactionCellDesignerConverter
.
RECT_SIZE
/
2
-
1
);
line
.
addPoint
(
pt
.
copyPoint
(
output
.
getLine
().
getEndPoint
()));
}
else
{
output
.
getLine
().
trimBegin
(
ReactionCellDesignerConverter
.
RECT_SIZE
/
2
-
1
);
line
.
addPoint
(
pt
.
copyPoint
(
output
.
getLine
().
getBeginPoint
()));
}
reaction
.
setLine
(
line
);
}
/**
* Creates {@link Reactant} from gpml edge.
*
...
...
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