Skip to content

Commit

Permalink
- expose sbml ids
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Apr 29, 2024
1 parent bb4aed7 commit 69a8472
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/copasi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,23 @@ export default class COPASI {
simulateEx2D(startTime : number, endTime : number, numPoints : number) : number[][];
simulateYaml(yamlProcessingOptions : string|object) : SimResult;
simulateYaml2D(yamlProcessingOptions : string|object) : SimResult;
getValue(nameOrId: string): number;
setValue(nameOrId: string, value: number): void;
readonly floatingSpeciesConcentrations : number[];
readonly ratesOfChange : number[];
readonly floatingSpeciesNames : string[];
readonly floatingSpeciesIds : string[];
readonly boundarySpeciesConcentrations : number[];
readonly boundarySpeciesNames : string[];
readonly boundarySpeciesIds : string[];
readonly reactionNames : string[];
readonly reactionIds : string[];
readonly reactionRates : number[];
readonly compartmentNames : string[];
readonly compartmentIds : string[];
readonly compartmentSizes : number[];
readonly globalParameterNames : string[];
readonly globalParameterIds : string[];
readonly globalParameterValues : number[];
readonly localParameterNames : string[];
readonly localParameterValues : number[];
Expand Down
34 changes: 34 additions & 0 deletions js/copasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class COPASI {
this.oneStep = Module.oneStep;
this.initCps = Module.initCps;
this.destroy = Module.destroy;
this.getValue = Module.getValue;
this.setValue = Module.setValue;

// init runtime
this.initCps();
Expand Down Expand Up @@ -210,6 +212,13 @@ class COPASI {
return this._vectorToArray(this.Module.getFloatingSpeciesNames());
}

/**
* @property {string[]} floatingSpeciesIds returns floating species ids
*/
get floatingSpeciesIds() {
return this._vectorToArray(this.Module.getFloatingSpeciesIds());
}

/**
* @property {number[]} boundarySpeciesConcentrations returns boundary species concentrations
*/
Expand All @@ -224,13 +233,26 @@ class COPASI {
return this._vectorToArray(this.Module.getBoundarySpeciesNames());
}

/**
* @property {string[]} boundarySpeciesIds returns boundary species ids
*/
get boundarySpeciesIds() {
return this._vectorToArray(this.Module.getBoundarySpeciesIds());
}

/**
* @property {string[]} reactionNames returns reaction names
*/
get reactionNames() {
return this._vectorToArray(this.Module.getReactionNames());
}

/**
* @property {string[]} reactionIds returns reaction ids
*/
get reactionIds() {
return this._vectorToArray(this.Module.getReactionIds());
}
/**
* @property {number[]} reactionRates returns reaction rates
*/
Expand All @@ -245,6 +267,12 @@ class COPASI {
return this._vectorToArray(this.Module.getCompartmentNames());
}

/**
* @property {string[]} compartmentIds returns compartment ids
*/
get compartmentIds() {
return this._vectorToArray(this.Module.getCompartmentIds());
}
/**
* @property {number[]} compartmentSizes returns compartment sizes
*/
Expand All @@ -259,6 +287,12 @@ class COPASI {
return this._vectorToArray(this.Module.getGlobalParameterNames());
}

/**
* @property {string[]} globalParameterIds returns global parameter ids
*/
get globalParameterIds() {
return this._vectorToArray(this.Module.getGlobalParameterIds());
}
/**
* @property {number[]} globalParameterValues returns global parameter values
*/
Expand Down

0 comments on commit 69a8472

Please sign in to comment.