COPASI API  4.40.278
SEDMLImporter Class Reference

#include <SEDMLImporter.h>

Public Member Functions

void addCurveToCopasiPlot (LIBSEDML_CPP_NAMESPACE_QUALIFIER SedAbstractCurve *pCurve, CPlotSpecification *pPlot)
 
void addSurfaceToCopasiPlot (LIBSEDML_CPP_NAMESPACE_QUALIFIER SedSurface *pSurface, CPlotSpecification *pPlot)
 
void applyAlgorithm (CTrajectoryTask *tTask, const SedAlgorithm *alg)
 
void applyStyleToCopasiItem (LIBSEDML_CPP_NAMESPACE_QUALIFIER SedStyle *pStyle, CPlotItem *plItem)
 
void assignReportDefinitions (CDataVectorN< CCopasiTask > *pTaskList=NULL)
 
virtual void clearCallBack ()
 
void clearDocument ()
 
void deleteCopasiModel ()
 
const std::string getArchiveFileName ()
 
CDataModelgetDataModel ()
 
const CProcessReportgetProcessReport () const
 
SedDocument * getSEDMLDocument ()
 
CModelimportFirstSBMLModel ()
 
CModelimportModel (const std::string &modelId)
 
void importOutputs ()
 
void importReport (LIBSEDML_CPP_NAMESPACE_QUALIFIER SedReport *report)
 
void importTask (LIBSEDML_CPP_NAMESPACE_QUALIFIER SedAbstractTask *task, bool importModel=false, CDataVectorN< CCopasiTask > *pTaskList=NULL)
 
void importTasks (CDataVectorN< CCopasiTask > *pTaskList=NULL)
 
void initializeContent ()
 
CModelparseSEDML (const std::string &sedmlDocumentText, CDataModel *pDataModel, const SedmlImportOptions *pOptions=NULL)
 
CModelreadSEDML (std::string filename, CDataModel *pDataModel, const SedmlImportOptions *pOptions=NULL)
 
std::string resolveModelFile (const std::string &modelSource)
 
void restoreFunctionDB ()
 
 SEDMLImporter ()
 
void setCopasiModel (CModel *pModel)
 
void setDataModel (CDataModel *pDataModel)
 
void setImportHandler (CProcessReport *pProcessReport)
 
void setSEDMLDocument (SedDocument *pDocument)
 
void updateContent (CDataModel::CContent &data, CDataModel &dm)
 
void updateCopasiTaskForSimulation (SedSimulation *sedmlsim, CDataVectorN< CCopasiTask > *pTaskList=NULL)
 
 ~SEDMLImporter ()
 

Static Public Member Functions

static LIBSEDML_CPP_NAMESPACE_QUALIFIER SedVectorRange * convertSimpleFunctionalRange (LIBSEDML_CPP_NAMESPACE_QUALIFIER SedFunctionalRange *frange, LIBSEDML_CPP_NAMESPACE_QUALIFIER SedRepeatedTask *repeat)
 

Static Protected Member Functions

static C_FLOAT64 round (const C_FLOAT64 &x)
 

Protected Attributes

std::string mArchiveFileName
 
CDataModel::CContent mContent
 
size_t mhImportStep
 
std::set< unsigned int > mIgnoredSEDMLMessages
 
std::string mImportedModel
 
unsigned C_INT32 mImportStep
 
bool mIncompleteModel
 
unsigned int mLevel
 
unsigned int mOriginalLevel
 
CModelmpCopasiModel
 
CDataModelmpDataModel
 
const SedmlImportOptionsmpOptions
 
CProcessReportmpProcessReport
 
SedDocument * mpSEDMLDocument
 
std::map< CReportDefinition *, std::pair< std::string, std::string > > mReportMap
 
unsigned C_INT32 mTotalSteps
 
std::set< std::string > mUsedSEDMLIds
 
bool mUsedSEDMLIdsPopulated
 
unsigned int mVersion
 

Private Member Functions

void mergeNestedSubtasks ()
 

Constructor & Destructor Documentation

◆ SEDMLImporter()

SEDMLImporter::SEDMLImporter ( )

Constructor that initializes speciesMap and the FunctionDB object

References mIgnoredSEDMLMessages.

◆ ~SEDMLImporter()

SEDMLImporter::~SEDMLImporter ( )

Destructor that does nothing.

References mReportMap.

Member Function Documentation

◆ addCurveToCopasiPlot()

void SEDMLImporter::addCurveToCopasiPlot ( LIBSEDML_CPP_NAMESPACE_QUALIFIER SedAbstractCurve *  pCurve,
CPlotSpecification pPlot 
)

adds the given SED-ML curve to the COPASI plot, if supported

prior to calling this function, please ensure to have the the document and model set already.

Parameters
pCurvethe SED-ML curve, that may include a style
pPlotthe COPASI plot specification to add the curve to

References CPlotItem::addChannel(), applyStyleToCopasiItem(), CPlotItem::bandedGraph, CPlotSpecification::createItem(), CPlotItem::curve2d, CDataObject::getCN(), CDataObject::getObjectDisplayName(), CPlotSpecification::hasItem(), mpCopasiModel, mpSEDMLDocument, SEDMLUtils::resolveDatagenerator(), CPlotSpecification::setLogX(), CPlotSpecification::setLogY(), CCopasiParameterGroup::setValue(), and CCopasiMessage::WARNING.

Referenced by importOutputs().

◆ addSurfaceToCopasiPlot()

void SEDMLImporter::addSurfaceToCopasiPlot ( LIBSEDML_CPP_NAMESPACE_QUALIFIER SedSurface *  pSurface,
CPlotSpecification pPlot 
)

adds the given SED-ML surface to the COPASI plot, if supported

prior to calling this function, please ensure to have the the document and model set already.

Parameters
pSurfacethe SED-ML surface, that may include a style
pPlotthe COPASI plot specification to add the curve to

References CPlotItem::addChannel(), applyStyleToCopasiItem(), CPlotSpecification::createItem(), CDataObject::getCN(), CDataObject::getObjectDisplayName(), CPlotSpecification::hasItem(), mpCopasiModel, mpSEDMLDocument, SEDMLUtils::resolveDatagenerator(), CPlotSpecification::setLogX(), CPlotSpecification::setLogY(), CCopasiParameterGroup::setValue(), CPlotItem::spectogram, and CCopasiMessage::WARNING.

Referenced by importOutputs().

◆ applyAlgorithm()

◆ applyStyleToCopasiItem()

void SEDMLImporter::applyStyleToCopasiItem ( LIBSEDML_CPP_NAMESPACE_QUALIFIER SedStyle *  pStyle,
CPlotItem plItem 
)

applies the given style to a plot item

prior to calling this function, please ensure to have the the document and model set already.

Parameters
pStylethe SED-ML Style to apply
plItemthe copasi plot item

References CCopasiParameterGroup::assertParameter(), C_FLOAT64, C_INT32, SEDMLUtils::getAlphaFromRgba(), CCopasiParameter::INT, CPlotItem::Lines, CPlotItem::LinesAndSymbols, SEDMLUtils::lineTypeFromSed(), mpSEDMLDocument, SEDMLUtils::rgbaToArgb(), CCopasiParameterGroup::setValue(), SEDMLUtils::symbolFromSed(), and CPlotItem::Symbols.

Referenced by addCurveToCopasiPlot(), and addSurfaceToCopasiPlot().

◆ assignReportDefinitions()

◆ clearCallBack()

void SEDMLImporter::clearCallBack ( )
virtual

clears the currently set progress handler

References setImportHandler().

◆ clearDocument()

void SEDMLImporter::clearDocument ( )

frees the current SED-ML document

References mpSEDMLDocument, and pdelete.

◆ convertSimpleFunctionalRange()

SedVectorRange * SEDMLImporter::convertSimpleFunctionalRange ( LIBSEDML_CPP_NAMESPACE_QUALIFIER SedFunctionalRange *  frange,
LIBSEDML_CPP_NAMESPACE_QUALIFIER SedRepeatedTask *  repeat 
)
static

Utility function trying to convert the given Functional Range into a Vector Range

Only functional ranges that are simple transformation of another vector range are currently supported.

Parameters
frangethe functional range to convert
repeatthe repeated task worked on
Returns
the newly created VectorRange or NULL

References pdelete, and CCopasiMessage::WARNING.

Referenced by importTask().

◆ deleteCopasiModel()

void SEDMLImporter::deleteCopasiModel ( )

This call deletes an existing COPASI model. The method can e.g. be called to clean up if an import fails.

References mpCopasiModel, and pdelete.

Referenced by CDataModel::importSEDML(), and CDataModel::importSEDMLFromString().

◆ getArchiveFileName()

const std::string SEDMLImporter::getArchiveFileName ( )

References mArchiveFileName.

◆ getDataModel()

CDataModel * SEDMLImporter::getDataModel ( )
Returns
the current datamodel

References mpDataModel.

◆ getProcessReport()

const CProcessReport * SEDMLImporter::getProcessReport ( ) const
Returns
the progress handler set

References mpProcessReport.

◆ getSEDMLDocument()

SedDocument * SEDMLImporter::getSEDMLDocument ( )
Returns
the current SED-ML document

References mpSEDMLDocument.

◆ importFirstSBMLModel()

CModel * SEDMLImporter::importFirstSBMLModel ( )

Imports the first viable SBML model

References CCopasiMessage::EXCEPTION, importModel(), MCSEDML, mpSEDMLDocument, and CCopasiMessage::WARNING.

Referenced by parseSEDML().

◆ importModel()

◆ importOutputs()

◆ importReport()

void SEDMLImporter::importReport ( LIBSEDML_CPP_NAMESPACE_QUALIFIER SedReport *  report)

◆ importTask()

◆ importTasks()

void SEDMLImporter::importTasks ( CDataVectorN< CCopasiTask > *  pTaskList = NULL)

Import all tasks for the imported SBML model

References importTask(), mContent, mpSEDMLDocument, and CDataModel::CContent::pTaskList.

Referenced by parseSEDML().

◆ initializeContent()

void SEDMLImporter::initializeContent ( )

◆ mergeNestedSubtasks()

void SEDMLImporter::mergeNestedSubtasks ( )
private

merge nested subtasks if needed (as that is really the only way COPASI can handle them. So if we have

repeatedTask1: subtask simulationTask1 repeatedTask2: subtask repeatedTask1 repeatedTask3: subtask repeatedTask2 repeatedTask4: subtask repeatedTask3

we move all the ranges changes from 3 to 4, then from 2 to 4, then 1 to 4 that way we preserve the order of scan items.

References mpSEDMLDocument.

Referenced by parseSEDML().

◆ parseSEDML()

◆ readSEDML()

CModel * SEDMLImporter::readSEDML ( std::string  filename,
CDataModel pDataModel,
const SedmlImportOptions pOptions = NULL 
)

Function reads an SEDML file with libsedml and converts it to a Copasi CModel

References CCopasiMessage::EXCEPTION, CLocaleString::fromUtf8(), MCSEDML, parseSEDML(), and CDataModel::setSEDMLFileName().

Referenced by CDataModel::importSEDML().

◆ resolveModelFile()

std::string SEDMLImporter::resolveModelFile ( const std::string &  modelSource)

◆ restoreFunctionDB()

void SEDMLImporter::restoreFunctionDB ( )

◆ round()

C_FLOAT64 SEDMLImporter::round ( const C_FLOAT64 x)
staticprotected

SEDMLImporter.cpp $Rev: $: Revision of last commit

Author

: Author of last commit

Date

: Date of last commit $HeadURL: $

Id

◆ setCopasiModel()

void SEDMLImporter::setCopasiModel ( CModel pModel)

Sets the copasi model to use (for time and object references)

Parameters
pModelthe model

References mpCopasiModel.

◆ setDataModel()

void SEDMLImporter::setDataModel ( CDataModel pDataModel)

sets the data model to be used by the importer

References mpDataModel.

◆ setImportHandler()

void SEDMLImporter::setImportHandler ( CProcessReport pProcessReport)

sets a progress handler to inform about updates

References mpProcessReport.

Referenced by clearCallBack(), CDataModel::importSEDML(), and CDataModel::importSEDMLFromString().

◆ setSEDMLDocument()

void SEDMLImporter::setSEDMLDocument ( SedDocument *  pDocument)

sets the sed-ml document that will be used by the importer

(the document will not be automatically deleted) manually call clearDocument to delete the existing document

References mLevel, mOriginalLevel, mpSEDMLDocument, and mVersion.

Referenced by parseSEDML().

◆ updateContent()

◆ updateCopasiTaskForSimulation()

Member Data Documentation

◆ mArchiveFileName

std::string SEDMLImporter::mArchiveFileName
protected

Referenced by getArchiveFileName().

◆ mContent

◆ mhImportStep

size_t SEDMLImporter::mhImportStep
protected

Referenced by parseSEDML().

◆ mIgnoredSEDMLMessages

std::set<unsigned int> SEDMLImporter::mIgnoredSEDMLMessages
protected

Referenced by parseSEDML(), and SEDMLImporter().

◆ mImportedModel

std::string SEDMLImporter::mImportedModel
protected

Referenced by importModel(), and importTask().

◆ mImportStep

unsigned C_INT32 SEDMLImporter::mImportStep
protected

Referenced by parseSEDML().

◆ mIncompleteModel

bool SEDMLImporter::mIncompleteModel
protected

◆ mLevel

unsigned int SEDMLImporter::mLevel
protected

Referenced by setSEDMLDocument().

◆ mOriginalLevel

unsigned int SEDMLImporter::mOriginalLevel
protected

Referenced by setSEDMLDocument().

◆ mpCopasiModel

◆ mpDataModel

CDataModel* SEDMLImporter::mpDataModel
protected

◆ mpOptions

const SedmlImportOptions* SEDMLImporter::mpOptions
protected

◆ mpProcessReport

CProcessReport* SEDMLImporter::mpProcessReport
protected

◆ mpSEDMLDocument

◆ mReportMap

std::map<CReportDefinition*, std::pair< std::string, std::string > > SEDMLImporter::mReportMap
protected

◆ mTotalSteps

unsigned C_INT32 SEDMLImporter::mTotalSteps
protected

Referenced by parseSEDML().

◆ mUsedSEDMLIds

std::set<std::string> SEDMLImporter::mUsedSEDMLIds
protected

◆ mUsedSEDMLIdsPopulated

bool SEDMLImporter::mUsedSEDMLIdsPopulated
protected

Referenced by parseSEDML().

◆ mVersion

unsigned int SEDMLImporter::mVersion
protected

Referenced by setSEDMLDocument().


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