2 import matplotlib.pyplot as plt
5 # Refer to parameters.txt for documentation
15 self.x = np.logspace(0, 3, steps)
16 self.y = 1 / (1 + (999 * np.exp(-0.1233 * (self.x / self.offset))))
21 def calcgb(self, gaind, biasd):
22 for i in range(steps):
24 self.gain.append(1 + gaind * y)
25 self.bias.append(1 + biasd * y)
30 except FileExistsError:
33 out = f"./out/{self.__class__.__name__}"
34 plt.plot(self.x, self.y)
36 plt.xlabel("Norepinephrine concentration (nM)")
37 plt.ylabel("Activity (%)")
38 plt.title("Norepinepherine Concentration vs Neuron Activity in " +
41 plt.vlines(self.ki, 0, 1, linestyles="dashed")
42 plt.text(1.1 * self.ki, 0.1, "Affinity")
44 plt.hlines(0.5, 0, 1000, linestyles="dashed")
45 plt.text(1, 0.51, "50%")
49 gc.set_yticklabels(['{:.0f}%'.format(x * 100) for x in gc.get_yticks()])
52 plt.savefig(f"{out}-norep-activity.png", dpi=1000)
54 #######################################################################
56 plt.plot(self.x, self.gain)
58 plt.xlabel("Norepinephrine concentration (nM)")
60 plt.title(f"Concentration vs Gain in {self.pretty}")
63 plt.savefig(f"{out}-concentration-gain.png", dpi=1000)
65 #######################################################################
67 plt.plot(self.x, self.bias)
69 plt.xlabel("Norepinephrine concentration (nM)")
71 plt.title("Concentration vs Bias in " + self.pretty)
74 plt.savefig(f"{out}-concentration-bias.png", dpi=1000)
80 self.pretty = "α1 Receptor"
86 super().calcgb(self.gaind, self.biasd)
92 self.pretty = "α2 Receptor"
98 super().calcgb(self.gaind, self.biasd)
101 plt.style.use("ggplot")
111 if __name__ == "__main__":