libSBML C API  5.18.0
FbcAssociation_t Class Reference

Detailed Description

fbc Base class for FbcAnd_t, FbcOr_t, and GeneProductRef_t

The FbcAssociation_t class is the abstract base class for the classes that can be used as children of the GeneProductAssociation_t child of a Reaction_t. The FbcAnd_t class is used when all of its children are definitely associated with the Reaction_t; the FbcOr_t class is used when at least one of its children are associated with the Reaction_t; and the GeneProductRef_t class is used to denote a particular GeneProduct_t.

Note
This class of objects was introduced in Version 2 of the SBML Level 3 Flux Balance Constraints (“fbc”) specification. In Version 1 of “fbc”, the information encoded by this class can be stored instead using the Association_t and GeneAssociation_t annotation classes. Please see the Version 1 and Version 2 “fbc” specifications for more details.
See also
ListOfFbcAssociations_t
FbcAnd_t
FbcOr_t
GeneProductRef_t

Public Member Functions

FbcAssociation_tFbcAssociation_clone (FbcAssociation_t *fa)
 Creates a deep copy of the given FbcAssociation_t structure. More...
 
FbcAssociation_tFbcAssociation_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new FbcAssociation_t structure using the given SBML level and version, and the pkgVersion package version. More...
 
void FbcAssociation_free (FbcAssociation_t *fa)
 Frees the given FbcAssociation_t structure. More...
 
int FbcAssociation_hasRequiredAttributes (const FbcAssociation_t *fa)
 Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes of the given FbcAssociation_t structure have been set. More...
 
FbcAssociation_tFbcAssociation_parseFbcInfixAssociation (const char *infix, SBasePlugin_t *plugin)
 Parses a gene association in infix format and returns a corresponding Association_t object. More...
 
char * FbcAssociation_toInfix (const FbcAssociation_t *fa)
 Converts this FbcAssociation_t into an infix string representation. More...
 

Member Function Documentation

FbcAssociation_t * FbcAssociation_clone ( FbcAssociation_t fa)

Creates a deep copy of the given FbcAssociation_t structure.

Parameters
fathe FbcAssociation_t structure to be copied.
Returns
a (deep) copy of the given FbcAssociation_t structure, or a null pointer if a failure occurred.
FbcAssociation_t * FbcAssociation_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new FbcAssociation_t structure using the given SBML level and version, and the pkgVersion package version.

Parameters
levelan unsigned int, the SBML level to assign to this FbcAssociation_t structure.
versionan unsigned int, the SBML version to assign to this FbcAssociation_t structure.
pkgVersionan unsigned int, the version of the package to assign to this FbcAssociation_t structure.
Returns
the newly-created FbcAssociation_t structure, or a null pointer if an error occurred during construction.
Note
Attempting to add an object to an SBMLDocument_t having a different combination of SBML Level, Version and XML namespaces than the object itself will result in an error at the time a caller attempts to make the addition. A parent object must have compatible Level, Version and XML namespaces. (Strictly speaking, a parent may also have more XML namespaces than a child, but the reverse is not permitted.) The restriction is necessary to ensure that an SBML model has a consistent overall structure. This requires callers to manage their objects carefully, but the benefit is increased flexibility in how models can be created by permitting callers to create objects bottom-up if desired. In situations where objects are not yet attached to parents (e.g., SBMLDocument_t), knowledge of the intented SBML Level and Version help libSBML determine such things as whether it is valid to assign a particular value to an attribute.
void FbcAssociation_free ( FbcAssociation_t fa)

Frees the given FbcAssociation_t structure.

Parameters
fathe FbcAssociation_t structure to be freed.
int FbcAssociation_hasRequiredAttributes ( const FbcAssociation_t fa)

Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes of the given FbcAssociation_t structure have been set.

Parameters
fathe FbcAssociation_t structure to check.
Returns
1 (true) if all the required attributes for this structure have been defined, 0 (false) otherwise.
FbcAssociation_t * FbcAssociation_parseFbcInfixAssociation ( const char *  infix,
SBasePlugin_t plugin 
)

Parses a gene association in infix format and returns a corresponding Association_t object.

This parses a string that has a list of gene names and conjunctions or disjunctions. For example:

 (b2422) and (b2425) and (b2423) and (b2424) or (b2422) and (b2423) and (b2424) and (b2413) and (b3917)

The 'and' operator takes precedence over the 'or' operator, meaning that the above input string would turn into two groups of gene names: either "b2422, b2425, b2423, and b2424" or "b2422, b2423, b2424, b2413, and b3917". Parentheses may be added to make things more clear, and to encode alternative schemes.

This method also creates missing GeneProduct_t objects, in case the unique reference does not yet exist.

Note that the function assumes that the infix contains identifiers and not labels, and that any missing geneProducts are to be added.

Parameters
infixthe string to parse.
pluginthe FbcModelPlugin_t on which to add the geneProduct elements.
Returns
the parsed association, or NULL in case of an error.
char * FbcAssociation_toInfix ( const FbcAssociation_t fa)

Converts this FbcAssociation_t into an infix string representation.

Parameters
fathe FbcAssociation_t structure to convert.
Returns
the association as infix string.