biouml.plugins.sbml
Class SbmlModelReader

java.lang.Object
  extended bybiouml.plugins.sbml.SbmlConstants
      extended bybiouml.plugins.sbml.SbmlSupport
          extended bybiouml.plugins.sbml.SbmlModelReader
Direct Known Subclasses:
SbmlModelReader_11, SbmlModelReader_21

public abstract class SbmlModelReader
extends SbmlSupport

To do:
read Units, read Rules, functions support
Pendung:
generation of name for parameters defined in reaction. Currently name is generated as reactioName_parameterName., name validations that they are valid SNames

Field Summary
protected  java.util.Map compartmentMap
           
protected  Compartment defaultCompartment
           
protected  java.lang.String level
           
protected  LinearFormatter linearFormatter
           
protected  int maxVisibleVariableNumber
           
protected  boolean shouldLayout
           
protected  java.util.Map specieMap
           
protected  biouml.plugins.sbml.SbmlModelReader.SbmlVariableResolver variableResolver
           
protected  java.lang.String version
           
protected  int visibleVariableNumber
           
 
Fields inherited from class biouml.plugins.sbml.SbmlSupport
diagram, emodel, log, modelName
 
Fields inherited from class biouml.plugins.sbml.SbmlConstants
ANNOTATION_ELEMENT, ASSIGNEMENT_ELEMENT, ASSIGNEMENT_LIST_ELEMENT, ASSIGNEMENT_VARIABLE_ATTR, BIOUML_COMPARTMENT_INFO_ELEMENT, BIOUML_EDGE_INFO_ELEMENT, BIOUML_NODE_INFO_ELEMENT, BIOUML_SPECIE_INFO_ELEMENT, BIOUML_SPECIE_TYPE_ATTR, BIOUML_XMLNS_ATTR, BIOUML_XMLNS_VALUE, COMPARTMENT_ATTR, COMPARTMENT_DIMENTION_ATTR, COMPARTMENT_ELEMENT, COMPARTMENT_LIST_ELEMENT, COMPARTMENT_OUTSIDE_ATTR, COMPARTMENT_VOLUME_ATTR, CONSTANT_ATTR, DELAY_ELEMENT, DENOMINATOR_ATTR, EVENT_ELEMENT, EVENT_LIST_ELEMENT, FORMULA_ATTR, FUNCTION_DEFINITION_ELEMENT, FUNCTION_LIST_ELEMENT, ID_ATTR, KINETIC_LAW_ELEMENT, MATH_ATTR, MATH_ELEMENT, MODEL_ELEMENT, MODIFIER_LIST_ELEMENT, NAME_ATTR, NOTES_ELEMENT, PARAMETER_ELEMENT, PARAMETER_LIST_ELEMENT, PARAMETER_VALUE_ATTR, PRODUCT_LIST_ELEMENT, PRODUCT_STUB, REACTANT_LIST_ELEMENT, REACTANT_STUB, REACTION_ELEMENT, REACTION_FAST_ATTR, REACTION_LIST_ELEMENT, REACTION_REVERSIBLE_ATTR, RULE_ALGEBRAIC_ELEMENT, RULE_ASSIGNEMENT_ELEMENT, RULE_COMMENT_ATTR, RULE_COMPARTMENT_VOLUME_ELEMENT, RULE_FORMULA_ATTR, RULE_LIST_ELEMENT, RULE_PARAMETER_ELEMENT, RULE_RATE_ELEMENT, RULE_SPECIE_CONCENTRATION_ELEMENT, RULE_VARIABLE_ATTR, SBML_ELEMENT, SBML_LEVEL_ATTR, SBML_LEVEL_VALUE_1, SBML_LEVEL_VALUE_2, SBML_VERSION_ATTR, SBML_VERSION_VALUE_1, SBML_VERSION_VALUE_2, SBML_XMLNS_VALUE, SPECIE_ATTR, SPECIE_ATTR_11, SPECIE_BOUNDARY_CONDITION_ATTR, SPECIE_CHARGE_ATTR, SPECIE_DEFAULT_SUBSTANCE_UNITS, SPECIE_ELEMENT, SPECIE_ELEMENT_11, SPECIE_HAS_ONLY_SUBSTANCE_UNITS_ATTR, SPECIE_INITIAL_AMOUNT_ATTR, SPECIE_INITIAL_CONCENTRATION_ATTR, SPECIE_LIST_ELEMENT, SPECIE_REFERENCE_ELEMENT, SPECIE_REFERENCE_ELEMENT_11, SPECIE_SPATIAL_SIZE_UNITS_ATTR, SPECIE_SUBSTANCE_UNITS_ATTR, STOICHIOMETRY_ATTR, STOICHIOMETRY_MATH_ELEMENT, SUBSTANCE_UNITS_ATTR, TIME_UNITS_ATTR, TRIGGER_ELEMENT, TYPE_ATTR, UNIT_LIST_ELEMENT, UNIT_SUBSTANCE, UNIT_TIME, UNIT_VOLUME, UNITS_ATTR, XMLNS_ATTR
 
Constructor Summary
SbmlModelReader()
           
 
Method Summary
protected  double convertUnit(java.lang.String unitName, double value)
          It converts value to unified unit system.
protected  DiagramType getDiagramType()
           
protected abstract  java.lang.String getId(org.w3c.dom.Element element)
           
protected  java.lang.String getSpecieAttribute(org.w3c.dom.Element specieRef)
           
protected  org.w3c.dom.NodeList getSpecieElement(org.w3c.dom.Element specieList)
           
protected  org.w3c.dom.NodeList getSpecieReference(org.w3c.dom.Element list)
           
protected abstract  java.lang.String getTitle(org.w3c.dom.Element element)
           
 boolean isReaction(DiagramElement de)
           
 boolean isSpecie(DiagramElement de)
           
protected abstract  boolean isValid(java.lang.String paramName, java.lang.Object element, java.lang.String name)
           
 void layout(Compartment compartment)
          Stub implimentation for diagram layout.
 void layout(Compartment compartment, int x, int y)
          Hierarchically layout compartments and species.
protected  boolean parseAsCompartment(java.lang.String token, java.lang.StringBuffer result)
           
protected  boolean parseAsParameter(java.lang.String token, java.lang.StringBuffer result, Node reaction)
           
protected  boolean parseAsSpecie(java.lang.String token, java.lang.StringBuffer result)
           
 Diagram read(org.w3c.dom.Document document, java.lang.String name, DataCollection origin)
           
protected  Compartment readCompartment(org.w3c.dom.Element element, java.lang.String compartmentId, java.lang.String compartmentName)
           
protected  void readCompartmentList(org.w3c.dom.Element model)
          Read list of compartments.
protected  void readEventList(org.w3c.dom.Element element)
           
protected  void readFunctionDefinitionList(org.w3c.dom.Element model)
           
protected  void readKineticLaw(org.w3c.dom.Element element, Node reaction)
           
protected abstract  void readKineticLawFormula(org.w3c.dom.Element element, Node reaction, KineticLaw law)
           
protected  void readModifiers(org.w3c.dom.Element element, Node reaction)
           
 java.lang.String readNotes(org.w3c.dom.Element element)
           
protected  Variable readParameter(org.w3c.dom.Element element, java.lang.String parameterId, Node reaction)
           
protected  void readParameterList(org.w3c.dom.Element parent, Node reaction)
          Read list of parameters for the specified element.
protected  void readProducts(org.w3c.dom.Element element, Node reaction)
           
protected  void readReactants(org.w3c.dom.Element element, Node reaction)
           
protected  Node readReaction(org.w3c.dom.Element element, java.lang.String reactionId, java.lang.String reactionName)
           
protected  void readReactionList(org.w3c.dom.Element model)
          Read list of reactions.
protected abstract  void readRule(org.w3c.dom.Element model, int i)
           
protected  void readRuleList(org.w3c.dom.Element model)
           
protected  Node readSpecie(org.w3c.dom.Element element, java.lang.String specieId, java.lang.String specieName)
           
protected  void readSpecieList(org.w3c.dom.Element model)
          Read list of species.
protected  void readSpecieReference(Node reactionNode, org.w3c.dom.Element element, java.lang.String specieId, java.lang.String role)
           
protected abstract  void readStoichiometry(org.w3c.dom.Element element, SpecieReference reference, Node reactionNode)
           
protected  void readUnitList(org.w3c.dom.Element model)
          Read list of unit definitions.
protected  void validateReaction(Node reaction)
           
 
Methods inherited from class biouml.plugins.sbml.SbmlSupport
error, getElement, parseFormula, readXhtml, warn, writeXhtml
 
Methods inherited from class biouml.plugins.sbml.SbmlConstants
DEFAULT_SPATIAL_SIZE_UNITS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

level

protected java.lang.String level

version

protected java.lang.String version

compartmentMap

protected java.util.Map compartmentMap

specieMap

protected java.util.Map specieMap

defaultCompartment

protected Compartment defaultCompartment

shouldLayout

protected boolean shouldLayout

visibleVariableNumber

protected int visibleVariableNumber

maxVisibleVariableNumber

protected int maxVisibleVariableNumber

variableResolver

protected biouml.plugins.sbml.SbmlModelReader.SbmlVariableResolver variableResolver

linearFormatter

protected LinearFormatter linearFormatter
Constructor Detail

SbmlModelReader

public SbmlModelReader()
Method Detail

getDiagramType

protected DiagramType getDiagramType()

read

public Diagram read(org.w3c.dom.Document document,
                    java.lang.String name,
                    DataCollection origin)
             throws java.lang.Exception
Throws:
java.lang.Exception

readNotes

public java.lang.String readNotes(org.w3c.dom.Element element)

isValid

protected abstract boolean isValid(java.lang.String paramName,
                                   java.lang.Object element,
                                   java.lang.String name)

validateReaction

protected void validateReaction(Node reaction)

getId

protected abstract java.lang.String getId(org.w3c.dom.Element element)

getTitle

protected abstract java.lang.String getTitle(org.w3c.dom.Element element)

readRule

protected abstract void readRule(org.w3c.dom.Element model,
                                 int i)

getSpecieElement

protected org.w3c.dom.NodeList getSpecieElement(org.w3c.dom.Element specieList)

getSpecieReference

protected org.w3c.dom.NodeList getSpecieReference(org.w3c.dom.Element list)

getSpecieAttribute

protected java.lang.String getSpecieAttribute(org.w3c.dom.Element specieRef)

readModifiers

protected void readModifiers(org.w3c.dom.Element element,
                             Node reaction)

readStoichiometry

protected abstract void readStoichiometry(org.w3c.dom.Element element,
                                          SpecieReference reference,
                                          Node reactionNode)

readKineticLawFormula

protected abstract void readKineticLawFormula(org.w3c.dom.Element element,
                                              Node reaction,
                                              KineticLaw law)

readFunctionDefinitionList

protected void readFunctionDefinitionList(org.w3c.dom.Element model)

readEventList

protected void readEventList(org.w3c.dom.Element element)

convertUnit

protected double convertUnit(java.lang.String unitName,
                             double value)
It converts value to unified unit system.


readUnitList

protected void readUnitList(org.w3c.dom.Element model)
Read list of unit definitions.

Pendung:
todo

readCompartmentList

protected void readCompartmentList(org.w3c.dom.Element model)
Read list of compartments.


readCompartment

protected Compartment readCompartment(org.w3c.dom.Element element,
                                      java.lang.String compartmentId,
                                      java.lang.String compartmentName)
                               throws java.lang.Exception
Throws:
java.lang.Exception

readSpecieList

protected void readSpecieList(org.w3c.dom.Element model)
Read list of species.


readSpecie

protected Node readSpecie(org.w3c.dom.Element element,
                          java.lang.String specieId,
                          java.lang.String specieName)
                   throws java.lang.Exception
Throws:
java.lang.Exception

readParameterList

protected void readParameterList(org.w3c.dom.Element parent,
                                 Node reaction)
Read list of parameters for the specified element. If element is model, then gloabal parameters will be read.

Pendung:
reaction parameters processing

readParameter

protected Variable readParameter(org.w3c.dom.Element element,
                                 java.lang.String parameterId,
                                 Node reaction)
                          throws java.lang.Exception
Throws:
java.lang.Exception

readReactionList

protected void readReactionList(org.w3c.dom.Element model)
Read list of reactions.


readReaction

protected Node readReaction(org.w3c.dom.Element element,
                            java.lang.String reactionId,
                            java.lang.String reactionName)
                     throws java.lang.Exception
Throws:
java.lang.Exception

readReactants

protected void readReactants(org.w3c.dom.Element element,
                             Node reaction)

readProducts

protected void readProducts(org.w3c.dom.Element element,
                            Node reaction)

readSpecieReference

protected void readSpecieReference(Node reactionNode,
                                   org.w3c.dom.Element element,
                                   java.lang.String specieId,
                                   java.lang.String role)
                            throws java.lang.Exception
Throws:
java.lang.Exception

readKineticLaw

protected void readKineticLaw(org.w3c.dom.Element element,
                              Node reaction)

readRuleList

protected void readRuleList(org.w3c.dom.Element model)

parseAsSpecie

protected boolean parseAsSpecie(java.lang.String token,
                                java.lang.StringBuffer result)
Overrides:
parseAsSpecie in class SbmlSupport

parseAsCompartment

protected boolean parseAsCompartment(java.lang.String token,
                                     java.lang.StringBuffer result)
Overrides:
parseAsCompartment in class SbmlSupport

parseAsParameter

protected boolean parseAsParameter(java.lang.String token,
                                   java.lang.StringBuffer result,
                                   Node reaction)
Overrides:
parseAsParameter in class SbmlSupport

layout

public void layout(Compartment compartment)
Stub implimentation for diagram layout.


layout

public void layout(Compartment compartment,
                   int x,
                   int y)
Hierarchically layout compartments and species.

Pendung:
currently we use ApplicationFrame to get Graphics object

isSpecie

public boolean isSpecie(DiagramElement de)

isReaction

public boolean isReaction(DiagramElement de)


Copyright © 2001-2003 Biosof.Ru. All Rights Reserved.