#include <transformationSet.hh>
This class is one of the core pieces of a ReactionClass. It maintains the set of Transformation objects for each of the reactants in the ReactionClass. Therefore, it knows about the TemplateMolecules of the ReactionClass; it knows how to generate MappingSet objects for the ReactantLists; it knows how to create MappingGenerator objects for TemplateMolecules; it knows how to execute the set of Transformations; and finally, it knows how to generate the list of product molecules that are generated from firing a reaction rule. To use this class, first create your TemplateMolecule objects for your ReactionClass. Create a TransformationSet from the TemplateMolecule vector (the vector should be created such that each element of the vector is a reactant in the ReactionClass). Add as many Transformations to the set as you like using the TransformationSet static functions. Finally, call the finalize() function to finish setting upt the TransformationSet. Then you can use this TransformationSet to create a ReactionClass with ease. Really, this is all easier than it sounds! (see simple_system.hh and simple_system.cpp )
Public Member Functions | |
TransformationSet (vector< TemplateMolecule * > reactantTemplates) | |
~TransformationSet () | |
int | getNumOfReactants () const |
bool | addStateChangeTransform (TemplateMolecule *t, string cName, int finalStateValue) |
bool | addStateChangeTransform (TemplateMolecule *t, string cName, string finalStateValue) |
bool | addIncrementStateTransform (TemplateMolecule *t, string cName) |
bool | addDecrementStateTransform (TemplateMolecule *t, string cName) |
bool | addBindingTransform (TemplateMolecule *t1, string bSiteName1, TemplateMolecule *t2, string bSiteName2) |
bool | addBindingSeparateComplexTransform (TemplateMolecule *t1, string bSiteName1, TemplateMolecule *t2, string bSiteName2) |
bool | addUnbindingTransform (TemplateMolecule *t, string bSiteName, TemplateMolecule *t2, string bSiteName2) |
bool | addDeleteMolecule (TemplateMolecule *t, int deletionType) |
bool | addAddMolecule (SpeciesCreator *sc) |
bool | addLocalFunctionReference (TemplateMolecule *t, string PointerName, int scope) |
bool | transform (MappingSet **mappingSets) |
MappingSet * | generateBlankMappingSet (unsigned int reactantIndex, unsigned int mappingSetId) |
TemplateMolecule * | getTemplateMolecule (unsigned int reactantIndex) const |
unsigned int | getNreactants () const |
void | finalize () |
bool | isFinalized () const |
bool | getListOfProducts (MappingSet **mappingSets, list< Molecule * > &products, int traversalLimit) |
bool | hasSymUnbindingTransform () const |
bool | hasSymBindingTransform () const |
int | getNumOfTransformations (int reactantIndex) const |
Transformation * | getTransformation (int reactantIndex, int index) const |
Protected Member Functions | |
int | find (TemplateMolecule *t) |
Protected Attributes | |
bool | finalized |
unsigned int | n_reactants |
TemplateMolecule ** | reactants |
vector< Transformation * > * | transformations |
vector< Transformation * > | addMoleculeTransformations |
bool | hasSymUnbinding |
bool | hasSymBinding |
Static Protected Attributes | |
static list< Molecule * > | deleteList |
static list< Molecule * > | updateAfterDeleteList |
static list< Molecule * >::iterator | it |
TransformationSet::TransformationSet | ( | vector< TemplateMolecule * > | reactantTemplates | ) |
Creates a new TransformationSet from the given vector of TemplateMolecules. This takes care of setting everything up in the TemplateMolecules (such as adding MappingGenerators). Be sure to call finalize() before using this in a ReactionClass!
TransformationSet::~TransformationSet | ( | ) |
Destroys the TransformationSet and associated Transformation objects.
int NFcore::TransformationSet::getNumOfReactants | ( | ) | const [inline] |
bool TransformationSet::addStateChangeTransform | ( | TemplateMolecule * | t, | |
string | cName, | |||
int | finalStateValue | |||
) |
Adds a state change transformation on the given TemplateMolecule (that must have been included in the original vector of TemplateMolecules) along with the stateName and final value of the state to be transformed.
bool TransformationSet::addStateChangeTransform | ( | TemplateMolecule * | t, | |
string | cName, | |||
string | finalStateValue | |||
) |
Adds a state change transformation on the given TemplateMolecule (that must have been included in the original vector of TemplateMolecules) along with the stateName and final value of the state to be transformed.
bool TransformationSet::addIncrementStateTransform | ( | TemplateMolecule * | t, | |
string | cName | |||
) |
Adds an increment state change to the given templateMolecule
bool TransformationSet::addDecrementStateTransform | ( | TemplateMolecule * | t, | |
string | cName | |||
) |
Adds an decrement state change to the given templateMolecule
bool TransformationSet::addBindingTransform | ( | TemplateMolecule * | t1, | |
string | bSiteName1, | |||
TemplateMolecule * | t2, | |||
string | bSiteName2 | |||
) |
Adds a binding reaction between the two given TemplateMolecules at the specified binding sites.
bool TransformationSet::addBindingSeparateComplexTransform | ( | TemplateMolecule * | t1, | |
string | bSiteName1, | |||
TemplateMolecule * | t2, | |||
string | bSiteName2 | |||
) |
Adds a binding reaction between the two given TemplateMolecules at the specified binding sites with the constraint that the two molecules are not connected. Note: This only stops the binding transform! It does not prevent the entire reaction! That is not programmed in yet!
bool TransformationSet::addUnbindingTransform | ( | TemplateMolecule * | t, | |
string | bSiteName, | |||
TemplateMolecule * | t2, | |||
string | bSiteName2 | |||
) |
Adds an unbinding reaction at the given site of the given TemplateMolecule
bool TransformationSet::addDeleteMolecule | ( | TemplateMolecule * | t, | |
int | deletionType | |||
) |
Adds a delete rule to the given TemplateMolecule. This has not been implemented yet, so it may take other parameters.
Adds a delete rule to the given TemplateMolecule.bool TransformationSet::addAddMolecule | ( | SpeciesCreator * | sc | ) |
Adds a create molecule rule, but has not been implemented yet.
bool TransformationSet::addLocalFunctionReference | ( | TemplateMolecule * | t, | |
string | PointerName, | |||
int | scope | |||
) |
Adds a create molecule rule, but has not been implemented yet.
bool TransformationSet::transform | ( | MappingSet ** | mappingSets | ) |
Call this (in a ReactionClass) to transform the array of MappingSets (one MappingSet per reactant in the correct position in the array, please!).
MappingSet * TransformationSet::generateBlankMappingSet | ( | unsigned int | reactantIndex, | |
unsigned int | mappingSetId | |||
) |
Generates a blank MappingSet (blank in the sense that it is not mapped to any Molecules yet) from the list of Transformations. This function is called by ReactantList and ReactantTree to populate the lists of MappingSets that are created at the beginning of a simulation.
TemplateMolecule* NFcore::TransformationSet::getTemplateMolecule | ( | unsigned int | reactantIndex | ) | const [inline] |
Returns the TemplateMolecule of a given reactant. This function is primarily used for initial initializations of a ReactionClass.
unsigned int NFcore::TransformationSet::getNreactants | ( | ) | const [inline] |
Get the number of reactants in the rule governed by this TransformationSet. This function is really only used for initial initializations of a ReactionClass.
void TransformationSet::finalize | ( | ) |
This function sets up the actual array of Transformation objects for this TransformationSet and makes sure that no one adds additional Transformations once this TransformationSet is in use. TransformationSets also do not allow you to do certain things (like add it to a ReactionClass) until the Set is finalized by a call to this function.
bool NFcore::TransformationSet::isFinalized | ( | ) | const [inline] |
Check whether or not the finalize() function has been called.
bool TransformationSet::getListOfProducts | ( | MappingSet ** | mappingSets, | |
list< Molecule * > & | products, | |||
int | traversalLimit | |||
) |
From an array of MappingSet objects, this function populates the list of Molecules with all the Molecules that can be affected by this Transformation. The traversalLimit parameters sets the depth at which the Molecules should be searched (starting at the original TemplateMolecules given in the initial vector of TemplateMolecules). So giving a value of 1 will only give you the immediate reactant Molecules. Setting this to two will explore down one level of bonds, and so on.
bool NFcore::TransformationSet::hasSymUnbindingTransform | ( | ) | const [inline] |
Called by reaction class to determine if the rate of a rule must be adjusted to account for a symmetric unbinding event. Symmetry of the rule is checked when you add an unbinding transform.
bool NFcore::TransformationSet::hasSymBindingTransform | ( | ) | const [inline] |
Called by reaction class to determine if the rate of a rule must be adjusted to account for a symmetric binding event. Symmetry of the rule is checked when you add a binding transform.
int NFcore::TransformationSet::getNumOfTransformations | ( | int | reactantIndex | ) | const [inline] |
Returns the number of transformations that the template at reactantIndex given has.
Transformation* NFcore::TransformationSet::getTransformation | ( | int | reactantIndex, | |
int | index | |||
) | const [inline] |
Returns the transformation object at the given index for the given reactant position
int TransformationSet::find | ( | TemplateMolecule * | t | ) | [protected] |
Used for error checking when setting up a TransformationSet. This finds a TemplateMolecule in the TemplateMolecule vector given in the constructor and finds the reactant index under which it was found. This makes sure a particular TemplateMolecule that you are trying to add a transformation to exists and does not exist in multiple places.
bool NFcore::TransformationSet::finalized [protected] |
Remembers if the finalize function has been called
unsigned int NFcore::TransformationSet::n_reactants [protected] |
Keeps track of the number of reactants in the rule monitored by this TransformationSet
TemplateMolecule** NFcore::TransformationSet::reactants [protected] |
The array of TemplateMolecules that represent the reactants
vector<Transformation *>* NFcore::TransformationSet::transformations [protected] |
A vector that holds the actual Transformation objects
vector<Transformation *> NFcore::TransformationSet::addMoleculeTransformations [protected] |
A vector that holds the addMolecule Transformations, because they are handled separately
list< Molecule * > TransformationSet::deleteList [static, protected] |
List to keep track of the molecules that we are going to delete when a transformation is applied
list< Molecule * > TransformationSet::updateAfterDeleteList [static, protected] |
List to keep track of the molecules that we have to update as a result of a deletion
list< Molecule * >::iterator TransformationSet::it [static, protected] |
iterator for the deleteList and updateAfterDeleteList
bool NFcore::TransformationSet::hasSymUnbinding [protected] |
keeps track if this set has a symmetric unbinding reaction
bool NFcore::TransformationSet::hasSymBinding [protected] |
keeps track if this set has a symmetric binding reaction