60 #ifndef ANTIMONY_API_H
61 #define ANTIMONY_API_H
63 #ifndef LIBANTIMONY_VERSION_STRING //Should be defined in the makefile (from CMakeLists.txt)
64 #define LIBANTIMONY_VERSION_STRING "v2.8.0"
86 LIB_EXTERN
long loadFile(
const char* filename);
207 LIB_EXTERN
bool revertTo(
long index);
249 LIB_EXTERN
int writeSBMLFile(
const char* filename,
const char* moduleName);
283 LIB_EXTERN
int writeCellMLFile(
const char* filename,
const char* moduleName);
318 LIB_EXTERN
bool checkModule(
const char* moduleName);
467 LIB_EXTERN
char*
getNthFormerSymbolNameBetween(
const char* moduleName,
const char* formerSubmodName,
const char* replacementSubmodName,
unsigned long n);
627 LIB_EXTERN
unsigned long getNumReactants(
const char* moduleName,
unsigned long rxn);
632 LIB_EXTERN
unsigned long getNumProducts(
const char* moduleName,
unsigned long rxn);
710 LIB_EXTERN
unsigned long getNumInteractors(
const char* moduleName,
unsigned long rxn);
715 LIB_EXTERN
unsigned long getNumInteractees(
const char* moduleName,
unsigned long rxn);
815 LIB_EXTERN
unsigned long getNumEvents(
const char* moduleName);
825 LIB_EXTERN
char*
getNthEventName(
const char* moduleName,
unsigned long event);
840 LIB_EXTERN
char*
getDelayForEvent(
const char* moduleName,
unsigned long event);
845 LIB_EXTERN
bool getEventHasDelay(
const char* moduleName,
unsigned long event);
865 LIB_EXTERN
bool getT0ForEvent(
const char* moduleName,
unsigned long event);
912 LIB_EXTERN
char**
getNthDNAStrand(
const char* moduleName,
unsigned long n);
985 #endif //ANTIMONY_API_H
LIB_EXTERN char ** getNthModularDNAStrand(const char *moduleName, unsigned long n)
Returns an array of names of the components in the nth modular DNA strand in the given module...
LIB_EXTERN char * getWarnings()
When translating some other format to Antimony, elements that are unable to be translated are saved a...
LIB_EXTERN unsigned long getNumReactions(const char *moduleName)
Returns the number of reactions (including genes) in the named module.
LIB_EXTERN char * getNthSymbolDisplayNameOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the 'display name' of the Nth symbol of the given type.
LIB_EXTERN char * getNthInteractionMthInteractorName(const char *modulename, unsigned long interaction, unsigned long interactor)
Returns the Mth interactor names for the given interaction.
LIB_EXTERN long loadAntimonyString(const char *model)
Loads a string and parses it as an Antimony set of modules.
LIB_EXTERN char * getSBMLString(const char *moduleName)
Returns the same output as writeSBMLFile, but to a char* array instead of to a file.
LIB_EXTERN char ** getNthReactionProductNames(const char *modulename, unsigned long rxn)
Returns an array of all the product names for the given reaction.
LIB_EXTERN rd_type * getInteractionDividers(const char *moduleName)
Returns an array of all the interaction dividers in the given module.
LIB_EXTERN bool getEventHasPriority(const char *moduleName, unsigned long event)
Returns 'true' if the given event has a priority; 'false' otherwise.
LIB_EXTERN unsigned long getNumFiles()
Returns the number of files loaded into memory so far.
LIB_EXTERN char * getNthReplacementSymbolName(const char *moduleName, unsigned long n)
Returns the Nth replacement symbol name of a symbol that has replaced a different symbol in the given...
LIB_EXTERN unsigned long getStoichiometryMatrixNumRows(const char *moduleName)
The number of rows in the stoichiometry matrix (or, the number of 'varSpecies').
LIB_EXTERN char * getMainModuleName()
Returns the 'main' module name.
LIB_EXTERN char ** getSymbolNamesOfType(const char *moduleName, return_type rtype)
Returns the names of the symbols of the given return type.
LIB_EXTERN int writeSBMLFile(const char *filename, const char *moduleName)
Writes out a SBML-formatted XML file to the file indicated.
LIB_EXTERN long loadSBMLFile(const char *filename)
Load a file known to be SBML.
LIB_EXTERN unsigned long getSizeOfNthDNAStrand(const char *moduleName, unsigned long n)
Returns just the size (in number of components) of the nth DNA strand in the given module...
LIB_EXTERN void setBareNumbersAreDimensionless(bool dimensionless)
Sets whether bare numbers are dimensionless or undefined.
LIB_EXTERN char * getNthFormerSymbolNameBetween(const char *moduleName, const char *formerSubmodName, const char *replacementSubmodName, unsigned long n)
Returns the Nth symbol name that has been replaced by a new symbol name in the given module...
LIB_EXTERN long loadSBMLString(const char *model)
Load a string known to be SBML.
LIB_EXTERN long loadFile(const char *filename)
Load a file of any format libAntimony knows about (potentially Antimony, SBML, or CellML)...
LIB_EXTERN char * getCompSBMLString(const char *moduleName)
Returns the same output as writeSBMLFile, but to a char* array instead of to a file, using the 'Hierarchichal Model Composition' package.
LIB_EXTERN char ** getNthReplacementSymbolPairBetween(const char *moduleName, const char *formerSubmodName, const char *replacementSubmodName, unsigned long n)
Returns the Nth pair of symbol names that have been synchronized with each other–the first the symbol...
LIB_EXTERN char * getAntimonyString(const char *moduleName)
Returns the same output as writeAntimonyFile, but to a char* array instead of to a file...
LIB_EXTERN double ** getStoichiometryMatrix(const char *moduleName)
Returns an N x M stoichiometry matrix where N is the number of reactions in the model, and M is the number of variable species (or 'floating species').
LIB_EXTERN double * getNthReactionProductStoichiometries(const char *moduleName, unsigned long rxn)
Returns an array of the stoichiometries for the products of the Nth reaction in the module...
LIB_EXTERN unsigned long getNumEvents(const char *moduleName)
Returns the number of events in the given module.
LIB_EXTERN bool getIsNthDNAStrandOpen(const char *moduleName, unsigned long n, bool upstream)
Returns whether the given DNA strand was defined to be 'open' (that is, have an attachable end) at th...
LIB_EXTERN char ** getModuleNames()
Returns an array of all the current module names.
LIB_EXTERN unsigned long getNumDNAStrands(const char *moduleName)
Returns the number of unique DNA strands in the module, as defined in the Antimony documentation (or...
LIB_EXTERN long loadSBMLStringWithLocation(const char *model, const char *location)
Load a string known to be SBML with its file location.
LIB_EXTERN double * getNthReactionReactantStoichiometries(const char *moduleName, unsigned long rxn)
Returns an array of the stoichiometries for the reactants of the Nth reaction in the module...
LIB_EXTERN char * getLastError()
When any function returns an error condition, a longer description of the problem is stored in memory...
LIB_EXTERN unsigned long getNumModularDNAStrands(const char *moduleName)
Returns the sizes (in number of components) of all modular (separately-defined) DNA strands...
LIB_EXTERN char ** getNthInteractionInteracteeNames(const char *modulename, unsigned long rxn)
Returns an array of all the interactee names for the given interaction.
LIB_EXTERN int writeCellMLFile(const char *filename, const char *moduleName)
Writes out a CellML-formatted XML file to the file indicated, retaining the same Antimony hierarchy u...
LIB_EXTERN char ** getNthReplacementSymbolPair(const char *moduleName, unsigned long n)
Returns the Nth pair of symbol names that have been synchronized with each other–the first the symbol...
LIB_EXTERN long loadString(const char *model)
Load a string of any format libAntimony knows about (potentially Antimony, SBML, or CellML)...
LIB_EXTERN char *** getInteractorNames(const char *moduleName)
Returns all the interactor names for all interactions in the given module.
LIB_EXTERN char ** getNthInteractionInteractorNames(const char *modulename, unsigned long rxn)
Returns an array of all the interactor names for the given interaction.
LIB_EXTERN return_type getTypeOfSymbol(const char *moduleName, const char *symbolName)
Returns the most specific return type available for the given symbolName.
LIB_EXTERN char ** getSymbolDisplayNamesOfType(const char *moduleName, return_type rtype)
Returns the 'display names' of the symbols of the given return type.
LIB_EXTERN char ** getSymbolNamesInInterfaceOf(const char *moduleName)
Returns the names of the symbols defined to be in the interface of the given module.
LIB_EXTERN char ** getEventNames(const char *moduleName)
Returns the names of the events in the module.
LIB_EXTERN char * getNthSymbolNameInInterfaceOf(const char *moduleName, unsigned long n)
Returns the Nth symbol name defined to be in the interface of the given module.
LIB_EXTERN formula_type getTypeOfEquationForSymbol(const char *moduleName, const char *symbolName)
Returns the type of the 'main' equation associated with the given symbolName.
LIB_EXTERN bool getIsNthModularDNAStrandOpen(const char *moduleName, unsigned long n, bool upstream)
Returns whether the given modular DNA strand was defined to be 'open' (that is, have an attachable en...
LIB_EXTERN char * getNthEventName(const char *moduleName, unsigned long event)
Returns the name of the nth event in the module.
LIB_EXTERN bool checkModule(const char *moduleName)
Returns 'true' if the submitted module name exists in the current active set, 'false' if not...
LIB_EXTERN double ** getReactantStoichiometries(const char *moduleName)
Returns a two-dimensional array of the stoichiometries for all reactants in all reactions in the give...
LIB_EXTERN char ** getReactionRates(const char *moduleName)
Returns an array of the reaction rates for the given module.
LIB_EXTERN char ** getSymbolRateRulesOfType(const char *moduleName, return_type rtype)
Returns the equations associated with the rate rule for symbols of the given return type...
LIB_EXTERN char * getNthReactionRate(const char *moduleName, unsigned long rxn)
Returns the reaction rate for the Nth reaction in the module.
LIB_EXTERN unsigned long getStoichiometryMatrixNumColumns(const char *moduleName)
The number of columns in the stoichiometry matrix (or, the number of 'allReactions').
LIB_EXTERN unsigned long * getModularDNAStrandSizes(const char *moduleName)
Returns an array of Modular DNA strand sizes for the given module.
LIB_EXTERN char ** getNthDNAStrand(const char *moduleName, unsigned long n)
Returns an array of names of the components in the nth DNA strand in the given module.
return_type
return_types are used in the API when requesting information about different symbols.
Definition: enums.h:81
LIB_EXTERN char * getTriggerForEvent(const char *moduleName, unsigned long event)
Returns the trigger for the given event, as an equation that can be interpreted in a boolean context...
LIB_EXTERN char * getNthAssignmentEquationForEvent(const char *moduleName, unsigned long event, unsigned long n)
Each assignment for an event assigns a formula to a variable.
LIB_EXTERN long loadCellMLFile(const char *filename)
Load a file known to be CellML.
LIB_EXTERN char * getNthModuleName(unsigned long n)
Returns the nth module name.
LIB_EXTERN unsigned long getNumInteractions(const char *moduleName)
Returns the number of interactions in the named module.
LIB_EXTERN char * getNthReplacementSymbolNameBetween(const char *moduleName, const char *formerSubmodName, const char *replacementSubmodName, unsigned long n)
Returns the Nth replacement symbol name of a symbol that has replaced a different symbol in the given...
LIB_EXTERN bool getFromTriggerForEvent(const char *moduleName, unsigned long event)
Returns the value of the 'fromTrigger' flag for the given event trigger (default is 'true')...
LIB_EXTERN char * getNthInteractionMthInteracteeName(const char *modulename, unsigned long interaction, unsigned long interactee)
Returns the Mth interactee name for the given interaction.
LIB_EXTERN char *** getAllReplacementSymbolPairs(const char *moduleName)
Returns a list of pairs of symbol names that have been synchronized with each other–the first the sym...
LIB_EXTERN bool getEventHasDelay(const char *moduleName, unsigned long event)
Returns 'true' if the given event has a delay; 'false' otherwise.
LIB_EXTERN char * getNthFormerSymbolName(const char *moduleName, unsigned long n)
Returns the Nth symbol name that has been replaced by a new symbol name in the given module...
LIB_EXTERN char * getNthReactionMthReactantName(const char *modulename, unsigned long rxn, unsigned long reactant)
Returns the mth reactant name of the mth reaction.
LIB_EXTERN char * getNthSymbolNameOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the name of the Nth symbol of the given type.
LIB_EXTERN char * getNthSymbolEquationOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the equation associated with the Nth symbol of the given type.
LIB_EXTERN char *** getDNAStrands(const char *moduleName)
Returns an array of all DNA strands in the given module as lists of their components.
formula_type
rule_type values are not used in the API, but are used internally in libAntimony. ...
Definition: enums.h:115
LIB_EXTERN unsigned long getNumSymbolsOfType(const char *moduleName, return_type rtype)
Returns the number of symbols of the given return type.
LIB_EXTERN bool getT0ForEvent(const char *moduleName, unsigned long event)
Returns the value at time 0 for the given event trigger (default is 'true').
LIB_EXTERN unsigned long getNumInteractees(const char *moduleName, unsigned long rxn)
Returns the number of interactees (reactions on the right side of the interaction) for the given inte...
LIB_EXTERN char * getSBMLWarnings(const char *moduleName)
Returns the 'warning' messages from libSBML.
LIB_EXTERN int writeAntimonyFile(const char *filename, const char *moduleName)
Writes out an antimony-formatted file containing the given module.
LIB_EXTERN int writeCompSBMLFile(const char *filename, const char *moduleName)
Writes out a SBML-formatted XML file to the file indicated, using the 'Hierarchichal Model Compositio...
LIB_EXTERN char ** getSymbolAssignmentRulesOfType(const char *moduleName, return_type rtype)
Returns the equations associated with the assignment rule for symbols of the given return type...
LIB_EXTERN unsigned long getNumProducts(const char *moduleName, unsigned long rxn)
Returns the number of products (species on the right side of the reaction) for the given reaction...
LIB_EXTERN bool addDefaultInitialValues(const char *moduleName)
Adds default initial values to the named module.
LIB_EXTERN char ** getStoichiometryMatrixRowLabels(const char *moduleName)
The row labels for the stoichiometry matrix.
LIB_EXTERN char ** getNthReactionReactantNames(const char *modulename, unsigned long rxn)
Returns an array of all the reactant names for the given reaction.
LIB_EXTERN void addDirectory(const char *directory)
Add a directory in which imported files may be found, and in which to look for a '.antimony' file (which contains rules about where to look locally for imported antimony and sbml files).
LIB_EXTERN char ** getSymbolInitialAssignmentsOfType(const char *moduleName, return_type rtype)
Returns the equations associated with the initial assignment for symbols of the given return type...
LIB_EXTERN char *** getProductNames(const char *moduleName)
Returns all the product names for all reactions in the given module.
LIB_EXTERN char * getNthSymbolCompartmentOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the name of the compartment associated with the nth symbol of the given type.
LIB_EXTERN char * getSBMLInfoMessages(const char *moduleName)
Returns the 'info' messages from libSBML.
LIB_EXTERN char ** getStoichiometryMatrixColumnLabels(const char *moduleName)
The column labels for the stoichiometry matrix.
LIB_EXTERN char *** getAllReplacementSymbolPairsBetween(const char *moduleName, const char *formerSubmodName, const char *replacementSubmodName, unsigned long n)
Returns a list of pairs of symbol names that have been synchronized with each other–the first the sym...
LIB_EXTERN char *** getReactantNames(const char *moduleName)
Returns all the reactant names for all reactions in the given module.
LIB_EXTERN char ** getSymbolEquationsOfType(const char *moduleName, return_type rtype)
Returns the equations associated with the symbols of the given return type.
LIB_EXTERN unsigned long getNumModules()
Returns the number of modules in the current active set (the last file successfully loaded...
Various enums used both in the API and internally in libAntimony.
LIB_EXTERN unsigned long getNumAssignmentsForEvent(const char *moduleName, unsigned long event)
Returns the number of assignments stored in the given event.
LIB_EXTERN char *** getInteracteeNames(const char *moduleName)
Returns all the interactee names for all interactions in the given module.
LIB_EXTERN char * getPriorityForEvent(const char *moduleName, unsigned long event)
Returns the priority for the given event, as an equation (if present; if the event has no priority...
LIB_EXTERN long loadAntimonyFile(const char *filename)
Loads a file and parses it as an Antimony file.
LIB_EXTERN char * getDelayForEvent(const char *moduleName, unsigned long event)
Returns the delay for the given event, as an equation (if present; if the event has no delay...
LIB_EXTERN double ** getProductStoichiometries(const char *moduleName)
Returns a two-dimensional array of the stoichiometries for all products in all reactions in the given...
LIB_EXTERN void freeAll()
Frees all pointers handed to you by libAntimony.
LIB_EXTERN unsigned long getNumSymbolsInInterfaceOf(const char *moduleName)
Returns the number of symbols defined to be in the interface of the given module. ...
LIB_EXTERN void clearDirectories()
Clears the list of directories added with the 'addDirectory' function.
LIB_EXTERN char *** getModularDNAStrands(const char *moduleName)
Returns an array of strands, each of which has an array of the names of the components of that strand...
LIB_EXTERN unsigned long getNumReplacedSymbolNames(const char *moduleName)
Returns the Nth replacement symbol name of a symbol that has replaced a different symbol in the given...
LIB_EXTERN char * getCompartmentForSymbol(const char *moduleName, const char *symbolName)
Returns the name of the compartment the given symbol is a member of.
LIB_EXTERN unsigned long getNumReplacedSymbolNamesBetween(const char *moduleName, const char *formerSubmodName, const char *replacementSubmodName)
Returns the Nth replacement symbol name of a symbol that has replaced a different symbol in the given...
LIB_EXTERN unsigned long getNumReactants(const char *moduleName, unsigned long rxn)
Returns the number of reactants (species on the left side of the reaction) for the given reaction...
LIB_EXTERN unsigned long getNumReactionRates(const char *moduleName)
Returns the number of reactions (and hence reaction rates) in the module.
LIB_EXTERN char * getNthSymbolAssignmentRuleOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the assignment rule associated with the Nth symbol of the given type.
LIB_EXTERN bool getPersistenceForEvent(const char *moduleName, unsigned long event)
Returns the value of the persistence flag for the given event (default is 'false').
LIB_EXTERN unsigned long getNumInteractors(const char *moduleName, unsigned long rxn)
Returns the number of interactors (species on the left side of the interaction) for the given interac...
LIB_EXTERN double getNthReactionMthReactantStoichiometries(const char *moduleName, unsigned long rxn, unsigned long reactant)
Returns the stoichiometry for the Mth reactant of the Nth reaction in the module. ...
LIB_EXTERN char * getCellMLString(const char *moduleName)
Returns the same output as writeCellMLFile, but to a char* array instead of to a file.
LIB_EXTERN rd_type getNthInteractionDivider(const char *moduleName, unsigned long n)
Returns the Nth interaction divider in the module.
LIB_EXTERN char ** getSymbolCompartmentsOfType(const char *moduleName, return_type rtype)
Returns the compartments associated with the symbols of the given return type.
LIB_EXTERN unsigned long * getDNAStrandSizes(const char *moduleName)
Returns an array of DNA strand sizes for all strands in the module.
LIB_EXTERN char * getNthReactionMthProductName(const char *modulename, unsigned long rxn, unsigned long product)
Returns the mth product name of the given reaction.
LIB_EXTERN void printAllDataFor(const char *moduleName)
An example function that will print to stdout all the information in the given module.
LIB_EXTERN double getNthReactionMthProductStoichiometries(const char *moduleName, unsigned long rxn, unsigned long product)
Returns the stoichiometries for the Mth product of the Nth reaction in the module.
LIB_EXTERN char * getNthSymbolInitialAssignmentOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the initial assignment associated with the Nth symbol of the given type.
LIB_EXTERN char * getNthSymbolRateRuleOfType(const char *moduleName, return_type rtype, unsigned long n)
Returns the rate rule associated with the Nth symbol of the given type.
LIB_EXTERN char * getNthAssignmentVariableForEvent(const char *moduleName, unsigned long event, unsigned long n)
Each assignment for an event assigns a formula to a variable.
LIB_EXTERN long loadCellMLString(const char *model)
Load a string known to be CellML.
LIB_EXTERN void clearPreviousLoads()
Clears memory of all files loaded.
rd_type
rd_types are the different types of reactions and interactions.
Definition: enums.h:18
LIB_EXTERN bool revertTo(long index)
Change the 'active' set of modules to the ones from the given index (as received from 'load<file/strin...