Skip to content
Snippets Groups Projects
Commit 6754f573 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '329-select-mode-export-to-celldesigner-does-not-work' into 'master'

Resolve "Select mode: Export to CellDesigner does not work"

Closes #329

See merge request piotr.gawron/minerva!237
parents 6b31e612 b2b440df
No related branches found
No related tags found
1 merge request!237Resolve "Select mode: Export to CellDesigner does not work"
Pipeline #
...@@ -7,6 +7,9 @@ import org.apache.log4j.Logger; ...@@ -7,6 +7,9 @@ import org.apache.log4j.Logger;
import lcsb.mapviewer.model.map.modifier.Catalysis; import lcsb.mapviewer.model.map.modifier.Catalysis;
import lcsb.mapviewer.model.map.modifier.Inhibition; import lcsb.mapviewer.model.map.modifier.Inhibition;
import lcsb.mapviewer.model.map.modifier.Modulation;
import lcsb.mapviewer.model.map.modifier.PhysicalStimulation;
import lcsb.mapviewer.model.map.modifier.Trigger;
import lcsb.mapviewer.model.map.modifier.UnknownCatalysis; import lcsb.mapviewer.model.map.modifier.UnknownCatalysis;
import lcsb.mapviewer.model.map.modifier.UnknownInhibition; import lcsb.mapviewer.model.map.modifier.UnknownInhibition;
import lcsb.mapviewer.model.map.reaction.Modifier; import lcsb.mapviewer.model.map.reaction.Modifier;
...@@ -14,6 +17,9 @@ import lcsb.mapviewer.model.map.reaction.Modifier; ...@@ -14,6 +17,9 @@ import lcsb.mapviewer.model.map.reaction.Modifier;
public enum SBOTermModifierType { public enum SBOTermModifierType {
CATALYSIS(Catalysis.class, new String[] { "SBO:0000013" }), // CATALYSIS(Catalysis.class, new String[] { "SBO:0000013" }), //
INHIBITION(Inhibition.class, new String[] { "SBO:0000537" }), // INHIBITION(Inhibition.class, new String[] { "SBO:0000537" }), //
MODULATION(Modulation.class, new String[] { "SBO:0000594" }), //
PHYSICAL_STIMULATION(PhysicalStimulation.class, new String[] { "SBO:0000459" }), //
TRIGGER(Trigger.class, new String[] { "SBO:0000461" }), //
UNKNOWN_CATALYSIS(UnknownCatalysis.class, new String[] { "SBO:0000462" }), // UNKNOWN_CATALYSIS(UnknownCatalysis.class, new String[] { "SBO:0000462" }), //
UNKNOWN_INHIBITION(UnknownInhibition.class, new String[] { "SBO:0000536" }), // UNKNOWN_INHIBITION(UnknownInhibition.class, new String[] { "SBO:0000536" }), //
; ;
......
...@@ -11,6 +11,9 @@ import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction; ...@@ -11,6 +11,9 @@ import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction; import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction; import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
import lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction; import lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction;
import lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction;
import lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction;
import lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction;
import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction; import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
import lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction; import lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction;
import lcsb.mapviewer.model.map.reaction.type.TranslationReaction; import lcsb.mapviewer.model.map.reaction.type.TranslationReaction;
...@@ -18,22 +21,31 @@ import lcsb.mapviewer.model.map.reaction.type.TransportReaction; ...@@ -18,22 +21,31 @@ import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
import lcsb.mapviewer.model.map.reaction.type.TruncationReaction; import lcsb.mapviewer.model.map.reaction.type.TruncationReaction;
import lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction; import lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction;
import lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction; import lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction;
import lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction;
import lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction;
import lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction;
import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction; import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
public enum SBOTermReactionType { public enum SBOTermReactionType {
DISSOCIATION(DissociationReaction.class, new String[] { "SBO:0000180" }), //
HETERODIMER_ASSOCIATION(HeterodimerAssociationReaction.class, new String[] { "SBO:0000177" }), //
KNOWN_TRANSITION_OMITTED(KnownTransitionOmittedReaction.class, new String[] { "SBO:0000205" }), //
NEGATIVE_INFLUENCE(NegativeInfluenceReaction.class, new String[] { "SBO:0000407" }), //
POSITIVE_INFLUENCE(PositiveInfluenceReaction.class, new String[] { "SBO:0000171" }), //
REDUCED_MODULATION(ReducedModulationReaction.class, new String[] { "SBO:0000632" }), //
REDUCED_PHYSICAL_STIMULATION(ReducedPhysicalStimulationReaction.class, new String[] { "SBO:0000411" }), //
REDUCED_TRIGGER(ReducedTriggerReaction.class, new String[] { "SBO:0000461" }), //
STATE_TRANSITION(StateTransitionReaction.class, new String[] { "SBO:0000176" }), // STATE_TRANSITION(StateTransitionReaction.class, new String[] { "SBO:0000176" }), //
TRANSCRIPTION(TranscriptionReaction.class, new String[] { "SBO:0000183" }), // TRANSCRIPTION(TranscriptionReaction.class, new String[] { "SBO:0000183" }), //
TRANSLATION(TranslationReaction.class, new String[] { "SBO:0000184" }), // TRANSLATION(TranslationReaction.class, new String[] { "SBO:0000184" }), //
TRANSPORT(TransportReaction.class, new String[] { "SBO:0000185" }), // TRANSPORT(TransportReaction.class, new String[] { "SBO:0000185" }), //
KNOWN_TRANSITION_OMITTED(KnownTransitionOmittedReaction.class, new String[] { "SBO:0000205" }), //
UNKNOWN_TRANSITION(UnknownTransitionReaction.class, new String[] { "SBO:0000396" }), //
HETERODIMER_ASSOCIATION(HeterodimerAssociationReaction.class, new String[] { "SBO:0000177" }), //
DISSOCIATION(DissociationReaction.class, new String[] { "SBO:0000180" }), //
TRUNCATION(TruncationReaction.class, new String[] { "SBO:0000178" }), // TRUNCATION(TruncationReaction.class, new String[] { "SBO:0000178" }), //
POSITIVE_INFLUENCE(PositiveInfluenceReaction.class, new String[] { "SBO:0000171" }), //
UNKNOWN_POSITIVE_INFLUENCE(UnknownPositiveInfluenceReaction.class, new String[] { "SBO:0000170" }), //
NEGATIVE_INFLUENCE(NegativeInfluenceReaction.class, new String[] { "SBO:0000407" }), //
UNKNOWN_NEGATIVE_INFLUENCE(UnknownNegativeInfluenceReaction.class, new String[] { "SBO:0000169" }), // UNKNOWN_NEGATIVE_INFLUENCE(UnknownNegativeInfluenceReaction.class, new String[] { "SBO:0000169" }), //
UNKNOWN_POSITIVE_INFLUENCE(UnknownPositiveInfluenceReaction.class, new String[] { "SBO:0000172" }), //
UNKNOWN_REDUCED_MODULATION(UnknownReducedModulationReaction.class, new String[] { "SBO:0000631" }), //
UNKNOWN_REDUCED_PHYSICAL_STIMULATION(UnknownReducedPhysicalStimulationReaction.class, new String[] { "SBO:0000170" }), //
UNKNOWN_REDUCED_TRIGGER(UnknownReducedTriggerReaction.class, new String[] { "SBO:0000533" }), //
UNKNOWN_TRANSITION(UnknownTransitionReaction.class, new String[] { "SBO:0000396" }), //
; ;
private static Logger logger = Logger.getLogger(SBOTermReactionType.class); private static Logger logger = Logger.getLogger(SBOTermReactionType.class);
...@@ -60,7 +72,7 @@ public enum SBOTermReactionType { ...@@ -60,7 +72,7 @@ public enum SBOTermReactionType {
} }
} }
if (result == null) { if (result == null) {
logger.warn("Don't know how to handle SBOTerm " + sboTerm + " for modifier"); logger.warn("Don't know how to handle SBOTerm " + sboTerm + " for reaction");
result = StateTransitionReaction.class; result = StateTransitionReaction.class;
} }
return result; return result;
......
...@@ -151,10 +151,11 @@ public class SbmlReactionParserTest { ...@@ -151,10 +151,11 @@ public class SbmlReactionParserTest {
@Test @Test
public void testParseUnknownPositiveInfluence() throws FileNotFoundException, InvalidInputDataExecption { public void testParseUnknownPositiveInfluence() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_positive_influence.xml")); Model model = parser
.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_positive_influence.xml"));
Reaction reaction = model.getReactions().iterator().next(); Reaction reaction = model.getReactions().iterator().next();
assertNotNull(reaction); assertNotNull(reaction);
assertTrue(reaction instanceof UnknownPositiveInfluenceReaction); assertTrue("Invalid class type: " + reaction.getClass(), reaction instanceof UnknownPositiveInfluenceReaction);
} }
@Test @Test
...@@ -167,7 +168,8 @@ public class SbmlReactionParserTest { ...@@ -167,7 +168,8 @@ public class SbmlReactionParserTest {
@Test @Test
public void testParseUnknownNegativeInfluence() throws FileNotFoundException, InvalidInputDataExecption { public void testParseUnknownNegativeInfluence() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_negative_influence.xml")); Model model = parser
.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_negative_influence.xml"));
Reaction reaction = model.getReactions().iterator().next(); Reaction reaction = model.getReactions().iterator().next();
assertNotNull(reaction); assertNotNull(reaction);
assertTrue(reaction instanceof UnknownNegativeInfluenceReaction); assertTrue(reaction instanceof UnknownNegativeInfluenceReaction);
......
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="default" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="default" initialConcentration="1" id="s1588" name="NGFR" sboTerm="SBO:0000252">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isEncodedBy>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:hgnc.symbol:NGFR"/>
</rdf:Bag>
</bqbiol:isEncodedBy>
</rdf:Description>
</rdf:RDF>
</annotation>
</species>
</listOfSpecies>
<listOfReactions>
<reaction reversible="false" id="r2149" sboTerm="SBO:0000170">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isDescribedBy>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:pubmed:22236693 "/>
</rdf:Bag>
</bqbiol:isDescribedBy>
</rdf:Description>
</rdf:RDF>
</annotation>
<listOfReactants>
<speciesReference species="s1588" stoichiometry="1"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="s1588" stoichiometry="1"/>
</listOfProducts>
</reaction>
</listOfReactions>
</model>
</sbml>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</species> </species>
</listOfSpecies> </listOfSpecies>
<listOfReactions> <listOfReactions>
<reaction id="re1" sboTerm="SBO:0000170"> <reaction id="re1" sboTerm="SBO:0000172">
<listOfReactants> <listOfReactants>
<speciesReference species="s1" stoichiometry="1"/> <speciesReference species="s1" stoichiometry="1"/>
</listOfReactants> </listOfReactants>
......
...@@ -120,10 +120,10 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand { ...@@ -120,10 +120,10 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
Set<Species> elementToAlign = new HashSet<>(); Set<Species> elementToAlign = new HashSet<>();
Map<Compartment, Set<Element>> elementsByStaticCompartment = new HashMap<>(); Map<Compartment, Set<Element>> elementsByStaticCompartment = new HashMap<>();
for (Element element : elements) { for (Element element : elements) {
if (element.getWidth()==0) { if (element.getWidth() == 0) {
element.setWidth(SPECIES_WIDTH); element.setWidth(SPECIES_WIDTH);
element.setHeight(SPECIES_HEIGHT); element.setHeight(SPECIES_HEIGHT);
} }
if (element.getCompartment() == null || element.getCompartment() == parent) { if (element.getCompartment() == null || element.getCompartment() == parent) {
if (element instanceof Compartment) { if (element instanceof Compartment) {
...@@ -218,6 +218,11 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand { ...@@ -218,6 +218,11 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
Point2D middle = getMiddlePoint(productElement.getCenter(), reactantElement.getCenter()); Point2D middle = getMiddlePoint(productElement.getCenter(), reactantElement.getCenter());
//for self reactions
if (productElement.equals(reactantElement)) {
middle.setLocation(middle.getX(), middle.getY() + 50);
}
modifyProducts(reaction, middle); modifyProducts(reaction, middle);
modifyReactants(reaction, middle); modifyReactants(reaction, middle);
modifyModifiers(reaction, middle); modifyModifiers(reaction, middle);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment