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

self reactions are layouted properly

parent 6b31e612
No related branches found
No related tags found
1 merge request!237Resolve "Select mode: Export to CellDesigner does not work"
......@@ -60,7 +60,7 @@ public enum SBOTermReactionType {
}
}
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;
}
return result;
......
<?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>
......@@ -120,10 +120,10 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
Set<Species> elementToAlign = new HashSet<>();
Map<Compartment, Set<Element>> elementsByStaticCompartment = new HashMap<>();
for (Element element : elements) {
if (element.getWidth()==0) {
if (element.getWidth() == 0) {
element.setWidth(SPECIES_WIDTH);
element.setHeight(SPECIES_HEIGHT);
}
if (element.getCompartment() == null || element.getCompartment() == parent) {
if (element instanceof Compartment) {
......@@ -218,6 +218,11 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
Point2D middle = getMiddlePoint(productElement.getCenter(), reactantElement.getCenter());
//for self reactions
if (productElement.equals(reactantElement)) {
middle.setLocation(middle.getX(), middle.getY() + 50);
}
modifyProducts(reaction, middle);
modifyReactants(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