2 # -*- coding: utf-8 -*-
5 import matplotlib.pyplot as plt
8 # Refer to parameters.txt for documentation
18 self.x = np.logspace(0, 3, steps)
19 self.y = 1 / (1 + (999 * np.exp(-0.1233 * (self.x / self.offset))))
24 def calcgb(self, gaind, biasd):
25 for i in range(steps):
27 self.gain.append(1 + gaind * y)
28 self.bias.append(1 + biasd * y)
31 plt.plot(self.x, self.y)
33 plt.xlabel("Norepinephrine concentration (nM)")
34 plt.ylabel("Activity (%)")
35 plt.title("Norepinepherine Concentration vs Neuron Activity in " + self.pretty)
37 plt.vlines(self.ki, 0, 1, linestyles="dashed")
38 plt.text(1.1 * self.ki, 0.1, "Affinity")
40 plt.hlines(0.5, 0, 1000, linestyles="dashed")
41 plt.text(1, 0.51, "50%")
45 gc.set_yticklabels(['{:.0f}%'.format(x * 100) for x in gc.get_yticks()])
48 plt.savefig(self.__class__.__name__ + "-norep-activity.png", dpi=1000)
51 #######################################################################
53 plt.plot(self.x, self.gain)
55 plt.xlabel("Norepinephrine concentration (nM)")
57 plt.title("Concentration vs Gain in " + self.pretty)
60 plt.savefig(self.__class__.__name__ + "-concentration-gain.png", dpi=1000)
63 #######################################################################
65 plt.plot(self.x, self.bias)
67 plt.xlabel("Norepinephrine concentration (nM)")
69 plt.title("Concentration vs Bias in " + self.pretty)
72 plt.savefig(self.__class__.__name__ + "-concentration-bias.png", dpi=1000)
79 self.pretty = u"α1 Receptor"
85 super().calcgb(self.gaind, self.biasd)
91 self.pretty = u"α2 Receptor"
97 super().calcgb(self.gaind, self.biasd)
100 plt.style.use("ggplot")
110 if __name__ == "__main__":