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
264c8d02
Commit
264c8d02
authored
Apr 19, 2021
by
Piotr Gawron
Browse files
info about species is added to marker
parent
dd880c0e
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
264c8d02
...
...
@@ -2,6 +2,8 @@ minerva (16.0.0~alpha.2) stable; urgency=medium
*
Backward
incompatibility
:
debian
package
cannot
be
upgraded
from
version
prior
to
12.1.0
(#
1464
)
*
Small
improvement
:
homomultimer
information
is
provided
in
API
(#
1468
)
*
Small
improvement
:
missing
info
about
species
for
SBML
parsing
warning
(#
1472
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Fri
,
26
Mar
2021
10
:
00
:
00
+
0200
...
...
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SBOTermSpeciesType.java
View file @
264c8d02
...
...
@@ -8,6 +8,8 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
import
lcsb.mapviewer.common.exception.InvalidStateException
;
import
lcsb.mapviewer.converter.model.sbml.SbmlModelUtils
;
import
lcsb.mapviewer.model.ProjectLogEntryType
;
import
lcsb.mapviewer.model.map.species.*
;
public
enum
SBOTermSpeciesType
{
...
...
@@ -50,7 +52,7 @@ public enum SBOTermSpeciesType {
this
.
hypothetical
=
hypothetical
;
}
private
static
SBOTermSpeciesType
getTypeSBOTerm
(
String
sboTerm
)
{
private
static
SBOTermSpeciesType
getTypeSBOTerm
(
String
sboTerm
,
org
.
sbml
.
jsbml
.
Species
species
)
{
if
(
sboTerm
==
null
||
sboTerm
.
isEmpty
())
{
return
SIMPLE_MOLECULE
;
}
...
...
@@ -63,17 +65,18 @@ public enum SBOTermSpeciesType {
}
}
if
(
result
==
null
)
{
logger
.
warn
(
"Don't know how to handle SBOTerm "
+
sboTerm
+
" for species"
);
logger
.
warn
(
SbmlModelUtils
.
createMarker
(
ProjectLogEntryType
.
PARSING_ISSUE
,
species
),
"Don't know how to handle SBOTerm "
+
sboTerm
);
result
=
SIMPLE_MOLECULE
;
}
return
result
;
}
public
static
Species
createElementForSBOTerm
(
String
sboTerm
,
String
elementId
)
{
public
static
Species
createElementForSBOTerm
(
String
sboTerm
,
org
.
sbml
.
jsbml
.
Species
species
)
{
try
{
SBOTermSpeciesType
type
=
getTypeSBOTerm
(
sboTerm
);
SBOTermSpeciesType
type
=
getTypeSBOTerm
(
sboTerm
,
species
);
Class
<?
extends
Species
>
clazz
=
type
.
clazz
;
Species
result
=
clazz
.
getConstructor
(
String
.
class
).
newInstance
(
elemen
tId
);
Species
result
=
clazz
.
getConstructor
(
String
.
class
).
newInstance
(
species
.
ge
tId
()
);
if
(
type
.
hypothetical
)
{
result
.
setHypothetical
(
true
);
}
...
...
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesParser.java
View file @
264c8d02
...
...
@@ -514,7 +514,7 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
@Override
protected
Species
parse
(
org
.
sbml
.
jsbml
.
Species
species
)
throws
InvalidInputDataExecption
{
String
sboTerm
=
extractSBOTermFromSpecies
(
species
);
Species
result
=
SBOTermSpeciesType
.
createElementForSBOTerm
(
sboTerm
,
species
.
getId
()
);
Species
result
=
SBOTermSpeciesType
.
createElementForSBOTerm
(
sboTerm
,
species
);
if
(!
Double
.
isNaN
(
species
.
getInitialAmount
()))
{
result
.
setInitialAmount
(
species
.
getInitialAmount
());
}
...
...
converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/species/AllSbmlSpeciesTests.java
View file @
264c8d02
...
...
@@ -6,10 +6,11 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
ModificationResidueExporterTest
.
class
,
SbmlSpeciesExporterRenderShapeTest
.
class
,
SbmlSpeciesExporterTest
.
class
,
SbmlSpeciesParserTest
.
class
})
ModificationResidueExporterTest
.
class
,
SbmlSpeciesExporterRenderShapeTest
.
class
,
SbmlSpeciesExporterTest
.
class
,
SbmlSpeciesParserTest
.
class
,
SBOTermSpeciesTypeTest
.
class
})
public
class
AllSbmlSpeciesTests
{
}
converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/species/SBOTermSpeciesTypeTest.java
0 → 100644
View file @
264c8d02
package
lcsb.mapviewer.converter.model.sbml.species
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
org.junit.Test
;
import
org.sbml.jsbml.Species
;
import
lcsb.mapviewer.converter.model.sbml.SbmlTestFunctions
;
import
lcsb.mapviewer.model.map.species.Element
;
public
class
SBOTermSpeciesTypeTest
extends
SbmlTestFunctions
{
@Test
public
void
testCreateElementForSBOTerm
()
{
Species
species
=
new
Species
(
3
,
2
);
species
.
setSBOTerm
(
"SBO:0000000"
);
Element
element
=
SBOTermSpeciesType
.
createElementForSBOTerm
(
"SBO:0000000"
,
species
);
assertNotNull
(
element
);
assertEquals
(
1
,
super
.
getWarnings
().
size
());
assertNotNull
(
super
.
getWarnings
().
get
(
0
).
getMarker
());
}
}
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