Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolayout with only a species results in zero-size layout #29

Open
luciansmith opened this issue Dec 16, 2024 · 3 comments
Open

Autolayout with only a species results in zero-size layout #29

luciansmith opened this issue Dec 16, 2024 · 3 comments

Comments

@luciansmith
Copy link

If I run autolayout with a model with one species and no reactions, I get the following, which doesn't actually display the species:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by libAntimony version v3.0.0 with libSBML version 5.20.4. -->
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" xmlns:render="http://www.sbml.org/sbml/level3/version1/render/version1" level="3" version="2" layout:required="false" render:required="false">
  <model metaid="__main" id="__main">
    <listOfCompartments>
      <compartment sboTerm="SBO:0000410" id="default_compartment" spatialDimensions="3" size="1" constant="true"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="S1" compartment="default_compartment" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
    </listOfSpecies>
    <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1">
      <layout:layout layout:id="libSBMLNetwork_Layout">
        <layout:dimensions layout:width="0" layout:height="0"/>
        <layout:listOfCompartmentGlyphs>
          <layout:compartmentGlyph layout:id="default_compartment_Glyph_0" layout:compartment="default_compartment">
            <layout:boundingBox layout:id="default_compartment_Glyph_0_bb">
              <layout:position layout:x="0" layout:y="0"/>
              <layout:dimensions layout:width="0" layout:height="0"/>
            </layout:boundingBox>
          </layout:compartmentGlyph>
        </layout:listOfCompartmentGlyphs>
        <layout:listOfTextGlyphs>
          <layout:textGlyph layout:id="default_compartment_Glyph_0_TextGlyph_0" layout:originOfText="default_compartment" layout:graphicalObject="default_compartment_Glyph_0">
            <layout:boundingBox layout:id="default_compartment_Glyph_0_TextGlyph_0_bb">
              <layout:position layout:x="0" layout:y="0"/>
              <layout:dimensions layout:width="0" layout:height="0"/>
            </layout:boundingBox>
          </layout:textGlyph>
        </layout:listOfTextGlyphs>
        <render:listOfRenderInformation xmlns:render="http://www.sbml.org/sbml/level3/version1/render/version1">
          <render:renderInformation render:id="libSBMLNetwork_Local_Render" render:referenceRenderInformation="libSBMLNetwork_Global_Render" render:backgroundColor="#FFFFFFFF"/>
        </render:listOfRenderInformation>
      </layout:layout>
      <render:listOfGlobalRenderInformation xmlns:render="http://www.sbml.org/sbml/level3/version1/render/version1">
        <render:renderInformation render:id="libSBMLNetwork_Global_Render" render:backgroundColor="white">
          <render:listOfColorDefinitions>
            <render:colorDefinition render:id="white" render:value="#ffffff"/>
            <render:colorDefinition render:id="black" render:value="#000000"/>
            <render:colorDefinition render:id="lightgray" render:value="#d3d3d3"/>
            <render:colorDefinition render:id="darkslategray" render:value="#2f4f4f"/>
            <render:colorDefinition render:id="darkcyan" render:value="#008b8b"/>
            <render:colorDefinition render:id="teal" render:value="#008080"/>
            <render:colorDefinition render:id="silver" render:value="#c0c0c0"/>
          </render:listOfColorDefinitions>
          <render:listOfLineEndings>
            <render:lineEnding render:id="productHead">
              <layout:boundingBox layout:id="productHead_bb">
                <layout:position layout:x="-12" layout:y="-6"/>
                <layout:dimensions layout:width="12" layout:height="12"/>
              </layout:boundingBox>
              <render:g>
                <render:polygon render:stroke="black" render:stroke-width="2" render:fill="black">
                  <render:listOfElements>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="0" render:y="0"/>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="100%" render:y="50%"/>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="0" render:y="100%"/>
                  </render:listOfElements>
                </render:polygon>
              </render:g>
            </render:lineEnding>
            <render:lineEnding render:id="modifierHead">
              <layout:boundingBox layout:id="modifierHead_bb">
                <layout:position layout:x="-12" layout:y="-6"/>
                <layout:dimensions layout:width="12" layout:height="12"/>
              </layout:boundingBox>
              <render:g>
                <render:ellipse render:stroke="black" render:stroke-width="2" render:fill="white" render:cx="50%" render:cy="50%" render:rx="50%"/>
              </render:g>
            </render:lineEnding>
            <render:lineEnding render:id="activatorHead">
              <layout:boundingBox layout:id="activatorHead_bb">
                <layout:position layout:x="-12" layout:y="-6"/>
                <layout:dimensions layout:width="12" layout:height="12"/>
              </layout:boundingBox>
              <render:g>
                <render:polygon render:stroke="black" render:stroke-width="2" render:fill="white">
                  <render:listOfElements>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="0" render:y="50%"/>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="50%" render:y="0"/>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="100%" render:y="50%"/>
                    <render:element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RenderPoint" render:x="50%" render:y="100%"/>
                  </render:listOfElements>
                </render:polygon>
              </render:g>
            </render:lineEnding>
            <render:lineEnding render:id="inhibitorHead">
              <layout:boundingBox layout:id="inhibitorHead_bb">
                <layout:position layout:x="-12" layout:y="-6"/>
                <layout:dimensions layout:width="12" layout:height="12"/>
              </layout:boundingBox>
              <render:g>
                <render:rectangle render:stroke="black" render:stroke-width="2" render:fill="white" render:x="80%" render:y="0" render:width="20%" render:height="100%"/>
              </render:g>
            </render:lineEnding>
          </render:listOfLineEndings>
          <render:listOfStyles>
            <render:style render:id="COMPARTMENTGLYPH_style_0" render:typeList="COMPARTMENTGLYPH">
              <render:g render:stroke="darkcyan" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="bottom" render:font-size="10">
                <render:rectangle render:stroke="darkcyan" render:stroke-width="2" render:fill="lightgray" render:x="0" render:y="0" render:width="100%" render:height="100%" render:rx="25" render:ry="25"/>
              </render:g>
            </render:style>
            <render:style render:id="SPECIESGLYPH_style_0" render:typeList="SPECIESGLYPH">
              <render:g render:stroke="black" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="middle" render:font-size="24">
                <render:rectangle render:stroke="black" render:stroke-width="2" render:fill="white" render:x="0" render:y="0" render:width="100%" render:height="100%" render:rx="6" render:ry="3.6"/>
              </render:g>
            </render:style>
            <render:style render:id="REACTIONGLYPH_style_0" render:typeList="REACTIONGLYPH">
              <render:g render:stroke="darkslategray" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="middle" render:font-size="12">
                <render:ellipse render:stroke="black" render:stroke-width="2" render:fill="white" render:cx="50%" render:cy="50%" render:rx="50%"/>
              </render:g>
            </render:style>
            <render:style render:id="substrate_style_0" render:roleList="substrate">
              <render:g render:stroke="black" render:stroke-width="2"/>
            </render:style>
            <render:style render:id="sidesubstrate_style_0" render:roleList="sidesubstrate">
              <render:g render:stroke="black" render:stroke-width="2"/>
            </render:style>
            <render:style render:id="product_style_0" render:roleList="product">
              <render:g render:stroke="black" render:stroke-width="2" render:endHead="productHead"/>
            </render:style>
            <render:style render:id="sideproduct_style_0" render:roleList="sideproduct">
              <render:g render:stroke="black" render:stroke-width="2" render:endHead="productHead"/>
            </render:style>
            <render:style render:id="modifier_style_0" render:roleList="modifier">
              <render:g render:stroke="black" render:stroke-width="2" render:endHead="modifierHead"/>
            </render:style>
            <render:style render:id="activator_style_0" render:roleList="activator">
              <render:g render:stroke="black" render:stroke-width="2" render:endHead="activatorHead"/>
            </render:style>
            <render:style render:id="inhibitor_style_0" render:roleList="inhibitor">
              <render:g render:stroke="black" render:stroke-width="2" render:endHead="inhibitorHead"/>
            </render:style>
            <render:style render:id="EMPTY_SPECIESGLYPH_style_0" render:typeList="EMPTY_SPECIESGLYPH">
              <render:g>
                <render:ellipse render:stroke="black" render:stroke-width="2" render:fill="white" render:cx="50%" render:cy="50%" render:rx="50%"/>
              </render:g>
            </render:style>
            <render:style render:id="COMPARTMENTGLYPH_TEXTGLYPH_style_0" render:typeList="COMPARTMENTGLYPH_TEXTGLYPH">
              <render:g render:stroke="darkcyan" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="bottom" render:font-size="10"/>
            </render:style>
            <render:style render:id="SPECIESGLYPH_TEXTGLYPH_style_0" render:typeList="SPECIESGLYPH_TEXTGLYPH">
              <render:g render:stroke="black" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="middle" render:font-size="24"/>
            </render:style>
            <render:style render:id="REACTIONGLYPH_TEXTGLYPH_style_0" render:typeList="REACTIONGLYPH_TEXTGLYPH">
              <render:g render:stroke="darkslategray" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="middle" render:font-size="12"/>
            </render:style>
            <render:style render:id="GRAPHICALOBJECT_style_0" render:typeList="GRAPHICALOBJECT">
              <render:g render:stroke="black" render:font-family="sans-serif" render:font-weight="normal" render:font-style="normal" render:text-anchor="middle" render:vtext-anchor="middle" render:font-size="24">
                <render:rectangle render:stroke="black" render:stroke-width="2" render:fill="white" render:x="0" render:y="0" render:width="100%" render:height="100%" render:rx="6" render:ry="3.6"/>
              </render:g>
            </render:style>
          </render:listOfStyles>
        </render:renderInformation>
      </render:listOfGlobalRenderInformation>
    </layout:listOfLayouts>
  </model>
</sbml>
@adelhpour
Copy link
Member

Currently, the autolayout fist creates the Reactions, and then the Species, which are the participants of those reactions. So, if a Species is not part of a reaction, its graphical representation (SpeciesGlyph) is not created. I'm not sure what having a Species which is not part of any reactions mean from a modeling point of view, so maybe we can talk more about it!

@luciansmith
Copy link
Author

It just means that it's a model of stuff in a compartment, that might change due to rate rules or assignment rules, or might just stay constant. It's perfectly reasonable to visualize it, though.

@adelhpour
Copy link
Member

Nice! So I will add visualizing them in my list. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants