COPASI API  4.40.278
CMetabNameInterface Class Reference

#include <CMetabNameInterface.h>

Static Public Member Functions

static std::string createUniqueDisplayName (const CMetab &metab, const bool &quoted)
 
static std::string createUniqueDisplayName (const std::string &metabolite, const std::string &compartment, const bool &quoted)
 
static bool doesExist (const CModel *model, const std::string &metabolite, const std::string &compartment)
 
static std::string getDisplayName (const CModel *model, const CMetab &metab, const bool &quoted)
 
static std::string getDisplayName (const CModel *model, const std::string &key, const bool &quoted)
 
static std::string getDisplayName (const CModel *model, const std::string &metabolite, const std::string &compartment, const bool &quoted)
 
static CMetabgetMetabolite (const CModel *model, const std::string &metabolite, const std::string &compartment)
 
static std::string getMetaboliteKey (const CModel *model, const std::string &metabolite, const std::string &compartment)
 
static std::string getSpeciesCN (const CModel *pModel, const std::string &species, const std::string &compartment)
 
static bool isUnique (const CModel *model, const std::string &name)
 
static std::pair< std::string, std::string > splitDisplayName (const std::string &name)
 
static std::string unQuote (const std::string &displayName)
 

Detailed Description

This class handles the display names of metabolites. It converts "Species" to "Species {Compartment}" if the metabolite name is not unique. If it is unique (that means it occurs in only one compartment) then the "{Compartment}" is not added.

Member Function Documentation

◆ createUniqueDisplayName() [1/2]

std::string CMetabNameInterface::createUniqueDisplayName ( const CMetab metab,
const bool &  quoted 
)
static

Returns the unique display name in the form metabolite{compartment}

Parameters
metabthe metabolite
Returns
the unique display name in the form metabolite{compartment}

References createUniqueDisplayName(), CMetab::getCompartment(), and CDataObject::getObjectName().

◆ createUniqueDisplayName() [2/2]

std::string CMetabNameInterface::createUniqueDisplayName ( const std::string &  metabolite,
const std::string &  compartment,
const bool &  quoted 
)
static

Returns the unique display name in the form metabolite{compartment}

Parameters
metabolitethe metabolite name
compartmentthe compartment name
Returns
the unique display name in the form metabolite{compartment}

References isNumber(), and quote().

Referenced by createUniqueDisplayName(), CDataModel::findObjectByDisplayName(), getDisplayName(), and CChemEqInterface::toDataValue().

◆ doesExist()

bool CMetabNameInterface::doesExist ( const CModel model,
const std::string &  metabolite,
const std::string &  compartment 
)
static

This returns whether a metabolite with the given name does exist. If a compartment is also given (as an appendix to the name) then it only returns true if the metabolite exists in the specified compartment.

References CDataObjectMap::equal_range(), CMetab::getCompartment(), CModel::getMetabolites(), CDataObject::getObjectName(), and CDataContainer::getObjects().

Referenced by getDisplayName(), and CChemEqInterface::listOfNonExistingMetabNames().

◆ getDisplayName() [1/3]

std::string CMetabNameInterface::getDisplayName ( const CModel model,
const CMetab metab,
const bool &  quoted 
)
static

This returns a name to use for display in the GUI. If the name of the metabolite is unique it is used unaltered. If it is not then the compartment is added to the name to make it unique.

References CMetab::getCompartment(), getDisplayName(), and CDataObject::getObjectName().

◆ getDisplayName() [2/3]

std::string CMetabNameInterface::getDisplayName ( const CModel model,
const std::string &  key,
const bool &  quoted 
)
static

◆ getDisplayName() [3/3]

std::string CMetabNameInterface::getDisplayName ( const CModel model,
const std::string &  metabolite,
const std::string &  compartment,
const bool &  quoted 
)
static

This returns a name to use for display in the GUI. If the name of the metabolite is unique it is used unaltered. If it is not then the compartment is added to the name to make it unique.

References createUniqueDisplayName(), doesExist(), CModel::getCompartments(), CDataObject::getObjectName(), isNumber(), isUnique(), quote(), and CDataVector< CType >::size().

◆ getMetabolite()

CMetab * CMetabNameInterface::getMetabolite ( const CModel model,
const std::string &  metabolite,
const std::string &  compartment 
)
static

This tries to find the metabolite with the given name. If the name is not unique and is given without a compartment then the first occurrence of a metabolite with this name is returned.

References C_INVALID_INDEX, CModel::findMetabByName(), CModel::getCompartments(), CDataVectorN< CType >::getIndex(), and CCompartment::getMetabolites().

Referenced by CChemEqInterface::addModifier(), CChemEqInterface::completeCompartments(), getMetaboliteKey(), and CReactionInterface::writeBackToReaction().

◆ getMetaboliteKey()

std::string CMetabNameInterface::getMetaboliteKey ( const CModel model,
const std::string &  metabolite,
const std::string &  compartment 
)
static

◆ getSpeciesCN()

std::string CMetabNameInterface::getSpeciesCN ( const CModel pModel,
const std::string &  species,
const std::string &  compartment 
)
static

Create the CN for the named species in the provided compartment.

Parameters
constCModel * pModel
conststd::string & species
conststd::string & compartment

References CCommonName::escape(), and CDataObject::getCN().

◆ isUnique()

bool CMetabNameInterface::isUnique ( const CModel model,
const std::string &  name 
)
static

◆ splitDisplayName()

◆ unQuote()

std::string CMetabNameInterface::unQuote ( const std::string &  displayName)
static

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