COPASI API
4.16.103
|
#include <CCellDesignerImporter.h>
Public Member Functions | |
CCellDesignerImporter (SBMLDocument *pDocument=0) | |
const Layout * | getLayout () const |
const SBMLDocument * | getSBMLDocument () const |
void | setSBMLDocument (SBMLDocument *pDocument) |
Static Public Member Functions | |
static double | determineVersion (const XMLNode *pNode) |
static const XMLNode * | findCellDesignerAnnotation (SBMLDocument *pDocument, const XMLNode *pAnnotation) |
static std::pair< bool, std::string > | findCellDesignerNamespace (const SBMLDocument *pDocument) |
Protected Member Functions | |
void | addDependency (const std::string &parent, const std::string &child) |
void | checkLinkAnchor (LinkTarget &link, const Point &p) |
void | checkLinkAnchors (LinkTarget &substrate, LinkTarget &product) |
bool | convertCellDesignerLayout (const XMLNode *pCellDesignerAnnotation) |
bool | convertCompartmentAnnotations () |
bool | convertReactionAnnotation (Reaction *pReaction, const Model *pModel) |
bool | convertReactionAnnotations () |
bool | convertSpeciesAnnotations () |
bool | createCatalysisStyles () |
bool | createCompartmentGlyph (const CompartmentAlias &ca) |
bool | createCompartmentGlyphs (const XMLNode *pLoCA) |
bool | createCompartmentStyle (const CompartmentAlias &ca, const CompartmentGlyph *pCGlyph) |
bool | createDefaultActivatorStyle () |
bool | createDefaultInhibitorStyle () |
bool | createDefaultModifierStyle () |
bool | createDefaultProductStyle () |
bool | createDefaultReactionGlyphStyle () |
bool | createDefaultStyles () |
bool | createDefaultSubstrateStyle () |
bool | createPrimitive (RenderGroup *pGroup, const SpeciesIdentity &si, const BoundingBox &bounds, const Point &offset, double stroke_width, const std::string &stroke_color, const std::string &fill_color, const std::string &text="") |
bool | createProteinModification (RenderGroup *pGroup, const SpeciesModification &smod, const BoundingBox &bounds, const std::string &stroke_color) |
bool | createSpeciesGlyph (const SpeciesAlias &sa) |
bool | createSpeciesGlyphs (const XMLNode *pLoSA) |
bool | createSpeciesReferenceGlyphs (ReactionGlyph *pRGlyph, const std::vector< LinkTarget > &link, std::map< SpeciesReferenceGlyph *, Point > &startsMap, bool reactants) |
bool | createSpeciesStyles () |
bool | createTextGlyphStyle (double size, Text::TEXT_ANCHOR hAlign, Text::TEXT_ANCHOR vAlign, const std::string &objectReference) |
std::string | createUniqueId (const std::string &prefix) |
bool | findOrCreateColorDefinition (const std::string &color_string, std::string &id) |
std::string | findRootElementId (const std::string &id) const |
std::string | getColorString (const std::string &color_id) const |
bool | handleExtraReactionElements (ReactionGlyph *pRGlyph, ReactionAnnotation &ranno, bool substrate) |
bool | handleIncludedSpecies (const XMLNode *pNode) |
bool | handleModificationLinks (ReactionGlyph *pRGlyph, ReactionAnnotation &ranno) |
bool | parseProteins (const XMLNode *pNode) |
bool | setSpeciesGlyphId (SpeciesReferenceGlyph *pGlyph, const LinkTarget &link) |
bool | setSpeciesReferenceId (SpeciesReferenceGlyph *pGlyph, const LinkTarget &link, const std::string &reactionId) |
Static Protected Member Functions | |
static void | addAllPositions (std::vector< POSITION > &v) |
static double | angle (const Point &v) |
static Point | calculateAbsoluteValue (const Point &p, const Point &p1, const Point &p2, const Point &p3) |
static SPECIES_CLASS | classToEnum (std::string cl) |
static CONNECTION_POLICY | connectionPolicyToEnum (std::string s) |
template<typename ITERATOR > | |
static bool | createLineSegments (Curve *pCurve, ITERATOR start, ITERATOR end) |
static bool | createOrthogonal (const Point &v1, Point &v2) |
static DIRECTION_VALUE | directionToEnum (std::string s) |
static double | distance (const Point &p1, const Point &p2) |
static const XMLNode * | findChildNode (const XMLNode *pNode, const std::string &prefix, const std::string &name, bool recursive=false) |
static bool | findShortestConnection (std::vector< POSITION > &pos1, std::vector< POSITION > &pos2, const BoundingBox &box1, const BoundingBox &box2) |
static POSITION | findShortestConnection (const Point &p, std::vector< POSITION > &pos, const BoundingBox &box) |
static Point | getPositionPoint (const BoundingBox &box, POSITION position) |
static MODIFICATION_LINK_TYPE | modificationLinkTypeToEnum (std::string s) |
static MODIFICATION_TYPE | modificationTypeToEnum (std::string s) |
static PAINT_SCHEME | paintSchemeToEnum (std::string s) |
static bool | parseBounds (const XMLNode *pNode, BoundingBox &box) |
static bool | parseBoxSize (const XMLNode *pNode, Dimensions &d) |
static bool | parseCompartmentAlias (const XMLNode *pNode, CompartmentAlias &ca, const Dimensions &layout_dimensions) |
static bool | parseCompartmentAnnotation (const XMLNode *pNode, CompartmentAnnotation &anno) |
static bool | parseConnectScheme (const XMLNode *pNode, ConnectScheme &scheme) |
static bool | parseDoubleLine (const XMLNode *pNode, DoubleLine &dl) |
static bool | parseEditPoints (const XMLNode *pNode, EditPoints &editpoints) |
static bool | parseExtraLink (const XMLNode *pNode, ReactantLink &l) |
static bool | parseExtraLinks (const XMLNode *pNode, std::vector< ReactantLink > &rlinks) |
static bool | parseLine (const XMLNode *pNode, Line &line) |
static bool | parseLineDirection (const XMLNode *pNode, LineDirection &d) |
static bool | parseLinkTarget (const XMLNode *pNode, LinkTarget &l) |
static bool | parseModelDisplay (const XMLNode *pNode, Dimensions &d) |
static bool | parsePaint (const XMLNode *pNode, Paint &p) |
static bool | parsePoint (const XMLNode *pNode, Point &p) |
static bool | parsePointsString (const std::string &s, std::vector< Point > &points) |
static bool | parseProteinModification (const XMLNode *pNode, ProteinModification &mod) |
static bool | parseReactionAnnotation (const XMLNode *pNode, ReactionAnnotation &ranno) |
static bool | parseReactionElements (const XMLNode *pNode, std::vector< LinkTarget > &elements) |
static bool | parseReactionModification (const XMLNode *pNode, ReactionModification &mod) |
static bool | parseReactionModifications (const XMLNode *pNode, std::vector< ReactionModification > &rmods) |
static bool | parseSpeciesAlias (const XMLNode *pNode, SpeciesAlias &sa) |
static bool | parseSpeciesAnnotation (const XMLNode *pNode, SpeciesAnnotation &anno) |
static bool | parseSpeciesIdentity (const XMLNode *pNode, SpeciesIdentity &identity) |
static bool | parseSpeciesModification (const XMLNode *pNode, SpeciesModification &mod) |
static bool | parseSpeciesState (const XMLNode *pNode, SpeciesState &state) |
static bool | parseUsualView (const XMLNode *pNode, UsualView &view) |
static POSITION_TO_COMPARTMENT | positionToCompartmentToEnum (std::string s) |
static POSITION | positionToEnum (std::string pos) |
static REACTION_TYPE | reactionTypeToEnum (std::string s) |
static void | rotate (const Point &p, double a, Point &r) |
static SPECIES_MODIFICATION_TYPE | speciesModificationTypeToEnum (std::string cl) |
static bool | splitString (const std::string &s, std::vector< std::string > &parts, const std::string &splitChars) |
Protected Attributes | |
std::map< std::string, BoundingBox > | mCDBounds |
std::map< std::string, GraphicalObject * > | mCDIdToLayoutElement |
std::map< std::string, std::string > | mColorStringMap |
std::map< const CompartmentGlyph *, CompartmentAlias > | mCompartmentAliasMap |
std::map< std::string, CompartmentAnnotation > | mCompartmentAnnotationMap |
std::map< const CompartmentGlyph *, Point > | mCompartmentNamePointMap |
std::list< CCopasiNode < std::string > * > | mComplexDependencies |
std::map< std::string, const SBase * > | mIdMap |
std::map< std::string, std::pair< std::string, SpeciesIdentity > > | mIncludedSpeciesNameMap |
std::multimap< std::string, GraphicalObject * > | mModelIdToLayoutElement |
std::map < MODIFICATION_LINK_TYPE, LocalStyle * > | mModificationLinkStyleMap |
SBMLDocument * | mpDocument |
Layout * | mpLayout |
LocalRenderInformation * | mpLocalRenderInfo |
std::map< std::string, Protein > | mProteinInformationMap |
std::map< std::string, SpeciesAlias > | mSpeciesAliases |
std::map< const SpeciesGlyph *, SpeciesAlias > | mSpeciesAliasMap |
std::map< std::string, SpeciesAnnotation > | mSpeciesAnnotationMap |
This class converts CellDesigner layout information into SBML layout. Maybe later versions will also be able to handle the render information part.
Definition at line 510 of file CCellDesignerImporter.h.
CCellDesignerImporter::CCellDesignerImporter | ( | SBMLDocument * | pDocument = 0 | ) |
Constructor that takes a pointer to an SBMLDocument. The SBMLDocument will not be copied and it will not be owned by the importer. If the pointer is not NULL, the class will try to directly convert the CellDesigner layout if there is one.
Definition at line 85 of file CCellDesignerImporter.cpp.
References convertCellDesignerLayout(), findCellDesignerAnnotation(), and mpDocument.
Adds all possible POSITION enums to the given vector. The vector is cleared first.
Definition at line 9068 of file CCellDesignerImporter.cpp.
References POSITION_N, and POSITION_NNW.
Referenced by checkLinkAnchor(), checkLinkAnchors(), handleExtraReactionElements(), and handleModificationLinks().
|
protected |
Adds a new entry to the dependency tree for complex species aliases.
Definition at line 3594 of file CCellDesignerImporter.cpp.
References CCopasiNode< _Data >::addChild(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getNext(), CCopasiNode< _Data >::getSibling(), mComplexDependencies, and CCopasiNode< _Data >::setData().
Referenced by createSpeciesGlyph().
|
staticprotected |
Calculates the angle between the given vector and the positive x axis. The result is returned in radians.
Definition at line 10324 of file CCellDesignerImporter.cpp.
Referenced by handleModificationLinks().
|
staticprotected |
Calculates the absolute position for point p based on the three other points (p1,p2,p3) given. The formula for that is: p1 + p.x * (p2 - p1) + p.y * (p3 - p1)
Definition at line 9270 of file CCellDesignerImporter.cpp.
Referenced by convertReactionAnnotation(), and handleModificationLinks().
|
protected |
Checks if the given ReactantLink object has a valid linkAnchor If not, we try to determine the best anchor be finding the one that is closest to the given point.
Definition at line 9283 of file CCellDesignerImporter.cpp.
References addAllPositions(), findShortestConnection(), LinkTarget::mAlias, mCDBounds, LinkTarget::mPosition, and POSITION_UNDEFINED.
Referenced by convertReactionAnnotation().
|
protected |
Checks if the given ReactantLink objects have valid linkAnchors If not, we try to determine the best anchor be finding the ones that give the shortest connection between the two objects
Definition at line 9308 of file CCellDesignerImporter.cpp.
References addAllPositions(), findShortestConnection(), LinkTarget::mAlias, mCDBounds, LinkTarget::mPosition, and POSITION_UNDEFINED.
Referenced by convertReactionAnnotation().
|
staticprotected |
Converts the given class string to the correspnding SPECIES_CLASS enum value. If no enum is found, UNDEFINED is returned.
Definition at line 4805 of file CCellDesignerImporter.cpp.
References ANTISENSE_RNA_CLASS, CHANNEL_CLASS, COMPLEX_CLASS, DEGRADED_CLASS, DRUG_CLASS, GENE_CLASS, ION_CLASS, OVAL_CLASS, PHENOTYPE_CLASS, PROTEIN_CLASS, RECEPTOR_CLASS, RNA_CLASS, SIMPLE_MOLECULE_CLASS, SQUARE_CLASS, SQUARE_E_CLASS, SQUARE_N_CLASS, SQUARE_NE_CLASS, SQUARE_NW_CLASS, SQUARE_S_CLASS, SQUARE_SE_CLASS, SQUARE_SW_CLASS, SQUARE_W_CLASS, transform(), TRUNCATED_CLASS, UNDEFINED_CLASS, and UNKNOWN_CLASS.
Referenced by parseCompartmentAlias(), parseProteins(), and parseSpeciesIdentity().
|
staticprotected |
Converts the given connection policy string to the corresponding enum. If there is no enum that corresponds to the string, POLICY_UNDEFINED is returned.
Definition at line 4662 of file CCellDesignerImporter.cpp.
References POLICY_DIRECT, POLICY_SQUARE, POLICY_UNDEFINED, and transform().
Referenced by parseConnectScheme().
|
protected |
This method tries to convert the CellDesigner annotation to an SBML Layout. On success the method will return true and false otherwise.
Definition at line 331 of file CCellDesignerImporter.cpp.
References SBMLUtils::collectIds(), convertCompartmentAnnotations(), convertReactionAnnotations(), convertSpeciesAnnotations(), createCompartmentGlyphs(), createDefaultStyles(), createSpeciesGlyphs(), createSpeciesStyles(), createUniqueId(), determineVersion(), findChildNode(), handleIncludedSpecies(), mCDBounds, mCDIdToLayoutElement, mColorStringMap, mCompartmentAliasMap, mCompartmentAnnotationMap, mCompartmentNamePointMap, mComplexDependencies, mIdMap, mModelIdToLayoutElement, mpDocument, mpLayout, mpLocalRenderInfo, mProteinInformationMap, mSpeciesAliases, mSpeciesAliasMap, mSpeciesAnnotationMap, parseModelDisplay(), and parseProteins().
Referenced by CCellDesignerImporter(), and setSBMLDocument().
|
protected |
Traverses the compartments of the model and looks for CellDesigner annotations. These are used to create text glyphs associated with compartments.
Definition at line 3374 of file CCellDesignerImporter.cpp.
References createTextGlyphStyle(), createUniqueId(), findCellDesignerAnnotation(), mCompartmentAliasMap, mCompartmentAnnotationMap, mCompartmentNamePointMap, mIdMap, mModelIdToLayoutElement, CompartmentAnnotation::mName, mpDocument, mpLayout, and parseCompartmentAnnotation().
Referenced by convertCellDesignerLayout().
|
protected |
Looks for CellDesigner annotation in the given reaction and ries to convert the information in that annotation into a ReactionGlyph.
Definition at line 2246 of file CCellDesignerImporter.cpp.
References calculateAbsoluteValue(), CATALYSIS_RTYPE, checkLinkAnchor(), checkLinkAnchors(), createLineSegments(), createOrthogonal(), createUniqueId(), DISSOCIATION_RTYPE, distance(), findCellDesignerAnnotation(), getPositionPoint(), handleExtraReactionElements(), handleModificationLinks(), HETERODIMER_ASSOCIATION_RTYPE, INHIBITION_RTYPE, KNOWN_TRANSITION_OMITTED_RTYPE, ReactionAnnotation::mBaseProducts, ReactionAnnotation::mBaseReactants, mCDBounds, ReactionAnnotation::mConnectScheme, ReactionAnnotation::mEditPoints, mIdMap, EditPoints::mOmittedShapeIndex, mpDocument, mpLayout, EditPoints::mPoints, ConnectScheme::mRectangleIndex, EditPoints::mTShapeIndex, ReactionAnnotation::mType, parseReactionAnnotation(), POSITION_UNDEFINED, setSpeciesGlyphId(), setSpeciesReferenceId(), STATE_TRANSITION_RTYPE, TRANSCRIPTION_RTYPE, TRANSCRIPTIONAL_ACTIVATION_RTYPE, TRANSCRIPTIONAL_INHIBITION_RTYPE, TRANSLATION_RTYPE, TRANSLATIONAL_ACTIVATION_RTYPE, TRANSLATIONAL_INHIBITION_RTYPE, TRANSPORT_RTYPE, TRUNCATION_RTYPE, UNKNOWN_CATALYSIS_RTYPE, UNKNOWN_INHIBITION_RTYPE, and UNKNOWN_TRANSITION_RTYPE.
Referenced by convertReactionAnnotations().
|
protected |
Traverses the reactions of the model and looks for CellDesigner annotations. These are used to create reaction glyphs.
Definition at line 2212 of file CCellDesignerImporter.cpp.
References convertReactionAnnotation(), and mpDocument.
Referenced by convertCellDesignerLayout().
|
protected |
Traverses the species of the model and looks for CellDesigner annotations. These are used to create text glyphs associated with species.
Definition at line 3481 of file CCellDesignerImporter.cpp.
References createTextGlyphStyle(), createUniqueId(), DEGRADED_CLASS, findCellDesignerAnnotation(), SpeciesAnnotation::mIdentity, mIdMap, mModelIdToLayoutElement, mpDocument, mpLayout, mSpeciesAliasMap, mSpeciesAnnotationMap, SpeciesIdentity::mSpeciesClass, and parseSpeciesAnnotation().
Referenced by convertCellDesignerLayout().
|
protected |
Create style for catalysis.
Definition at line 8727 of file CCellDesignerImporter.cpp.
References CATALYSIS_ML_TYPE, createUniqueId(), mColorStringMap, mIdMap, mModificationLinkStyleMap, mpLocalRenderInfo, and UNKNOWN_CATALYSIS_ML_TYPE.
Referenced by createDefaultStyles().
|
protected |
Creates the compartment glyph from the given compartmentAliase structure.
Definition at line 676 of file CCellDesignerImporter.cpp.
References createCompartmentStyle(), createUniqueId(), CompartmentAlias::mBounds, mCDIdToLayoutElement, CompartmentAlias::mCompartment, mCompartmentAliasMap, mCompartmentNamePointMap, CompartmentAlias::mId, mIdMap, mModelIdToLayoutElement, CompartmentAlias::mNamePoint, mpDocument, and mpLayout.
Referenced by createCompartmentGlyphs().
|
protected |
Creates the compartment glyphs from the given node that represents the listOfCompartmentAliases.
Definition at line 598 of file CCellDesignerImporter.cpp.
References createCompartmentGlyph(), mpLayout, and parseCompartmentAlias().
Referenced by convertCellDesignerLayout().
|
protected |
This method creates a new local style based on the passed in CompartmentAlias object. The style is associated with the object via the given id. If Creating the style fails, false is returned.
Definition at line 6580 of file CCellDesignerImporter.cpp.
References createUniqueId(), findOrCreateColorDefinition(), CompartmentAlias::mClass, Paint::mColor, CompartmentAlias::mDoubleLine, CompartmentAlias::mFontSize, mIdMap, CompartmentAlias::mPaint, mpLocalRenderInfo, DoubleLine::mThickness, OVAL_CLASS, SQUARE_CLASS, SQUARE_E_CLASS, SQUARE_N_CLASS, SQUARE_NE_CLASS, SQUARE_NW_CLASS, SQUARE_S_CLASS, SQUARE_SE_CLASS, SQUARE_SW_CLASS, and SQUARE_W_CLASS.
Referenced by createCompartmentGlyph().
|
protected |
Create default style for activators.
Definition at line 8590 of file CCellDesignerImporter.cpp.
References createUniqueId(), mColorStringMap, mIdMap, and mpLocalRenderInfo.
Referenced by createDefaultStyles().
|
protected |
Create default style for inhibitors.
Definition at line 8486 of file CCellDesignerImporter.cpp.
References createUniqueId(), mColorStringMap, mIdMap, and mpLocalRenderInfo.
Referenced by createDefaultStyles().
|
protected |
Create default style for modifiers.
Definition at line 8338 of file CCellDesignerImporter.cpp.
References createUniqueId(), mColorStringMap, mIdMap, and mpLocalRenderInfo.
Referenced by createDefaultStyles().
|
protected |
Create default style for products.
Definition at line 8878 of file CCellDesignerImporter.cpp.
References createUniqueId(), mColorStringMap, mIdMap, and mpLocalRenderInfo.
Referenced by createDefaultStyles().
|
protected |
Create default style for reaction glyphs.
Definition at line 8284 of file CCellDesignerImporter.cpp.
References createUniqueId(), mColorStringMap, mIdMap, and mpLocalRenderInfo.
Referenced by createDefaultStyles().
|
protected |
TODO right now, we use default styles for species reference glyphs TODO and reaction glyphs. TODO These are created here. TODO later we have to create individual styles based on the type of reaction TODO and the color set in the CellDesigner annotation.
Definition at line 8258 of file CCellDesignerImporter.cpp.
References createCatalysisStyles(), createDefaultActivatorStyle(), createDefaultInhibitorStyle(), createDefaultModifierStyle(), createDefaultProductStyle(), createDefaultReactionGlyphStyle(), createDefaultSubstrateStyle(), mModificationLinkStyleMap, and mpLocalRenderInfo.
Referenced by convertCellDesignerLayout().
|
protected |
Create default style for substrates.
Definition at line 9017 of file CCellDesignerImporter.cpp.
References createUniqueId(), mColorStringMap, mIdMap, and mpLocalRenderInfo.
Referenced by createDefaultStyles().
|
inlinestaticprotected |
This method takes a pointer to a curve object as well as a start iterator and an end iterator which both iterate over a datastructure that contains points. For each point pair, a line segment is created and added to curve. The new curve segments are added to the end of the curve.
If no error occurs, true is returned, else false is returned.
Definition at line 1260 of file CCellDesignerImporter.h.
Referenced by convertReactionAnnotation().
|
staticprotected |
Creates a vector that is orthogonal to the given first vector. If there is a problem, false is returned.
Definition at line 10267 of file CCellDesignerImporter.cpp.
Referenced by convertReactionAnnotation(), and handleModificationLinks().
|
protected |
Create a primitive that corresponds to the given species specific class The primitive is created in the given group object. The complete primitive is translated by the given offset.
If creation of the primitive fails, false is returned.
Create a primitive that corresponds to the given class The promitive is created in the given group object. The complete primitive is translated by the given offset.
If creation of the primitive fails, false is returned.
Definition at line 1038 of file CCellDesignerImporter.cpp.
References ANTISENSE_RNA_CLASS, CHANNEL_CLASS, COMPLEX_CLASS, createProteinModification(), DEGRADED_CLASS, DRUG_CLASS, GENE_CLASS, ION_CLASS, SpeciesState::mModifications, SpeciesIdentity::mNameOrReference, mProteinInformationMap, SpeciesIdentity::mSpeciesClass, SpeciesIdentity::mState, PHENOTYPE_CLASS, PROTEIN_CLASS, RECEPTOR_CLASS, RNA_CLASS, SIMPLE_MOLECULE_CLASS, TRUNCATED_CLASS, UNDEFINED_CLASS, and UNKNOWN_CLASS.
Referenced by createSpeciesStyles().
|
protected |
Takes a protein modification description and creates the corresponding primitive.
Definition at line 2081 of file CCellDesignerImporter.cpp.
References ACETYLATED_MOD_TYPE, DONTCARE_MOD_TYPE, GLYCOSYLATED_MOD_TYPE, HYDROXYLATED_MOD_TYPE, METHYLATED_MOD_TYPE, SpeciesModification::mType, MYRISTOYLATED_MOD_TYPE, PALMYTOYLATED_MOD_TYPE, PHOSPHORYLATED_MOD_TYPE, PRENYLATED_MOD_TYPE, PROTONATED_MOD_TYPE, SUFLATED_MOD_TYPE, UBIQUITINATED_MOD_TYPE, and UNKNOWN_MOD_TYPE.
Referenced by createPrimitive().
|
protected |
Creates the species glyph from the given SpeciesAliases structure.
Definition at line 728 of file CCellDesignerImporter.cpp.
References addDependency(), createUniqueId(), SpeciesAlias::mBounds, mCDBounds, mCDIdToLayoutElement, SpeciesAlias::mComplexSpeciesAlias, SpeciesAlias::mId, mIdMap, mModelIdToLayoutElement, mpDocument, mpLayout, SpeciesAlias::mSpecies, mSpeciesAliases, and mSpeciesAliasMap.
Referenced by createSpeciesGlyphs().