Пример #1
0
             name,
             os.path.join(os.path.join(name, "activation"),
                          str(idx) + "_" + str(idx2)),
             enzymeInit=e,
             activInit=t,
             inhibInit=t,
             x2val=x2Val,
             x1val=None,
             indexSplit=indexSplit)
 df = pandas.DataFrame(indicatorMatrixActiv)
 df.to_csv(os.path.join(name, "indicatorMatrixActiv.csv"))
 colorDiagram(enzyme,
              templateInit,
              indicatorMatrixActiv,
              "Initial concentration of E",
              "Initial concentration of template",
              "Indicator of the model",
              figname=os.path.join(name,
                                   "modelIndicatorDiagrammActivation.png"),
              equiPotential=False)
 # second: generate indicator matrix for fixed activation
 indicatorMatrixInhib = np.zeros((enzyme.shape[0], templateInit.shape[0]))
 x1Val = 10**(-6)
 for idx, e in enumerate(enzyme):
     for idx2, t in enumerate(templateInit):
         if not os.path.exists(
                 os.path.join(os.path.join(name, "inhibition"),
                              str(idx) + "_" + str(idx2))):
             os.makedirs(
                 os.path.join(os.path.join(name, "inhibition"),
                              str(idx) + "_" + str(idx2)))
Пример #2
0
df.to_csv(os.path.join(experiment_path, "Y1.csv"))
df = pandas.DataFrame(outputArrayY2)
df.to_csv(os.path.join(experiment_path, "Y2.csv"))
df = pandas.DataFrame(outputY1)
df.to_csv(os.path.join(experiment_path, "Y1equi.csv"))
df = pandas.DataFrame(outputY2)
df.to_csv(os.path.join(experiment_path, "Y2equi.csv"))
df2 = pandas.DataFrame(A2onA1)
df2.to_csv(os.path.join(experiment_path, "a2on1.csv"))
df2 = pandas.DataFrame(C)
df2.to_csv(os.path.join(experiment_path, "c.csv"))

colorDiagram(A2onA1,
             C,
             outputY1 / outputY2,
             "Ratio A2/A1",
             "Concentration of cooperative species, arbitrary unit",
             'Ratio: Y2/Y1',
             os.path.join(experiment_path, "diagrammRatio.png"),
             equiPotential=False)
colorDiagram(A2onA1,
             C,
             outputY1,
             "Ratio A2/A1",
             "Concentration of cooperative species, arbitrary unit",
             'output concentration: Y1',
             os.path.join(experiment_path, "diagrammY1.png"),
             equiPotential=False)
colorDiagram(A2onA1,
             C,
             outputY2,
             "Ratio A2/A1",
Пример #3
0
                          displayOther=True)

    if ("outputEqui" in modes):
        experiment_path = name
        C0 = readAttribute(experiment_path, ["C0"])["C0"]
        rescaleFactor = readAttribute(experiment_path,
                                      ["rescaleFactor"])["rescaleFactor"]
        output = results[modes.index("outputEqui")]
        output = np.reshape(output, (len(X1), len(X2)))
        X1 = X1 / (C0 * rescaleFactor)
        X2 = X2 / (C0 * rescaleFactor)
        colorDiagram(X1,
                     X2,
                     output,
                     "Initial concentration of X1",
                     "Initial concentration of X2",
                     "Equilibrium concentration of the output",
                     figname=os.path.join(experiment_path,
                                          "neuralDiagramm.png"),
                     equiPotential=False)
        neuronPlot(X1,
                   X2,
                   output,
                   figname=os.path.join(experiment_path,
                                        "activationLogX1.png"),
                   figname2=os.path.join(experiment_path,
                                         "activationLogX2.png"),
                   useLogX=True,
                   doShow=False)
        neuronPlot(X1,
                   X2,
Пример #4
0
import numpy as np
import pandas
from simulOfBioNN.plotUtils.adaptivePlotUtils import colorDiagram
import matplotlib.pyplot as plt

dfoutput = pandas.read_csv("equilibriumTest.csv")
output = dfoutput.values[:, 1:]
dfA2onA1 = pandas.read_csv("a2on1Test.csv")
A2onA1 = np.reshape(dfA2onA1.values[:, 1:], (dfA2onA1.values[:, 1:].shape[0]))
dfC = pandas.read_csv("cTest.csv")
C = np.reshape(dfC.values[:, 1:], (dfC.values[:, 1:].shape[0]))

colorDiagram(A2onA1, C, output, "Ratio A2/A1",
             "Concentration of cooperative species, arbitrary unit",
             'Ratio: Y2/Y1', "diagrammTest.png")
plt.show()
Пример #5
0
        activInit = np.logspace(-8, -4, 4)
        inhibInit = np.logspace(-8,-4, 4)
        indexSplit = 10
        indicatorMatrixActiv = np.zeros((inhibInit.shape[0], activInit.shape[0]))
        #first: generate indicator matrix for fixed inhibition
        x2Val = 10**(-6)
        for idx,cactiv in enumerate(activInit):
            for idx2,cinhib in enumerate(inhibInit):
                if not os.path.exists(os.path.join(os.path.join(name2,"activation"),str(idx)+"_"+str(idx2))):
                    os.makedirs(os.path.join(os.path.join(name2,"activation"),str(idx)+"_"+str(idx2)))
                indicatorMatrixActiv[idx,idx2] = simulModelIndicator(name,os.path.join(os.path.join(name2,"activation"),str(idx)+"_"+str(idx2)),enzymeInit = e,activInit = cactiv,inhibInit = cinhib, x2val = x2Val, x1val = None, indexSplit = indexSplit)
        df = pandas.DataFrame(indicatorMatrixActiv)
        df.to_csv(os.path.join(name2,"indicatorMatrixActiv.csv"))
        # second: generate indicator matrix for fixed activation
        indicatorMatrixInhib = np.zeros((enzyme.shape[0], activInit.shape[0]))
        x1Val = 10**(-6)
        for idx,cactiv in enumerate(activInit):
            for idx2,cinhib in enumerate(inhibInit):
                if not os.path.exists(os.path.join(os.path.join(name2,"inhibition"),str(idx)+"_"+str(idx2))):
                    os.makedirs(os.path.join(os.path.join(name2,"inhibition"),str(idx)+"_"+str(idx2)))
                indicatorMatrixInhib[idx,idx2] = simulModelIndicator(name,os.path.join(os.path.join(name2,"inhibition"),str(idx)+"_"+str(idx2)),enzymeInit = e,activInit = cactiv,inhibInit = cinhib, x2val = None, x1val = x1Val, indexSplit = indexSplit)
        df2 = pandas.DataFrame(indicatorMatrixInhib)
        df2.to_csv(os.path.join(name2,"indicatorMatrixInhib.csv"))

        colorDiagram(activInit,inhibInit,indicatorMatrixInhib,"Initial concentration of Activ","Initial concentration of Inhib","Average Indicator of the model",figname=os.path.join(name2, "indicatorMatrixInhib.png"),equiPotential=False,uselog=True)

        colorDiagram(activInit,inhibInit,indicatorMatrixActiv,"Initial concentration of Activ","Initial concentration of Inhib","Average Indicator of the model",figname=os.path.join(name2, "indicatorMatrixActiv.png"),equiPotential=False,uselog=True)

        indicatorAvg = (indicatorMatrixActiv + indicatorMatrixInhib)/2
        colorDiagram(activInit,inhibInit,indicatorAvg,"Initial concentration of Activ","Initial concentration of Inhib","Average Indicator of the model",figname=os.path.join(name2, "modelIndicatorAverage.png"),equiPotential=False,uselog=True)
Пример #6
0
experiment_path=os.path.join(sys.path[0],"")

df=pandas.read_csv(os.path.join(experiment_path, "neural_equilibrium.csv"))
output = df.values[:,1:]
df=pandas.read_csv(os.path.join(experiment_path, "neural_X1.csv"))
X1 = np.transpose(df.values[:,1:])[0]
df=pandas.read_csv(os.path.join(experiment_path, "neural_X2.csv"))
X2 = np.transpose(df.values[:,1:])[0]

C0 = 8.086075400626399e-07
#separate from bad values
X1=X1[:164]/C0
output=output[:164]
X2=X2[:164]/C0

colorDiagram(X1,X2,output,"Concentration of X1","Concentration of X2","Equilibrium concentration of the output",figname=os.path.join(experiment_path, "neuralDiagramm2.png"),equiPotential=False)
# neuronPlot(X1/(8.086075400626399e-07),X2/(8.086075400626399e-07),output,figname=os.path.join(experiment_path, "activation2.png"))
neuronPlot(X1,X2,output,figname=os.path.join(experiment_path, "activationX1.png"),figname2=os.path.join(experiment_path, "activationX2.png"))
# Plotting time:
colorDiagram(X1,X2,np.exp(output),"Concentration of X1","Concentration of X2","Equilibrium concentration of the output",figname=os.path.join(experiment_path, "neuralDiagramm2log.png"),equiPotential=False)
# neuronPlot(X1/(8.086075400626399e-07),X2/(8.086075400626399e-07),output,figname=os.path.join(experiment_path, "activation2.png"))
neuronPlot(X1,X2,np.exp(output),figname=os.path.join(experiment_path, "activationX1log.png"),figname2=os.path.join(experiment_path, "activationX2log.png"))
## Let us plot the frontier:
coords=[]
Xfrontier=[]
X2frontier=[]
for y in range(output.shape[1]):
    for x in range(output.shape[0]-1):
        if(output[x,y]<1 and 2<output[x+1,y]): #we have a discontinuity --> we are on the frontier
            coords+=[[X1[x],X2[y]]]
            Xfrontier+=[[X1[x],output[x+1,y]]]