Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
e4fb0167
Commit
e4fb0167
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
featureValues extracted to common function
parent
bc2f74f3
No related branches found
No related tags found
2 merge requests
!630
WIP: Resolve "The privileges of a new user are not saved in some cases"
,
!560
Resolve "add support for modifications and states in sbml export/import"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesParser.java
+28
-27
28 additions, 27 deletions
...iewer/converter/model/sbml/species/SbmlSpeciesParser.java
with
28 additions
and
27 deletions
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesParser.java
+
28
−
27
View file @
e4fb0167
...
@@ -21,6 +21,7 @@ import org.sbml.jsbml.ext.multi.PossibleSpeciesFeatureValue;
...
@@ -21,6 +21,7 @@ import org.sbml.jsbml.ext.multi.PossibleSpeciesFeatureValue;
import
org.sbml.jsbml.ext.multi.SpeciesFeature
;
import
org.sbml.jsbml.ext.multi.SpeciesFeature
;
import
org.sbml.jsbml.ext.multi.SpeciesFeatureType
;
import
org.sbml.jsbml.ext.multi.SpeciesFeatureType
;
import
org.sbml.jsbml.ext.multi.SpeciesFeatureValue
;
import
org.sbml.jsbml.ext.multi.SpeciesFeatureValue
;
import
org.sbml.jsbml.ext.multi.SpeciesTypeInstance
;
import
org.sbml.jsbml.ext.multi.SubListOfSpeciesFeature
;
import
org.sbml.jsbml.ext.multi.SubListOfSpeciesFeature
;
import
org.sbml.jsbml.ext.render.LocalStyle
;
import
org.sbml.jsbml.ext.render.LocalStyle
;
...
@@ -127,51 +128,51 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
...
@@ -127,51 +128,51 @@ public class SbmlSpeciesParser extends SbmlElementParser<org.sbml.jsbml.Species>
SpeciesFeature
feature
)
{
SpeciesFeature
feature
)
{
String
warnPrefix
=
new
ElementUtils
().
getElementTag
(
minervaElement
);
String
warnPrefix
=
new
ElementUtils
().
getElementTag
(
minervaElement
);
String
featureTypeString
=
feature
.
getSpeciesFeatureType
();
String
featureTypeString
=
feature
.
getSpeciesFeatureType
();
List
<
String
>
featureValues
=
getFeatureValues
(
speciesType
,
feature
);
if
(
MultiPackageNamingUtils
.
isFeatureId
(
featureTypeString
,
BioEntityFeature
.
STRUCTURAL_STATE
))
{
if
(
MultiPackageNamingUtils
.
isFeatureId
(
featureTypeString
,
BioEntityFeature
.
STRUCTURAL_STATE
))
{
SpeciesFeatureType
featureType
=
speciesType
.
getListOfSpeciesFeatureTypes
().
get
(
featureTypeString
);
List
<
String
>
structuralStates
=
new
ArrayList
<>();
for
(
SpeciesFeatureValue
featureValue
:
feature
.
getListOfSpeciesFeatureValues
())
{
PossibleSpeciesFeatureValue
possibleSpeciesFeatureValue
=
featureType
.
getListOfPossibleSpeciesFeatureValues
()
.
get
(
featureValue
.
getValue
());
structuralStates
.
add
(
possibleSpeciesFeatureValue
.
getName
());
}
if
(
minervaElement
instanceof
Protein
)
{
if
(
minervaElement
instanceof
Protein
)
{
((
Protein
)
minervaElement
).
setStructuralState
(
String
.
join
(
"; "
,
structuralStat
es
));
((
Protein
)
minervaElement
).
setStructuralState
(
String
.
join
(
"; "
,
featureValu
es
));
}
else
if
(
minervaElement
instanceof
Complex
)
{
}
else
if
(
minervaElement
instanceof
Complex
)
{
((
Complex
)
minervaElement
).
setStructuralState
(
String
.
join
(
"; "
,
structuralStat
es
));
((
Complex
)
minervaElement
).
setStructuralState
(
String
.
join
(
"; "
,
featureValu
es
));
}
else
{
}
else
{
logger
.
warn
(
warnPrefix
+
"Structural state not supported"
);
logger
.
warn
(
warnPrefix
+
"Structural state not supported"
);
}
}
}
else
if
(
MultiPackageNamingUtils
.
isFeatureId
(
featureTypeString
,
BioEntityFeature
.
POSITION_TO_COMPARTMENT
))
{
}
else
if
(
MultiPackageNamingUtils
.
isFeatureId
(
featureTypeString
,
BioEntityFeature
.
POSITION_TO_COMPARTMENT
))
{
SpeciesFeatureType
featureType
=
speciesType
.
getListOfSpeciesFeatureTypes
().
get
(
featureTypeString
);
if
(
featureValues
.
size
()
!=
1
)
{
List
<
String
>
positionToCompartments
=
new
ArrayList
<>();
for
(
SpeciesFeatureValue
featureValue
:
feature
.
getListOfSpeciesFeatureValues
())
{
PossibleSpeciesFeatureValue
possibleSpeciesFeatureValue
=
featureType
.
getListOfPossibleSpeciesFeatureValues
()
.
get
(
featureValue
.
getValue
());
positionToCompartments
.
add
(
possibleSpeciesFeatureValue
.
getName
());
}
if
(
positionToCompartments
.
size
()
!=
1
)
{
logger
.
warn
(
warnPrefix
+
"Position to compartment must exactly one value"
);
logger
.
warn
(
warnPrefix
+
"Position to compartment must exactly one value"
);
}
else
{
}
else
{
minervaElement
.
setPositionToCompartment
(
PositionToCompartment
.
getByString
(
positionToCompartment
s
.
get
(
0
)));
minervaElement
.
setPositionToCompartment
(
PositionToCompartment
.
getByString
(
featureValue
s
.
get
(
0
)));
}
}
}
else
if
(
MultiPackageNamingUtils
.
isFeatureId
(
featureTypeString
,
BioEntityFeature
.
SYNONYM
))
{
}
else
if
(
MultiPackageNamingUtils
.
isFeatureId
(
featureTypeString
,
BioEntityFeature
.
SYNONYM
))
{
SpeciesFeatureType
featureType
=
speciesType
.
getListOfSpeciesFeatureTypes
().
get
(
featureTypeString
);
minervaElement
.
setSynonyms
(
featureValues
);
}
else
if
(
MultiPackageNamingUtils
.
isModificationFeatureId
(
featureTypeString
))
{
createModificationResidues
(
minervaElement
,
speciesType
,
feature
);
}
else
{
logger
.
warn
(
warnPrefix
+
"Feature not supported: "
+
featureTypeString
);
}
}
private
List
<
String
>
getFeatureValues
(
MultiSpeciesType
speciesType
,
SpeciesFeature
feature
)
{
SpeciesFeatureType
featureType
=
speciesType
.
getListOfSpeciesFeatureTypes
().
get
(
feature
.
getSpeciesFeatureType
());
List
<
String
>
synonyms
=
new
ArrayList
<>();
List
<
String
>
result
=
new
ArrayList
<>();
if
(
featureType
!=
null
)
{
for
(
SpeciesFeatureValue
featureValue
:
feature
.
getListOfSpeciesFeatureValues
())
{
for
(
SpeciesFeatureValue
featureValue
:
feature
.
getListOfSpeciesFeatureValues
())
{
PossibleSpeciesFeatureValue
possibleSpeciesFeatureValue
=
featureType
.
getListOfPossibleSpeciesFeatureValues
()
PossibleSpeciesFeatureValue
possibleSpeciesFeatureValue
=
featureType
.
getListOfPossibleSpeciesFeatureValues
()
.
get
(
featureValue
.
getValue
());
.
get
(
featureValue
.
getValue
());
synonyms
.
add
(
possibleSpeciesFeatureValue
.
getName
());
result
.
add
(
possibleSpeciesFeatureValue
.
getName
());
}
}
minervaElement
.
setSynonyms
(
synonyms
);
}
else
if
(
MultiPackageNamingUtils
.
isModificationFeatureId
(
featureTypeString
))
{
createModificationResidues
(
minervaElement
,
speciesType
,
feature
);
}
else
{
}
else
{
logger
.
warn
(
warnPrefix
+
"Feature not supported: "
+
featureTypeString
);
for
(
SpeciesTypeInstance
speciesTypeInstance
:
speciesType
.
getListOfSpeciesTypeInstances
())
{
speciesType
=
getMultiPlugin
().
getSpeciesType
(
speciesTypeInstance
.
getSpeciesType
());
result
=
getFeatureValues
(
speciesType
,
feature
);
if
(
result
.
size
()
>
0
)
{
return
result
;
}
}
}
}
return
result
;
}
}
private
void
createModificationResidues
(
Species
minervaElement
,
MultiSpeciesType
speciesType
,
private
void
createModificationResidues
(
Species
minervaElement
,
MultiSpeciesType
speciesType
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment