-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Yosef Bedaso edited this page Nov 30, 2017
·
1 revision
C:\Users\yosef\Downloads\swigwin-2.0.12\swigwin-2.0.12\swig.exe -python -c++ -module structural -DBEGIN_C_DECLS -DEND_C_DECLS -DLIB_EXTERN -I../LibStructural/include -I../LibLA/include -cpperraswarn -outdir python -o libstructural_wrap_python.cpp libstructural.i
from the C:\Users\yosef\Documents\Visual Studio 2017\Projects\libstruct\SWIG
directory.
import structural
ls = structural.LibStructural.getInstance()
ls.loadSBMLFromFile(r"C:\Users\yosef\Documents\Visual Studio 2017\Projects\structMain\sbml_test_models\model_1.xml")
ls.analyzeWithQR() # need to call this before getting any of the matricies
m = ls.getStoichiometryMatrix()
print('get number of rows')
print(m.numRows())
print('get number of cols')
print(m.numCols())
print('get element at 0x0 corner')
print(m.get(0,0))
# convert the stoichiometry matrix to numpy
print('numpy result')
print(m.toNumpy())
# or just print it directly
print('print on libstruct matrix')
print(m)
print('Nr')
Nr = ls.getNrMatrix()
print(Nr)
import structural
import numpy as np
import tellurium as te
main_path = "C:\Users\yosef\Documents\Visual Studio 2017\Projects\structMain\sbml_test_models"
ls = structural.LibStructural.getInstance()
ls.loadSBMLFromFile(r"C:\Users\yosef\Documents\Visual Studio 2017\Projects\structMain\sbml_test_models\model_3.xml")
ls.analyzeWithQR()
m = ls.getStoichiometryMatrix()
print(ls.getInitialConditions())
print(ls.getConservedLaws())
print(ls.findPositiveGammaMatrix(ls.getNrMatrix(), ls.getNrMatrixLabels()[0]))
print(ls.getColumnReorderedNrMatrixLabels())
print(ls.getDependentReactionIds())
print(ls.getDependentSpecies())
print(ls.getGammaMatrixLabels())
print(ls.getIndependentReactionIds())
print(ls.getIndependentSpecies())
print(ls.getIndependentSpeciesNamesList())
print(ls.getK0MatrixLabels())
print(ls.getKMatrixLabels())
print(ls.getL0MatrixLabels())
print(ls.getLinkMatrixLabels())
print(ls.getN0MatrixLabels())
print(ls.getModelName())
print(ls.getNDCMatrixLabels())
print(ls.getNICMatrixLabels())
print(ls.getNrMatrixLabels())
print(ls.getReactions())
print(ls.getSpecies())
print(ls.getStoichiometryMatrixLabels())