COPASI API  4.40.278
SEDMLUtils Class Reference

#include <SEDMLUtils.h>

Static Public Member Functions

static std::string argbToRgba (const std::string &argb, bool includeHash=true)
 
static CModelValuecreateAmountMV (CModel *pModel, const CMetab *pMetab)
 
static std::string findIdByNameAndType (const std::map< const CDataObject *, SBase * > &map, int typeCode, const std::string &name)
 
static int getAlphaFromArgb (const std::string &argb)
 
static int getAlphaFromRgba (const std::string &rgba)
 
static std::string getNextId (const std::string &base, int count)
 
static const CDataObjectgetObjectForSbmlId (const CModel *pModel, const std::string &id, const std::string &SBMLType, bool initial=false)
 
static std::string getSbmlId (const CDataObject &object)
 
static std::string getSedMLStringForArchive (const std::string &fileName)
 
static std::string getXPathAndName (std::string &sbmlId, const std::string &type, const CModel *pModel, const CDataModel &dataModel)
 
static std::string getXPathForObject (const CDataObject &object)
 
static std::string getXPathForObjectAndType (const CDataObject &object, const std::string &sbmlId)
 
static std::string getXPathForSbmlIdAndType (const std::string &type, const std::string &sbmlId)
 
static int lineTypeFromSed (int linetype)
 
static int lineTypeToSed (int linetype)
 
static std::string & removeCharactersFromString (std::string &str, const std::string &characters)
 
static const CDataObjectresolveDatagenerator (CModel *model, const SedDataGenerator *dataReference)
 
static const CDataObjectresolveVariable (CModel *model, const SedVariable *variable)
 
static const CDataObjectresolveXPath (const CModel *model, const std::string &xpath, bool initial=false)
 
static std::string rgbaToArgb (const std::string &rgba, bool includeHash=true)
 
static void setLibCombineTempDir ()
 
static void splitStrings (const std::string &xpath, char delim, std::vector< std::string > &stringsContainer)
 
static int symbolFromSed (int symbol)
 
static int symbolToSed (int symbol)
 
static std::string translateTargetXpathInSBMLId (const std::string &xpath, std::string &SBMLType)
 

Static Public Attributes

static std::map< int, int > COPASI_LINE_STYLE_MAP
 
static std::map< int, int > COPASI_SYMBOL_MAP
 
static std::map< std::string, std::string > PARAMETER_KISAO_MAP
 

Detailed Description

Utility methods for SED-ML Import / Export

Member Function Documentation

◆ argbToRgba()

std::string SEDMLUtils::argbToRgba ( const std::string &  argb,
bool  includeHash = true 
)
static

◆ createAmountMV()

◆ findIdByNameAndType()

std::string SEDMLUtils::findIdByNameAndType ( const std::map< const CDataObject *, SBase * > &  map,
int  typeCode,
const std::string &  name 
)
static

tries to find a species id in the given map. Lookup will be performed by name

Returns
the species id if found or the empty string

References CDataObject::getObjectDisplayName(), and removeCharactersFromString().

Referenced by getXPathAndName().

◆ getAlphaFromArgb()

int SEDMLUtils::getAlphaFromArgb ( const std::string &  argb)
static

◆ getAlphaFromRgba()

int SEDMLUtils::getAlphaFromRgba ( const std::string &  rgba)
static

◆ getNextId()

◆ getObjectForSbmlId()

const CDataObject * SEDMLUtils::getObjectForSbmlId ( const CModel pModel,
const std::string &  id,
const std::string &  SBMLType,
bool  initial = false 
)
static

◆ getSbmlId()

std::string SEDMLUtils::getSbmlId ( const CDataObject object)
static
Returns
the sbml id of the object (or its parent, in case of a reference) or the empty string if not set

References CModelEntity::getSBMLId().

Referenced by getXPathForObject().

◆ getSedMLStringForArchive()

std::string SEDMLUtils::getSedMLStringForArchive ( const std::string &  fileName)
static

◆ getXPathAndName()

std::string SEDMLUtils::getXPathAndName ( std::string &  sbmlId,
const std::string &  type,
const CModel pModel,
const CDataModel dataModel 
)
static

This function uses the Copasi2SBML map of the datamodel, to resolve the element with the display name provided in the 'sbmlId' parameter. Once the object has been resolved the xpath string will be created for it, and the object sbmlId returned.

Parameters
sbmlIdinput parameter with the displayName of the object sought, will be the output 'sbmlId' if the element cannot be resolved, sbmlId will be set to the empty string
typethe object type of the element
pModelthe model to search through
dataModelthe datamodel to use
Returns
the xpath expression, if resolving worked, an empty string otherwise

References findIdByNameAndType(), removeCharactersFromString(), SEDML_TIME_URN, and splitStrings().

Referenced by getXPathForObject().

◆ getXPathForObject()

std::string SEDMLUtils::getXPathForObject ( const CDataObject object)
static
Parameters
objectthe object to generate an xpath expression for
Returns
the xpath for the object or the empty string if it could not be generated

References CDataModel::getModel(), CDataObject::getObjectDataModel(), CDataObject::getObjectDisplayName(), getSbmlId(), getXPathAndName(), and getXPathForSbmlIdAndType().

Referenced by CSEDMLExporter::exportNthScanItem().

◆ getXPathForObjectAndType()

std::string SEDMLUtils::getXPathForObjectAndType ( const CDataObject object,
const std::string &  sbmlId 
)
static

◆ getXPathForSbmlIdAndType()

std::string SEDMLUtils::getXPathForSbmlIdAndType ( const std::string &  type,
const std::string &  sbmlId 
)
static

Wraps the given sbml id into an xpath expression according to type

Parameters
typeone of 'Concentration', 'InitialConcentration', 'Volume', 'Value', 'Flux'
sbmlidthe sbmlid of the object
Returns
the sbml xpath expression

Referenced by getXPathForObject().

◆ lineTypeFromSed()

int SEDMLUtils::lineTypeFromSed ( int  linetype)
static

◆ lineTypeToSed()

int SEDMLUtils::lineTypeToSed ( int  linetype)
static

◆ removeCharactersFromString()

std::string & SEDMLUtils::removeCharactersFromString ( std::string &  str,
const std::string &  characters 
)
static

◆ resolveDatagenerator()

const CDataObject * SEDMLUtils::resolveDatagenerator ( CModel model,
const SedDataGenerator *  dataReference 
)
static

◆ resolveVariable()

◆ resolveXPath()

const CDataObject * SEDMLUtils::resolveXPath ( const CModel model,
const std::string &  xpath,
bool  initial = false 
)
static

◆ rgbaToArgb()

std::string SEDMLUtils::rgbaToArgb ( const std::string &  rgba,
bool  includeHash = true 
)
static

◆ setLibCombineTempDir()

void SEDMLUtils::setLibCombineTempDir ( )
static

updates the libcombine temp directory to the COPASI temp path

References COptions::getValue().

Referenced by getSedMLStringForArchive().

◆ splitStrings()

void SEDMLUtils::splitStrings ( const std::string &  xpath,
char  delim,
std::vector< std::string > &  stringsContainer 
)
static

This is a hack at the moment better solution for processing XPath string may be developed in the future

Referenced by getXPathAndName(), and translateTargetXpathInSBMLId().

◆ symbolFromSed()

int SEDMLUtils::symbolFromSed ( int  symbol)
static

◆ symbolToSed()

int SEDMLUtils::symbolToSed ( int  symbol)
static

◆ translateTargetXpathInSBMLId()

std::string SEDMLUtils::translateTargetXpathInSBMLId ( const std::string &  xpath,
std::string &  SBMLType 
)
static

Member Data Documentation

◆ COPASI_LINE_STYLE_MAP

std::map< int, int > SEDMLUtils::COPASI_LINE_STYLE_MAP
static
Initial value:
=
{
{(int) CPlotItem::LineStyle::Dashed, SEDML_LINETYPE_DASH},
{(int) CPlotItem::LineStyle::DotDash, SEDML_LINETYPE_DASHDOT},
{(int) CPlotItem::LineStyle::DotDotDash, SEDML_LINETYPE_DASHDOTDOT},
{(int) CPlotItem::LineStyle::Dotted, SEDML_LINETYPE_DOT},
{(int) CPlotItem::LineStyle::None, SEDML_LINETYPE_NONE},
{(int) CPlotItem::LineStyle::Solid, SEDML_LINETYPE_SOLID},
}

Referenced by lineTypeFromSed(), and lineTypeToSed().

◆ COPASI_SYMBOL_MAP

std::map< int, int > SEDMLUtils::COPASI_SYMBOL_MAP
static
Initial value:
=
{
{(int) CPlotItem::SymbolType::Circle, SEDML_MARKERTYPE_CIRCLE},
{(int) CPlotItem::SymbolType::Diamond, SEDML_MARKERTYPE_DIAMOND},
{(int) CPlotItem::SymbolType::hDash, SEDML_MARKERTYPE_HDASH},
{(int) CPlotItem::SymbolType::None, SEDML_MARKERTYPE_NONE},
{(int) CPlotItem::SymbolType::Plus, SEDML_MARKERTYPE_PLUS},
{(int) CPlotItem::SymbolType::LargeCross, SEDML_MARKERTYPE_PLUS},
{(int) CPlotItem::SymbolType::SmallCross, SEDML_MARKERTYPE_PLUS},
{(int) CPlotItem::SymbolType::Square, SEDML_MARKERTYPE_SQUARE},
{(int) CPlotItem::SymbolType::Star, SEDML_MARKERTYPE_STAR},
{(int) CPlotItem::SymbolType::TriangleDown, SEDML_MARKERTYPE_TRIANGLEDOWN},
{(int) CPlotItem::SymbolType::TriangleLeft, SEDML_MARKERTYPE_TRIANGLELEFT},
{(int) CPlotItem::SymbolType::TriangleRight, SEDML_MARKERTYPE_TRIANGLERIGHT},
{(int) CPlotItem::SymbolType::TriangleUp, SEDML_MARKERTYPE_TRIANGLEUP},
{(int) CPlotItem::SymbolType::vDash, SEDML_MARKERTYPE_VDASH},
{(int) CPlotItem::SymbolType::xCross, SEDML_MARKERTYPE_XCROSS}
}

Referenced by symbolFromSed(), and symbolToSed().

◆ PARAMETER_KISAO_MAP

std::map< std::string, std::string > SEDMLUtils::PARAMETER_KISAO_MAP
static
Initial value:
=
{
{"KISAO:0000209", "Relative Tolerance"},
{"KISAO:0000211", "Absolute Tolerance"},
{"KISAO:0000216", "Integrate Reduced Model"},
{"KISAO:0000415", "Max Internal Steps"},
{"KISAO:0000467", "Max Internal Step Size"},
{
"KISAO:0000488",
"Random Seed",
},
{"KISAO:0000228", "Epsilon"},
{"KISAO:0000203", "Lower Limit"},
{"KISAO:0000205", "Partitioning Interval"},
{"KISAO:0000559", "Initial Step Size"},
{"KISAO:0000483", "Runge Kutta Stepsize"},
{"KISAO:0000483", "Internal Steps Size"},
{"KISAO:0000565", "Tolerance for Root Finder"},
{"KISAO:0000567", "Force Physical Correctness"},
}

Referenced by SEDMLImporter::applyAlgorithm(), and CSEDMLExporter::exportAlgorithm().


The documentation for this class was generated from the following files: