diff --git a/genesis/spineCa_CaM_diffn.g b/genesis/spineCa_CaM_diffn.g new file mode 100644 index 0000000000000000000000000000000000000000..7b2badb258258cb937f91e4c2ce2f8fc61256d3e --- /dev/null +++ b/genesis/spineCa_CaM_diffn.g @@ -0,0 +1,696 @@ +//genesis +// kkit Version 11 flat dumpfile + +// Saved on Sun Aug 21 08:50:42 2016 + +include kkit {argv 1} + +FASTDT = 0.0001 +SIMDT = 0.001 +CONTROLDT = 10 +PLOTDT = 10 +MAXTIME = 1000 +TRANSIENT_TIME = 10 +VARIABLE_DT_FLAG = 1 +DEFAULT_VOL = 1e-20 +VERSION = 11.0 +setfield /file/modpath value /home2/bhalla/scripts/modules +kparms + +//genesis + +initdump -version 3 -ignoreorphans 1 +simobjdump doqcsinfo filename accessname accesstype transcriber developer \ + citation species tissue cellcompartment methodology sources \ + model_implementation model_validation x y z +simobjdump table input output alloced step_mode stepsize x y z +simobjdump xtree path script namemode sizescale +simobjdump xcoredraw xmin xmax ymin ymax +simobjdump xtext editable +simobjdump xgraph xmin xmax ymin ymax overlay +simobjdump xplot pixflags script fg ysquish do_slope wy +simobjdump group xtree_fg_req xtree_textfg_req plotfield expanded movealone \ + link savename file version md5sum mod_save_flag x y z +simobjdump geometry size dim shape outside xtree_fg_req xtree_textfg_req x y \ + z +simobjdump kpool DiffConst CoInit Co n nInit mwt nMin vol slave_enable \ + geomname xtree_fg_req xtree_textfg_req x y z +simobjdump kreac kf kb notes xtree_fg_req xtree_textfg_req x y z +simobjdump kenz CoComplexInit CoComplex nComplexInit nComplex vol k1 k2 k3 \ + keepconc usecomplex notes xtree_fg_req xtree_textfg_req link x y z +simobjdump stim level1 width1 delay1 level2 width2 delay2 baselevel trig_time \ + trig_mode notes xtree_fg_req xtree_textfg_req is_running x y z +simobjdump xtab input output alloced step_mode stepsize notes editfunc \ + xtree_fg_req xtree_textfg_req baselevel last_x last_y is_running x y z +simobjdump kchan perm gmax Vm is_active use_nernst notes xtree_fg_req \ + xtree_textfg_req x y z +simobjdump transport input output alloced step_mode stepsize dt delay clock \ + kf xtree_fg_req xtree_textfg_req x y z +simobjdump proto x y z +simobjdump text str +simundump geometry /kinetics/geometry 0 1e-20 3 sphere "" white black 0 0 0 +simundump geometry /kinetics/geometry[1] 0 1e-18 3 sphere "" white black 0 0 \ + 0 +simundump geometry /kinetics/geometry[2] 0 9e-20 3 sphere "" white black 0 0 \ + 0 +simundump text /kinetics/notes 0 "" +call /kinetics/notes LOAD \ +"" +simundump group /kinetics/PSD 0 20 black x 0 0 "" PSD defaultfile.g 0 0 0 27 \ + 12 0 +simundump text /kinetics/PSD/notes 0 "" +call /kinetics/PSD/notes LOAD \ +"" +simundump kpool /kinetics/PSD/Ca 0 2e-11 0.1 0.1 0.6 0.6 0 0 6 0 \ + /kinetics/geometry 53 0 -16 6 0 +simundump text /kinetics/PSD/Ca/notes 0 "" +call /kinetics/PSD/Ca/notes LOAD \ +"" +simundump kpool /kinetics/PSD/Ca_input 0 0 0.08 0.08 0.48 0.48 0 0 6 4 \ + /kinetics/geometry 55 black -10 2 0 +simundump text /kinetics/PSD/Ca_input/notes 0 "" +call /kinetics/PSD/Ca_input/notes LOAD \ +"" +simundump kreac /kinetics/PSD/Ca_stim 0 50 1 "" white black -13 4 0 +simundump text /kinetics/PSD/Ca_stim/notes 0 "" +call /kinetics/PSD/Ca_stim/notes LOAD \ +"" +simundump group /kinetics/PSD/CaM 1 blue 20 x 0 0 "" defaultfile \ + defaultfile.g 0 fbb0ff81553508bc01f3dd51428742fb 0 -28 11 0 +simundump text /kinetics/PSD/CaM/notes 0 "" +call /kinetics/PSD/CaM/notes LOAD \ +"" +simundump kpool /kinetics/PSD/CaM/CaM 1 5e-13 40 40 240 240 0 0 6 0 \ + /kinetics/geometry pink blue -24 13 0 +simundump text /kinetics/PSD/CaM/CaM/notes 0 \ + "There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)\nSay 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying\nit is comparable to CaMK levels. \n" +call /kinetics/PSD/CaM/CaM/notes LOAD \ +"There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)" \ +"Say 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying" \ +"it is comparable to CaMK levels. " \ +"" +simundump kreac /kinetics/PSD/CaM/CaM-Ca3-bind-Ca 1 0.3 10 "" white blue -10 \ + 10 0 +simundump text /kinetics/PSD/CaM/CaM-Ca3-bind-Ca/notes 0 \ + "Use K3 = 21.5 uM here from Stemmer and Klee table 3.\nkb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10\n24 Sep 2015\nThis is a bit too low affinity. Changing to match K2 at \nKd = 2.8." +call /kinetics/PSD/CaM/CaM-Ca3-bind-Ca/notes LOAD \ +"Use K3 = 21.5 uM here from Stemmer and Klee table 3." \ +"kb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" \ +"24 Sep 2015" \ +"This is a bit too low affinity. Changing to match K2 at " \ +"Kd = 2.8." +simundump kpool /kinetics/PSD/CaM/CaM-Ca3 1 1e-12 0 0 0 0 0 0 6 0 \ + /kinetics/geometry hotpink blue -12 13 0 +simundump text /kinetics/PSD/CaM/CaM-Ca3/notes 0 "" +call /kinetics/PSD/CaM/CaM-Ca3/notes LOAD \ +"" +simundump kreac /kinetics/PSD/CaM/CaM-bind-Ca 1 1.4141 8.4853 "" white blue \ + -22 10 0 +simundump text /kinetics/PSD/CaM/CaM-bind-Ca/notes 0 \ + "Lets use the fast rate consts here. Since the rates are so different, I am not\nsure whether the order is relevant. These correspond to the TR2C fragment.\nWe use the Martin et al rates here, plus the Drabicowski binding consts.\nAll are scaled by 3X to cell temp.\nkf = 2e-10 kb = 72\nStemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11.\nIf kb=72, kf = 2e-10 (Exactly the same !)...." +call /kinetics/PSD/CaM/CaM-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +simundump kpool /kinetics/PSD/CaM/CaM-Ca2 1 1e-12 0 0 0 0 0 0 6 0 \ + /kinetics/geometry pink blue -16 13 0 +simundump text /kinetics/PSD/CaM/CaM-Ca2/notes 0 \ + "This is the intermediate where the TR2 end (the high-affinity end) has\nbound the Ca but the TR1 end has not." +call /kinetics/PSD/CaM/CaM-Ca2/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +simundump kreac /kinetics/PSD/CaM/CaM-Ca2-bind-Ca 1 0.60001 10 "" white blue \ + -14 10 0 +simundump text /kinetics/PSD/CaM/CaM-Ca2-bind-Ca/notes 0 \ + "K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get\nkb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10\n" +call /kinetics/PSD/CaM/CaM-Ca2-bind-Ca/notes LOAD \ +"K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get" \ +"kb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10" \ +"" +simundump kreac /kinetics/PSD/CaM/CaM-Ca-bind-Ca 1 1.4141 8.4853 "" white \ + blue -18 10 0 +simundump text /kinetics/PSD/CaM/CaM-Ca-bind-Ca/notes 0 \ + "Lets use the fast rate consts here. Since the rates are so different, I am not\nsure whether the order is relevant. These correspond to the TR2C fragment.\nWe use the Martin et al rates here, plus the Drabicowski binding consts.\nAll are scaled by 3X to cell temp.\nkf = 2e-10 kb = 72\nStemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11.\nIf kb=72, kf = 2e-10 (Exactly the same !)...." +call /kinetics/PSD/CaM/CaM-Ca-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +simundump kpool /kinetics/PSD/CaM/CaM-Ca 1 1e-12 0 0 0 0 0 0 6 0 \ + /kinetics/geometry pink blue -20 13 0 +simundump text /kinetics/PSD/CaM/CaM-Ca/notes 0 \ + "This is the intermediate where the TR2 end (the high-affinity end) has\nbound the Ca but the TR1 end has not." +call /kinetics/PSD/CaM/CaM-Ca/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +simundump kpool /kinetics/PSD/CaM/CaM-Ca4 1 1e-12 0 0 0 0 0 0 6 0 \ + /kinetics/geometry blue blue -7 13 0 +simundump text /kinetics/PSD/CaM/CaM-Ca4/notes 0 "" +call /kinetics/PSD/CaM/CaM-Ca4/notes LOAD \ +"" +simundump group /kinetics/DEND 0 13 black x 0 0 "" DEND defaultfile.g 0 0 0 \ + 11 -30 0 +simundump text /kinetics/DEND/notes 0 "" +call /kinetics/DEND/notes LOAD \ +"" +simundump kpool /kinetics/DEND/Ca 0 2e-11 0.08 0.08 48 48 0 0 600 0 \ + /kinetics/geometry 54 40 -8 -20 0 +simundump text /kinetics/DEND/Ca/notes 0 "" +call /kinetics/DEND/Ca/notes LOAD \ +"" +simundump kpool /kinetics/DEND/Ca_input 0 0 0.08 0.08 48 48 0 0 600 4 \ + /kinetics/geometry 55 40 -2 -20 0 +simundump text /kinetics/DEND/Ca_input/notes 0 "" +call /kinetics/DEND/Ca_input/notes LOAD \ +"" +simundump kreac /kinetics/DEND/Ca_stim 0 50 1 "" white 40 -5 -19 0 +simundump text /kinetics/DEND/Ca_stim/notes 0 "" +call /kinetics/DEND/Ca_stim/notes LOAD \ +"" +simundump group /kinetics/DEND/CaM 1 blue 13 x 0 0 "" defaultfile \ + defaultfile.g 0 fbb0ff81553508bc01f3dd51428742fb 0 -21 -15 0 +simundump text /kinetics/DEND/CaM/notes 0 "" +call /kinetics/DEND/CaM/notes LOAD \ +"" +simundump kpool /kinetics/DEND/CaM/CaM 1 5e-13 2 2 1200 1200 0 0 600 0 \ + /kinetics/geometry pink blue -17 -13 0 +simundump text /kinetics/DEND/CaM/CaM/notes 0 \ + "There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)\nSay 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying\nit is comparable to CaMK levels. \n" +call /kinetics/DEND/CaM/CaM/notes LOAD \ +"There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)" \ +"Say 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying" \ +"it is comparable to CaMK levels. " \ +"" +simundump kreac /kinetics/DEND/CaM/CaM-Ca3-bind-Ca 1 0.003 10 "" white blue \ + -3 -16 0 +simundump text /kinetics/DEND/CaM/CaM-Ca3-bind-Ca/notes 0 \ + "Use K3 = 21.5 uM here from Stemmer and Klee table 3.\nkb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" +call /kinetics/DEND/CaM/CaM-Ca3-bind-Ca/notes LOAD \ +"Use K3 = 21.5 uM here from Stemmer and Klee table 3." \ +"kb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" +simundump kpool /kinetics/DEND/CaM/CaM-Ca3 1 1e-12 0 0 0 0 0 0 600 0 \ + /kinetics/geometry hotpink blue -5 -13 0 +simundump text /kinetics/DEND/CaM/CaM-Ca3/notes 0 "" +call /kinetics/DEND/CaM/CaM-Ca3/notes LOAD \ +"" +simundump kreac /kinetics/DEND/CaM/CaM-bind-Ca 1 0.014141 8.4853 "" white \ + blue -15 -16 0 +simundump text /kinetics/DEND/CaM/CaM-bind-Ca/notes 0 \ + "Lets use the fast rate consts here. Since the rates are so different, I am not\nsure whether the order is relevant. These correspond to the TR2C fragment.\nWe use the Martin et al rates here, plus the Drabicowski binding consts.\nAll are scaled by 3X to cell temp.\nkf = 2e-10 kb = 72\nStemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11.\nIf kb=72, kf = 2e-10 (Exactly the same !)...." +call /kinetics/DEND/CaM/CaM-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +simundump kpool /kinetics/DEND/CaM/CaM-Ca2 1 1e-12 0 0 0 0 0 0 600 0 \ + /kinetics/geometry pink blue -9 -13 0 +simundump text /kinetics/DEND/CaM/CaM-Ca2/notes 0 \ + "This is the intermediate where the TR2 end (the high-affinity end) has\nbound the Ca but the TR1 end has not." +call /kinetics/DEND/CaM/CaM-Ca2/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +simundump kreac /kinetics/DEND/CaM/CaM-Ca2-bind-Ca 1 0.006 10 "" white blue \ + -7 -16 0 +simundump text /kinetics/DEND/CaM/CaM-Ca2-bind-Ca/notes 0 \ + "K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get\nkb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10\n" +call /kinetics/DEND/CaM/CaM-Ca2-bind-Ca/notes LOAD \ +"K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get" \ +"kb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10" \ +"" +simundump kreac /kinetics/DEND/CaM/CaM-Ca-bind-Ca 1 0.014141 8.4853 "" white \ + blue -11 -16 0 +simundump text /kinetics/DEND/CaM/CaM-Ca-bind-Ca/notes 0 \ + "Lets use the fast rate consts here. Since the rates are so different, I am not\nsure whether the order is relevant. These correspond to the TR2C fragment.\nWe use the Martin et al rates here, plus the Drabicowski binding consts.\nAll are scaled by 3X to cell temp.\nkf = 2e-10 kb = 72\nStemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11.\nIf kb=72, kf = 2e-10 (Exactly the same !)...." +call /kinetics/DEND/CaM/CaM-Ca-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +simundump kpool /kinetics/DEND/CaM/CaM-Ca 1 1e-12 0 0 0 0 0 0 600 0 \ + /kinetics/geometry pink blue -13 -13 0 +simundump text /kinetics/DEND/CaM/CaM-Ca/notes 0 \ + "This is the intermediate where the TR2 end (the high-affinity end) has\nbound the Ca but the TR1 end has not." +call /kinetics/DEND/CaM/CaM-Ca/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +simundump kpool /kinetics/DEND/CaM/CaM-Ca4 1 1e-12 0 0 0 0 0 0 600 0 \ + /kinetics/geometry blue blue 0 -13 0 +simundump text /kinetics/DEND/CaM/CaM-Ca4/notes 0 "" +call /kinetics/DEND/CaM/CaM-Ca4/notes LOAD \ +"" +simundump kreac /kinetics/DEND/CaM/CaM_x2 0 10 10 "" white black -27 -13 0 +simundump text /kinetics/DEND/CaM/CaM_x2/notes 0 "" +call /kinetics/DEND/CaM/CaM_x2/notes LOAD \ +"" +simundump kpool /kinetics/DEND/CaM/CaM_xchange 0 2e-11 0 0 0 0 0 0 600 0 \ + /kinetics/geometry[1] blue blue -36 -15 0 +simundump text /kinetics/DEND/CaM/CaM_xchange/notes 0 "" +call /kinetics/DEND/CaM/CaM_xchange/notes LOAD \ +"" +simundump group /kinetics/SPINE 0 5 black x 0 0 "" SPINE defaultfile.g 0 0 0 \ + 29 -23 0 +simundump text /kinetics/SPINE/notes 0 "" +call /kinetics/SPINE/notes LOAD \ +"" +simundump kpool /kinetics/SPINE/Ca 0 2e-11 0.11111 0.11111 6 6 0 0 54 0 \ + /kinetics/geometry[1] 50 yellow -12 -11 0 +simundump text /kinetics/SPINE/Ca/notes 0 "" +call /kinetics/SPINE/Ca/notes LOAD \ +"" +simundump group /kinetics/SPINE/CaM 1 blue 5 x 0 0 "" defaultfile \ + defaultfile.g 0 fbb0ff81553508bc01f3dd51428742fb 0 -24 -7 0 +simundump text /kinetics/SPINE/CaM/notes 0 "" +call /kinetics/SPINE/CaM/notes LOAD \ +"" +simundump kpool /kinetics/SPINE/CaM/CaM 1 5e-13 40 40 2160 2160 0 0 54 0 \ + /kinetics/geometry pink blue -20 -5 0 +simundump text /kinetics/SPINE/CaM/CaM/notes 0 \ + "There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)\nSay 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying\nit is comparable to CaMK levels. \n" +call /kinetics/SPINE/CaM/CaM/notes LOAD \ +"There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)" \ +"Say 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying" \ +"it is comparable to CaMK levels. " \ +"" +simundump kreac /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca 1 0.033333 10 "" white \ + blue -6 -8 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca/notes 0 \ + "Use K3 = 21.5 uM here from Stemmer and Klee table 3.\nkb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" +call /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca/notes LOAD \ +"Use K3 = 21.5 uM here from Stemmer and Klee table 3." \ +"kb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" +simundump kpool /kinetics/SPINE/CaM/CaM-Ca3 1 1e-12 0 0 0 0 0 0 54 0 \ + /kinetics/geometry hotpink blue -8 -5 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca3/notes 0 "" +call /kinetics/SPINE/CaM/CaM-Ca3/notes LOAD \ +"" +simundump kreac /kinetics/SPINE/CaM/CaM-bind-Ca 1 0.15712 8.4853 "" white \ + blue -18 -8 0 +simundump text /kinetics/SPINE/CaM/CaM-bind-Ca/notes 0 \ + "Lets use the fast rate consts here. Since the rates are so different, I am not\nsure whether the order is relevant. These correspond to the TR2C fragment.\nWe use the Martin et al rates here, plus the Drabicowski binding consts.\nAll are scaled by 3X to cell temp.\nkf = 2e-10 kb = 72\nStemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11.\nIf kb=72, kf = 2e-10 (Exactly the same !)...." +call /kinetics/SPINE/CaM/CaM-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +simundump kpool /kinetics/SPINE/CaM/CaM-Ca2 1 1e-12 0 0 0 0 0 0 54 0 \ + /kinetics/geometry pink blue -12 -5 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca2/notes 0 \ + "This is the intermediate where the TR2 end (the high-affinity end) has\nbound the Ca but the TR1 end has not." +call /kinetics/SPINE/CaM/CaM-Ca2/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +simundump kreac /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca 1 0.066668 10 "" white \ + blue -10 -8 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca/notes 0 \ + "K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get\nkb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10\n" +call /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca/notes LOAD \ +"K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get" \ +"kb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10" \ +"" +simundump kreac /kinetics/SPINE/CaM/CaM-Ca-bind-Ca 1 0.15712 8.4853 "" white \ + blue -14 -8 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca-bind-Ca/notes 0 \ + "Lets use the fast rate consts here. Since the rates are so different, I am not\nsure whether the order is relevant. These correspond to the TR2C fragment.\nWe use the Martin et al rates here, plus the Drabicowski binding consts.\nAll are scaled by 3X to cell temp.\nkf = 2e-10 kb = 72\nStemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11.\nIf kb=72, kf = 2e-10 (Exactly the same !)...." +call /kinetics/SPINE/CaM/CaM-Ca-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +simundump kpool /kinetics/SPINE/CaM/CaM-Ca 1 1e-12 0 0 0 0 0 0 54 0 \ + /kinetics/geometry pink blue -16 -5 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca/notes 0 \ + "This is the intermediate where the TR2 end (the high-affinity end) has\nbound the Ca but the TR1 end has not." +call /kinetics/SPINE/CaM/CaM-Ca/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +simundump kpool /kinetics/SPINE/CaM/CaM-Ca4 1 1e-12 0 0 0 0 0 0 54 0 \ + /kinetics/geometry blue blue -3 -5 0 +simundump text /kinetics/SPINE/CaM/CaM-Ca4/notes 0 "" +call /kinetics/SPINE/CaM/CaM-Ca4/notes LOAD \ +"" +simundump kreac /kinetics/SPINE/CaM/CaM_x2 0 1 100 "" white black -23 1 0 +simundump text /kinetics/SPINE/CaM/CaM_x2/notes 0 "" +call /kinetics/SPINE/CaM/CaM_x2/notes LOAD \ +"" +simundump kpool /kinetics/SPINE/CaM/CaM_xchange 0 2e-11 0 0 0 0 0 0 54 0 \ + /kinetics/geometry[2] blue black -28 -2 0 +simundump text /kinetics/SPINE/CaM/CaM_xchange/notes 0 "" +call /kinetics/SPINE/CaM/CaM_xchange/notes LOAD \ +"" +simundump text /kinetics/geometry/notes 0 "" +call /kinetics/geometry/notes LOAD \ +"" +simundump text /kinetics/geometry[1]/notes 0 "" +call /kinetics/geometry[1]/notes LOAD \ +"" +simundump text /kinetics/geometry[2]/notes 0 "" +call /kinetics/geometry[2]/notes LOAD \ +"" +simundump xgraph /graphs/conc1 0 0 2923 0 38.53 0 +simundump xgraph /graphs/conc2 0 0 2923 0 16.804 0 +simundump xgraph /moregraphs/conc3 0 0 2923 0 4 0 +simundump xgraph /moregraphs/conc4 0 0 2923 0 4 0 +simundump xcoredraw /edit/draw 0 -38 31 -32 15 +simundump xtree /edit/draw/tree 0 \ + /kinetics/#[],/kinetics/#[]/#[],/kinetics/#[]/#[]/#[][TYPE!=proto],/kinetics/#[]/#[]/#[][TYPE!=linkinfo]/##[] \ + "edit_elm.D <v>; drag_from_edit.w <d> <S> <x> <y> <z>" auto 0.6 +simundump xtext /file/notes 0 1 +xtextload /file/notes \ +"" \ +"4 Aug 2016: CaM_3compt.g: Based on CaMKII_merged91.g, just have" \ +"the CaM part in all 3 compartments, for merging." \ +"CaM_3compt1.g: Eliminated Ca and Ca input too." \ +"" \ +"4 Aug 2016: Merged CaM_3compt1.g into NN_mapk6.g, some " \ +"elimination of Ca buffer pools. All now handled by CaM." \ +"" \ +"15 Aug 2016: Doubled CaM levels throughout, use as a surrogate" \ +"for other Ca buffers." \ +"" \ +"21 Aug 2016: Ca and CaM in spine and dendrite for diffusive" \ +"calculations with CaM acting as buffer." \ +"" +addmsg /kinetics/PSD/Ca_stim /kinetics/PSD/Ca REAC B A +addmsg /kinetics/PSD/CaM/CaM-bind-Ca /kinetics/PSD/Ca REAC A B +addmsg /kinetics/PSD/CaM/CaM-Ca-bind-Ca /kinetics/PSD/Ca REAC A B +addmsg /kinetics/PSD/CaM/CaM-Ca2-bind-Ca /kinetics/PSD/Ca REAC A B +addmsg /kinetics/PSD/CaM/CaM-Ca3-bind-Ca /kinetics/PSD/Ca REAC A B +addmsg /kinetics/PSD/Ca_stim /kinetics/PSD/Ca_input REAC A B +addmsg /kinetics/PSD/Ca_input /kinetics/PSD/Ca_stim SUBSTRATE n +addmsg /kinetics/PSD/Ca /kinetics/PSD/Ca_stim PRODUCT n +addmsg /kinetics/PSD/CaM/CaM-bind-Ca /kinetics/PSD/CaM/CaM REAC A B +addmsg /kinetics/PSD/CaM/CaM-Ca3 /kinetics/PSD/CaM/CaM-Ca3-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca4 /kinetics/PSD/CaM/CaM-Ca3-bind-Ca PRODUCT n +addmsg /kinetics/PSD/Ca /kinetics/PSD/CaM/CaM-Ca3-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca2-bind-Ca /kinetics/PSD/CaM/CaM-Ca3 REAC B A +addmsg /kinetics/PSD/CaM/CaM-Ca3-bind-Ca /kinetics/PSD/CaM/CaM-Ca3 REAC A B +addmsg /kinetics/PSD/CaM/CaM /kinetics/PSD/CaM/CaM-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca /kinetics/PSD/CaM/CaM-bind-Ca PRODUCT n +addmsg /kinetics/PSD/Ca /kinetics/PSD/CaM/CaM-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca2-bind-Ca /kinetics/PSD/CaM/CaM-Ca2 REAC A B +addmsg /kinetics/PSD/CaM/CaM-Ca-bind-Ca /kinetics/PSD/CaM/CaM-Ca2 REAC B A +addmsg /kinetics/PSD/CaM/CaM-Ca2 /kinetics/PSD/CaM/CaM-Ca2-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca3 /kinetics/PSD/CaM/CaM-Ca2-bind-Ca PRODUCT n +addmsg /kinetics/PSD/Ca /kinetics/PSD/CaM/CaM-Ca2-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca /kinetics/PSD/CaM/CaM-Ca-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-Ca2 /kinetics/PSD/CaM/CaM-Ca-bind-Ca PRODUCT n +addmsg /kinetics/PSD/Ca /kinetics/PSD/CaM/CaM-Ca-bind-Ca SUBSTRATE n +addmsg /kinetics/PSD/CaM/CaM-bind-Ca /kinetics/PSD/CaM/CaM-Ca REAC B A +addmsg /kinetics/PSD/CaM/CaM-Ca-bind-Ca /kinetics/PSD/CaM/CaM-Ca REAC A B +addmsg /kinetics/PSD/CaM/CaM-Ca3-bind-Ca /kinetics/PSD/CaM/CaM-Ca4 REAC B A +addmsg /kinetics/DEND/Ca_stim /kinetics/DEND/Ca REAC B A +addmsg /kinetics/DEND/CaM/CaM-bind-Ca /kinetics/DEND/Ca REAC A B +addmsg /kinetics/DEND/CaM/CaM-Ca-bind-Ca /kinetics/DEND/Ca REAC A B +addmsg /kinetics/DEND/CaM/CaM-Ca2-bind-Ca /kinetics/DEND/Ca REAC A B +addmsg /kinetics/DEND/CaM/CaM-Ca3-bind-Ca /kinetics/DEND/Ca REAC A B +addmsg /kinetics/DEND/Ca_stim /kinetics/DEND/Ca_input REAC A B +addmsg /kinetics/DEND/Ca_input /kinetics/DEND/Ca_stim SUBSTRATE n +addmsg /kinetics/DEND/Ca /kinetics/DEND/Ca_stim PRODUCT n +addmsg /kinetics/DEND/CaM/CaM-bind-Ca /kinetics/DEND/CaM/CaM REAC A B +addmsg /kinetics/DEND/CaM/CaM_x2 /kinetics/DEND/CaM/CaM REAC A B +addmsg /kinetics/DEND/CaM/CaM-Ca3 /kinetics/DEND/CaM/CaM-Ca3-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca4 /kinetics/DEND/CaM/CaM-Ca3-bind-Ca PRODUCT n +addmsg /kinetics/DEND/Ca /kinetics/DEND/CaM/CaM-Ca3-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca2-bind-Ca /kinetics/DEND/CaM/CaM-Ca3 REAC B A +addmsg /kinetics/DEND/CaM/CaM-Ca3-bind-Ca /kinetics/DEND/CaM/CaM-Ca3 REAC A B +addmsg /kinetics/DEND/CaM/CaM /kinetics/DEND/CaM/CaM-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca /kinetics/DEND/CaM/CaM-bind-Ca PRODUCT n +addmsg /kinetics/DEND/Ca /kinetics/DEND/CaM/CaM-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca2-bind-Ca /kinetics/DEND/CaM/CaM-Ca2 REAC A B +addmsg /kinetics/DEND/CaM/CaM-Ca-bind-Ca /kinetics/DEND/CaM/CaM-Ca2 REAC B A +addmsg /kinetics/DEND/CaM/CaM-Ca2 /kinetics/DEND/CaM/CaM-Ca2-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca3 /kinetics/DEND/CaM/CaM-Ca2-bind-Ca PRODUCT n +addmsg /kinetics/DEND/Ca /kinetics/DEND/CaM/CaM-Ca2-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca /kinetics/DEND/CaM/CaM-Ca-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-Ca2 /kinetics/DEND/CaM/CaM-Ca-bind-Ca PRODUCT n +addmsg /kinetics/DEND/Ca /kinetics/DEND/CaM/CaM-Ca-bind-Ca SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM-bind-Ca /kinetics/DEND/CaM/CaM-Ca REAC B A +addmsg /kinetics/DEND/CaM/CaM-Ca-bind-Ca /kinetics/DEND/CaM/CaM-Ca REAC A B +addmsg /kinetics/DEND/CaM/CaM-Ca3-bind-Ca /kinetics/DEND/CaM/CaM-Ca4 REAC B A +addmsg /kinetics/DEND/CaM/CaM /kinetics/DEND/CaM/CaM_x2 SUBSTRATE n +addmsg /kinetics/DEND/CaM/CaM_xchange /kinetics/DEND/CaM/CaM_x2 PRODUCT n +addmsg /kinetics/DEND/CaM/CaM_x2 /kinetics/DEND/CaM/CaM_xchange REAC B A +addmsg /kinetics/SPINE/CaM/CaM-bind-Ca /kinetics/SPINE/Ca REAC A B +addmsg /kinetics/SPINE/CaM/CaM-Ca-bind-Ca /kinetics/SPINE/Ca REAC A B +addmsg /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca /kinetics/SPINE/Ca REAC A B +addmsg /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca /kinetics/SPINE/Ca REAC A B +addmsg /kinetics/SPINE/CaM/CaM-bind-Ca /kinetics/SPINE/CaM/CaM REAC A B +addmsg /kinetics/SPINE/CaM/CaM_x2 /kinetics/SPINE/CaM/CaM REAC A B +addmsg /kinetics/SPINE/CaM/CaM-Ca3 /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca4 /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca PRODUCT n +addmsg /kinetics/SPINE/Ca /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca /kinetics/SPINE/CaM/CaM-Ca3 REAC B A +addmsg /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca /kinetics/SPINE/CaM/CaM-Ca3 REAC A B +addmsg /kinetics/SPINE/CaM/CaM /kinetics/SPINE/CaM/CaM-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca /kinetics/SPINE/CaM/CaM-bind-Ca PRODUCT n +addmsg /kinetics/SPINE/Ca /kinetics/SPINE/CaM/CaM-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca /kinetics/SPINE/CaM/CaM-Ca2 REAC A B +addmsg /kinetics/SPINE/CaM/CaM-Ca-bind-Ca /kinetics/SPINE/CaM/CaM-Ca2 REAC B A +addmsg /kinetics/SPINE/CaM/CaM-Ca2 /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca3 /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca PRODUCT n +addmsg /kinetics/SPINE/Ca /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca /kinetics/SPINE/CaM/CaM-Ca-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-Ca2 /kinetics/SPINE/CaM/CaM-Ca-bind-Ca PRODUCT n +addmsg /kinetics/SPINE/Ca /kinetics/SPINE/CaM/CaM-Ca-bind-Ca SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM-bind-Ca /kinetics/SPINE/CaM/CaM-Ca REAC B A +addmsg /kinetics/SPINE/CaM/CaM-Ca-bind-Ca /kinetics/SPINE/CaM/CaM-Ca REAC A B +addmsg /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca /kinetics/SPINE/CaM/CaM-Ca4 REAC B A +addmsg /kinetics/SPINE/CaM/CaM /kinetics/SPINE/CaM/CaM_x2 SUBSTRATE n +addmsg /kinetics/SPINE/CaM/CaM_xchange /kinetics/SPINE/CaM/CaM_x2 PRODUCT n +addmsg /kinetics/SPINE/CaM/CaM_x2 /kinetics/SPINE/CaM/CaM_xchange REAC B A +enddump +// End of dump + +call /kinetics/PSD/CaM/CaM/notes LOAD \ +"There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)" \ +"Say 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying" \ +"it is comparable to CaMK levels. " \ +"" +call /kinetics/PSD/CaM/CaM-Ca3-bind-Ca/notes LOAD \ +"Use K3 = 21.5 uM here from Stemmer and Klee table 3." \ +"kb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" \ +"24 Sep 2015" \ +"This is a bit too low affinity. Changing to match K2 at " \ +"Kd = 2.8." +call /kinetics/PSD/CaM/CaM-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +call /kinetics/PSD/CaM/CaM-Ca2/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +call /kinetics/PSD/CaM/CaM-Ca2-bind-Ca/notes LOAD \ +"K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get" \ +"kb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10" \ +"" +call /kinetics/PSD/CaM/CaM-Ca-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +call /kinetics/PSD/CaM/CaM-Ca/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +call /kinetics/DEND/CaM/CaM/notes LOAD \ +"There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)" \ +"Say 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying" \ +"it is comparable to CaMK levels. " \ +"" +call /kinetics/DEND/CaM/CaM-Ca3-bind-Ca/notes LOAD \ +"Use K3 = 21.5 uM here from Stemmer and Klee table 3." \ +"kb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" +call /kinetics/DEND/CaM/CaM-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +call /kinetics/DEND/CaM/CaM-Ca2/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +call /kinetics/DEND/CaM/CaM-Ca2-bind-Ca/notes LOAD \ +"K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get" \ +"kb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10" \ +"" +call /kinetics/DEND/CaM/CaM-Ca-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +call /kinetics/DEND/CaM/CaM-Ca/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +call /kinetics/SPINE/CaM/CaM/notes LOAD \ +"There is a LOT of this in the cell: upto 1% of total protein mass. (Alberts et al)" \ +"Say 25 uM. Meyer et al Science 256 1199-1202 1992 refer to studies saying" \ +"it is comparable to CaMK levels. " \ +"" +call /kinetics/SPINE/CaM/CaM-Ca3-bind-Ca/notes LOAD \ +"Use K3 = 21.5 uM here from Stemmer and Klee table 3." \ +"kb/kf =21.5 * 6e5 so kf = 7.75e-7, kb = 10" +call /kinetics/SPINE/CaM/CaM-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +call /kinetics/SPINE/CaM/CaM-Ca2/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +call /kinetics/SPINE/CaM/CaM-Ca2-bind-Ca/notes LOAD \ +"K3 = 21.5, K4 = 2.8. Assuming that the K4 step happens first, we get" \ +"kb/kf = 2.8 uM = 1.68e6 so kf =6e-6 assuming kb = 10" \ +"" +call /kinetics/SPINE/CaM/CaM-Ca-bind-Ca/notes LOAD \ +"Lets use the fast rate consts here. Since the rates are so different, I am not" \ +"sure whether the order is relevant. These correspond to the TR2C fragment." \ +"We use the Martin et al rates here, plus the Drabicowski binding consts." \ +"All are scaled by 3X to cell temp." \ +"kf = 2e-10 kb = 72" \ +"Stemmer & Klee: K1=.9, K2=1.1. Assume 1.0uM for both. kb/kf=3.6e11." \ +"If kb=72, kf = 2e-10 (Exactly the same !)" \ +"" \ +"19 May 2006. Splitting the old CaM-TR2-bind-Ca reaction into" \ +"two steps, each binding 1 Ca. This improves numerical" \ +"stability and is conceptually better too." \ +"" \ +"Overall rates are the same, so each kf and kb is the " \ +"square root of the earlier ones. So" \ +"kf = 1.125e-4, kb = 8.4853" \ +"" +call /kinetics/SPINE/CaM/CaM-Ca/notes LOAD \ +"This is the intermediate where the TR2 end (the high-affinity end) has" \ +"bound the Ca but the TR1 end has not." +complete_loading diff --git a/genesis/spineCa_diffn.g b/genesis/spineCa_diffn.g new file mode 100644 index 0000000000000000000000000000000000000000..8895c87bece74d7534a7a5440fdd8de719f23233 --- /dev/null +++ b/genesis/spineCa_diffn.g @@ -0,0 +1,151 @@ +//genesis +// kkit Version 11 flat dumpfile + +// Saved on Sun Aug 21 08:51:57 2016 + +include kkit {argv 1} + +FASTDT = 0.0001 +SIMDT = 0.001 +CONTROLDT = 10 +PLOTDT = 10 +MAXTIME = 1000 +TRANSIENT_TIME = 10 +VARIABLE_DT_FLAG = 1 +DEFAULT_VOL = 1e-20 +VERSION = 11.0 +setfield /file/modpath value /home2/bhalla/scripts/modules +kparms + +//genesis + +initdump -version 3 -ignoreorphans 1 +simobjdump doqcsinfo filename accessname accesstype transcriber developer \ + citation species tissue cellcompartment methodology sources \ + model_implementation model_validation x y z +simobjdump table input output alloced step_mode stepsize x y z +simobjdump xtree path script namemode sizescale +simobjdump xcoredraw xmin xmax ymin ymax +simobjdump xtext editable +simobjdump xgraph xmin xmax ymin ymax overlay +simobjdump xplot pixflags script fg ysquish do_slope wy +simobjdump group xtree_fg_req xtree_textfg_req plotfield expanded movealone \ + link savename file version md5sum mod_save_flag x y z +simobjdump geometry size dim shape outside xtree_fg_req xtree_textfg_req x y \ + z +simobjdump kpool DiffConst CoInit Co n nInit mwt nMin vol slave_enable \ + geomname xtree_fg_req xtree_textfg_req x y z +simobjdump kreac kf kb notes xtree_fg_req xtree_textfg_req x y z +simobjdump kenz CoComplexInit CoComplex nComplexInit nComplex vol k1 k2 k3 \ + keepconc usecomplex notes xtree_fg_req xtree_textfg_req link x y z +simobjdump stim level1 width1 delay1 level2 width2 delay2 baselevel trig_time \ + trig_mode notes xtree_fg_req xtree_textfg_req is_running x y z +simobjdump xtab input output alloced step_mode stepsize notes editfunc \ + xtree_fg_req xtree_textfg_req baselevel last_x last_y is_running x y z +simobjdump kchan perm gmax Vm is_active use_nernst notes xtree_fg_req \ + xtree_textfg_req x y z +simobjdump transport input output alloced step_mode stepsize dt delay clock \ + kf xtree_fg_req xtree_textfg_req x y z +simobjdump proto x y z +simobjdump text str +simundump geometry /kinetics/geometry 0 1e-20 3 sphere "" white black 0 0 0 +simundump geometry /kinetics/geometry[1] 0 1e-18 3 sphere "" white black 0 0 \ + 0 +simundump geometry /kinetics/geometry[2] 0 9e-20 3 sphere "" white black 0 0 \ + 0 +simundump text /kinetics/notes 0 "" +call /kinetics/notes LOAD \ +"" +simundump group /kinetics/PSD 0 20 black x 0 0 "" PSD defaultfile.g 0 0 0 27 \ + 12 0 +simundump text /kinetics/PSD/notes 0 "" +call /kinetics/PSD/notes LOAD \ +"" +simundump kpool /kinetics/PSD/Ca 0 2e-11 0.1 0.1 0.6 0.6 0 0 6 0 \ + /kinetics/geometry 53 0 -16 6 0 +simundump text /kinetics/PSD/Ca/notes 0 "" +call /kinetics/PSD/Ca/notes LOAD \ +"" +simundump kpool /kinetics/PSD/Ca_input 0 0 0.08 0.08 0.48 0.48 0 0 6 4 \ + /kinetics/geometry 55 black -10 2 0 +simundump text /kinetics/PSD/Ca_input/notes 0 "" +call /kinetics/PSD/Ca_input/notes LOAD \ +"" +simundump kreac /kinetics/PSD/Ca_stim 0 50 1 "" white black -13 4 0 +simundump text /kinetics/PSD/Ca_stim/notes 0 "" +call /kinetics/PSD/Ca_stim/notes LOAD \ +"" +simundump group /kinetics/DEND 0 13 black x 0 0 "" DEND defaultfile.g 0 0 0 \ + 11 -30 0 +simundump text /kinetics/DEND/notes 0 "" +call /kinetics/DEND/notes LOAD \ +"" +simundump kpool /kinetics/DEND/Ca 0 2e-11 0.08 0.08 48 48 0 0 600 0 \ + /kinetics/geometry 54 40 -8 -20 0 +simundump text /kinetics/DEND/Ca/notes 0 "" +call /kinetics/DEND/Ca/notes LOAD \ +"" +simundump kpool /kinetics/DEND/Ca_input 0 0 0.08 0.08 48 48 0 0 600 4 \ + /kinetics/geometry 55 40 -2 -20 0 +simundump text /kinetics/DEND/Ca_input/notes 0 "" +call /kinetics/DEND/Ca_input/notes LOAD \ +"" +simundump kreac /kinetics/DEND/Ca_stim 0 50 1 "" white 40 -5 -19 0 +simundump text /kinetics/DEND/Ca_stim/notes 0 "" +call /kinetics/DEND/Ca_stim/notes LOAD \ +"" +simundump group /kinetics/SPINE 0 5 black x 0 0 "" SPINE defaultfile.g 0 0 0 \ + 29 -23 0 +simundump text /kinetics/SPINE/notes 0 "" +call /kinetics/SPINE/notes LOAD \ +"" +simundump kpool /kinetics/SPINE/Ca 0 2e-11 0.11111 0.11111 6 6 0 0 54 0 \ + /kinetics/geometry[1] 50 yellow -12 -11 0 +simundump text /kinetics/SPINE/Ca/notes 0 "" +call /kinetics/SPINE/Ca/notes LOAD \ +"" +simundump text /kinetics/geometry/notes 0 "" +call /kinetics/geometry/notes LOAD \ +"" +simundump text /kinetics/geometry[1]/notes 0 "" +call /kinetics/geometry[1]/notes LOAD \ +"" +simundump text /kinetics/geometry[2]/notes 0 "" +call /kinetics/geometry[2]/notes LOAD \ +"" +simundump xgraph /graphs/conc1 0 0 2923 0 38.53 0 +simundump xgraph /graphs/conc2 0 0 2923 0 16.804 0 +simundump xgraph /moregraphs/conc3 0 0 2923 0 4 0 +simundump xgraph /moregraphs/conc4 0 0 2923 0 4 0 +simundump xcoredraw /edit/draw 0 -18 31 -32 14 +simundump xtree /edit/draw/tree 0 \ + /kinetics/#[],/kinetics/#[]/#[],/kinetics/#[]/#[]/#[][TYPE!=proto],/kinetics/#[]/#[]/#[][TYPE!=linkinfo]/##[] \ + "edit_elm.D <v>; drag_from_edit.w <d> <S> <x> <y> <z>" auto 0.6 +simundump xtext /file/notes 0 1 +xtextload /file/notes \ +"" \ +"4 Aug 2016: CaM_3compt.g: Based on CaMKII_merged91.g, just have" \ +"the CaM part in all 3 compartments, for merging." \ +"CaM_3compt1.g: Eliminated Ca and Ca input too." \ +"" \ +"4 Aug 2016: Merged CaM_3compt1.g into NN_mapk6.g, some " \ +"elimination of Ca buffer pools. All now handled by CaM." \ +"" \ +"15 Aug 2016: Doubled CaM levels throughout, use as a surrogate" \ +"for other Ca buffers." \ +"" \ +"21 Aug 2016: Ca in spine and dendrite for diffusive" \ +"calculations." \ +"" +addmsg /kinetics/PSD/Ca_stim /kinetics/PSD/Ca REAC B A +addmsg /kinetics/PSD/Ca_stim /kinetics/PSD/Ca_input REAC A B +addmsg /kinetics/PSD/Ca_input /kinetics/PSD/Ca_stim SUBSTRATE n +addmsg /kinetics/PSD/Ca /kinetics/PSD/Ca_stim PRODUCT n +addmsg /kinetics/DEND/Ca_stim /kinetics/DEND/Ca REAC B A +addmsg /kinetics/DEND/Ca_stim /kinetics/DEND/Ca_input REAC A B +addmsg /kinetics/DEND/Ca_input /kinetics/DEND/Ca_stim SUBSTRATE n +addmsg /kinetics/DEND/Ca /kinetics/DEND/Ca_stim PRODUCT n +enddump +// End of dump + +complete_loading diff --git a/parallelSolver/Fig2_v4.py b/parallelSolver/Fig2_v4.py new file mode 100644 index 0000000000000000000000000000000000000000..87888ade01d5bd32d0bf8e46279ac3501486e6b8 --- /dev/null +++ b/parallelSolver/Fig2_v4.py @@ -0,0 +1,229 @@ +# Generates time-series response to a Ca pulse for each of the models. No +# diffusion involved. + +import sys +import numpy as np +import pylab +import matplotlib.pyplot as plt +import moose +import abstrModelEqns2 +import rdesigneur as rd +import time + + +def singleCompt( name, params ): + mod = moose.copy( '/library/' + name + '/' + name, '/model' ) + A = moose.element( mod.path + '/A' ) + Z = moose.element( mod.path + '/Z' ) + Z.nInit = 1 + Ca = moose.element( mod.path + '/Ca' ) + CaStim = moose.element( Ca.path + '/CaStim' ) + runtime = params['preStimTime'] + params['stimWidth'] + params['postStimTime'] + steptime = 100 + + CaStim.expr += ' + x2 * (t > ' + str( runtime ) + ' ) * ( t < ' + str( runtime + steptime ) + ' )' + print CaStim.expr + tab = moose.Table2( '/model/' + name + '/Atab' ) + #for i in range( 10, 19 ): + #moose.setClock( i, 0.01 ) + ampl = moose.element( mod.path + '/ampl' ) + phase = moose.element( mod.path + '/phase' ) + moose.connect( tab, 'requestOut', A, 'getN' ) + ampl.nInit = params['stimAmplitude'] * 1 + phase.nInit = params['preStimTime'] + + ksolve = moose.Ksolve( mod.path + '/ksolve' ) + stoich = moose.Stoich( mod.path + '/stoich' ) + stoich.compartment = mod + stoich.ksolve = ksolve + stoich.path = mod.path + '/##' + runtime += 2 * steptime + + moose.reinit() + moose.start( runtime ) + t = np.arange( 0, runtime + 1e-9, tab.dt ) + return name, t, tab.vector + #pylab.plot( t, tab.vector, label='[A] (mM)' ) + + #pylab.show() + +def plotBoilerplate( panelTitle, plotPos, xlabel = ''): + ax = plt.subplot( 8,4,plotPos ) + #ax.xaxis.set_ticks( i[1] ) + #ax.locator_params( + ax.spines['top'].set_visible( False ) + ax.spines['right'].set_visible( False ) + ax.tick_params( direction = 'out' ) + if (((plotPos -1)/4) % 2) == 0: + ax.set_xticklabels([]) + else: + ax.set_xlabel( xlabel ) + for tick in ax.xaxis.get_major_ticks(): + tick.tick2On = False + for tick in ax.yaxis.get_major_ticks(): + tick.tick2On = False + + if (plotPos % 4) == 1: + plt.ylabel( 'conc', fontsize = 16 ) + # alternate way of doing this separately. + #plt.yaxis.label.size_size(16) + #plt.title( 'B' ) + ax.text( -0.3, 1, panelTitle, fontsize = 18, weight = 'bold', + transform=ax.transAxes ) + return ax + +def plotPanelB(): + panelB = [] + panelBticks = [] + panelB.append( singleCompt( 'fhn', abstrModelEqns2.makeFHN() ) ) + panelB.append( singleCompt( 'bis', abstrModelEqns2.makeBis() ) ) + panelB.append( singleCompt( 'negFB', abstrModelEqns2.makeNegFB() ) ) + panelB.append( singleCompt( 'negFF', abstrModelEqns2.makeNegFF() ) ) + + panelBticks.append( np.arange( 0, 4.00001, 1 ) ) + panelBticks.append( np.arange( 0, 4.00001, 1 ) ) + panelBticks.append( np.arange( 0, 15.00001, 5 ) ) + panelBticks.append( np.arange( 0, 6.00001, 2 ) ) + moose.delete( '/model' ) + + for i in zip( panelB, panelBticks, range( len( panelB ) ) ): + plotPos = i[2] + 5 + ax = plotBoilerplate( 'B', plotPos ) + plt.plot( i[0][1], i[0][2] ) + xmax = ax.get_xlim()[1] + #ax.xaxis.set_ticks( np.arange( 0, xmax, 50 ) ) + ax.xaxis.set_ticks( np.arange( 0, 200.001, 50 ) ) + ax.yaxis.set_ticks( i[1] ) + +def runPanelCDEF( name, dist, seqDt, numSpine, seq, stimAmpl ): + preStim = 10.0 + blanks = 20 + rdes = rd.rdesigneur( + useGssa = False, + turnOffElec = True, + chemPlotDt = 0.1, + #diffusionLength = params['diffusionLength'], + diffusionLength = 1e-6, + cellProto = [['cell', 'soma']], + chemProto = [['dend', name]], + chemDistrib = [['dend', 'soma', 'install', '1' ]], + plotList = [['soma', '1', 'dend' + '/A', 'n', '# of A']], + ) + rdes.buildModel() + #for i in range( 20 ): + #moose.setClock( i, 0.02 ) + A = moose.vec( '/model/chem/dend/A' ) + Z = moose.vec( '/model/chem/dend/Z' ) + print moose.element( '/model/chem/dend/A/Adot' ).expr + print moose.element( '/model/chem/dend/B/Bdot' ).expr + print moose.element( '/model/chem/dend/Ca/CaStim' ).expr + phase = moose.vec( '/model/chem/dend/phase' ) + ampl = moose.vec( '/model/chem/dend/ampl' ) + vel = moose.vec( '/model/chem/dend/vel' ) + vel.nInit = 1e-6 * seqDt + ampl.nInit = stimAmpl + stride = int( dist ) / numSpine + phase.nInit = 10000 + Z.nInit = 0 + for j in range( numSpine ): + k = blanks + j * stride + Z[k].nInit = 1 + phase[k].nInit = preStim + seq[j] * seqDt + moose.reinit() + runtime = 50 + snapshot = preStim + seqDt * (numSpine - 0.8) + print snapshot + #snapshot = 26 + moose.start( snapshot ) + avec = moose.vec( '/model/chem/dend/A' ).n + moose.start( runtime - snapshot ) + tvec = [] + for i in range( 5 ): + tab = moose.element( '/model/graphs/plot0[' + str( blanks + i * stride ) + ']' ) + dt = tab.dt + tvec.append( tab.vector ) + moose.delete( '/model' ) + return dt, tvec, avec + +def makePassiveSoma( name, length, diameter ): + elecid = moose.Neuron( '/library/' + name ) + dend = moose.Compartment( elecid.path + '/soma' ) + dend.diameter = diameter + dend.length = length + dend.x = length + return elecid + +def plotOnePanel( tLabel, dt, tplot, numSyn, plotRange, tick ): + t = np.arange( 0, len( tplot[0] ), 1.0 ) * dt + ax = plotBoilerplate( tLabel, 1 + start ) + for i in range( 5 ): + plt.plot( t, tplot[i] ) + ax.yaxis.set_ticks( np.arange( 0, plotRange, tick ) ) + + +def plotPanelCDEF( seq, row ): + makePassiveSoma( 'cell', 100e-6, 10e-6 ) + start = (row -1) * 4 + tLabel = chr( ord( 'A' ) + row - 1 ) + xLabel = chr( ord( 'C' ) + row - 1 ) + xplot = [] + #dt, tplot, avec = runPanelCDEF( 'fhn', 15.0, 3.0, 5, seq, 0.4 ) + dt, tplot, avec = runPanelCDEF( 'fhn', 5.0, 0.5, 5, seq, 0.4 ) + xplot.append( avec ) + #plotOnePanel( dt, 'B', tplot, 5, 1.5, 0.5 ) + t = np.arange( 0, len( tplot[0] ), 1.0 ) * dt + #ax = plotBoilerplate( tLabel, 1 + start ) + ax = plotBoilerplate( tLabel, 1 + start, 'Time (s)') + for i in range( 5 ): + plt.plot( t, tplot[i] ) + yl = ax.get_ylim()[1] + ax.yaxis.set_ticks( np.arange( 0, 4.0001, 1.0 ) ) + + #dt, tplot, avec = runPanelCDEF( 'bis', 5.0, 4.0, 5, seq, 1.0 ) + dt, tplot, avec = runPanelCDEF( 'bis', 15.0, 2.0, 5, seq, 1.0 ) + xplot.append( avec ) + t = np.arange( 0, len( tplot[0] ), 1.0 ) * dt + ax = plotBoilerplate( tLabel, 2 + start, 'Time (s)' ) + for i in range( 5 ): + plt.plot( t, tplot[i] ) + yl = ax.get_ylim()[1] + ax.yaxis.set_ticks( np.arange( 0, 3.0001, 1.0 ) ) + + dt, tplot, avec = runPanelCDEF( 'negFB', 5.0, 2.0, 5, seq, 1.0 ) + xplot.append( avec ) + t = np.arange( 0, len( tplot[0] ), 1.0 ) * dt + ax = plotBoilerplate( tLabel, 3 + start, 'Time (s)') + for i in range( 5 ): + plt.plot( t, tplot[i] ) + ax.yaxis.set_ticks( np.arange( 0, 10.00001, 5.0 ) ) + + dt, tplot, avec = runPanelCDEF( 'negFF', 5.0, 4.0, 5, seq, 1.0 ) + xplot.append( avec ) + t = np.arange( 0, len( tplot[0] ), 1.0 ) * dt + ax = plotBoilerplate( tLabel, 4 + start, 'Time (s)') + for i in range( 5 ): + plt.plot( t, tplot[i] ) + ax.yaxis.set_ticks( np.arange( 0, 5.00001, 2.0 ) ) + + for i in zip( range(4), (4.0, 3.0, 10, 4 ), (1, 1, 5, 2) ): + ax = plotBoilerplate( xLabel, 9 + start + i[0], 'Position( um)' ) + plt.plot( xplot[i[0]][:50] ) + ax.yaxis.set_ticks( np.arange( 0, i[1] * 1.0000001, i[2] ) ) + +################################################################## +if __name__ == '__main__': + moose.Neutral( '/library' ) + moose.Neutral( '/model' ) + + t1 = time.time() + fig = plt.figure( figsize = (10,10), facecolor='white' ) + fig.subplots_adjust( left = 0.18 ) + plotPanelB() + plotPanelCDEF( [0,1,2,3,4], 3 ) + plotPanelCDEF( [4,1,0,3,2], 4 ) + print ("Time taken = ", time.time() - t1) + plt.tight_layout() + + plt.show() + + diff --git a/parallelSolver/README b/parallelSolver/README new file mode 100644 index 0000000000000000000000000000000000000000..eaae6144aaa1ce3c40bbd2885242ce9892112eea --- /dev/null +++ b/parallelSolver/README @@ -0,0 +1,14 @@ +Parallel solvers are implemented for Ksolve, Dsolve and Gsolve. + +Instructions to run the solvers in parallel. + +1) Clone the repository from github/BhallaLab/moose-core/tree/multithreaded + i.e., the multithreaded branch of the moose-core. + +2) Build the code, compile and run it. + +3) Set the environment variable NUM_THREADS to the number of threads with which you want to execute your script. + +4) The environment variable has to be set to make use of the parallelization. It runs with 1 thread by default(sequential). + +3) Run your python script regularly. The framwork will pick up the number of threads set by you and parallelize the solvers using them. diff --git a/parallelSolver/abstrModelEqns2.py b/parallelSolver/abstrModelEqns2.py new file mode 100644 index 0000000000000000000000000000000000000000..42ce9e51e789a3f70b2045dd957cae09b0a6e8d0 --- /dev/null +++ b/parallelSolver/abstrModelEqns2.py @@ -0,0 +1,219 @@ +import re +import moose +# Equations here are: +# Adot = 1 -6A + 5A^2 - A^3, or spread out as: +# Adot = k0a + k1a.A + k2a.A.A + k3a.A.A.A + k4a.Ca.A/(1+A+10*B) - k5a.A.B +# Bdot = k1b.A - k2b.B +# + + +def parseExpr( expr, params, hasCa ): + if hasCa: + expr = expr.replace( 'Ca', 'x0' ) + expr = expr.replace( 'A', 'x1' ) + expr = expr.replace( 'B', 'x2' ) + else: + expr = expr.replace( 'Ca', 'x0' ) # happens in the negFF model + expr = expr.replace( 'A', 'x0' ) # This is the usual case. + expr = expr.replace( 'B', 'x1' ) + + parts = re.split( 'k', expr ) + ret = parts[0] + for i in parts[1:]: + ret += str( params[ 'k' + i[:2] ] ) + ret += i[2:] + + if hasCa: + return 'x3*( ' + ret + ')' + else: + return 'x2*( ' + ret + ')' + +def makeChemProto( name, Aexpr, Bexpr, params ): + sw = params['stimWidth'] + diffLength = params['diffusionLength'] + dca = params['diffConstA'] * diffLength * diffLength + dcb = params['diffConstB'] * diffLength * diffLength + + # Objects + chem = moose.Neutral( '/library/' + name ) + compt = moose.CubeMesh( '/library/' + name + '/' + name ) + A = moose.Pool( compt.path + '/A' ) + B = moose.Pool( compt.path + '/B' ) + Z = moose.BufPool( compt.path + '/Z' ) + Ca = moose.BufPool( compt.path + '/Ca' ) + phase = moose.BufPool( compt.path + '/phase' ) + vel = moose.BufPool( compt.path + '/vel' ) + ampl = moose.BufPool( compt.path + '/ampl' ) + Adot = moose.Function( A.path + '/Adot' ) + Bdot = moose.Function( B.path + '/Bdot' ) + CaStim = moose.Function( Ca.path + '/CaStim' ) + A.diffConst = dca + B.diffConst = dcb + + # Equations + + Adot.expr = parseExpr( Aexpr, params, True ) + Bdot.expr = parseExpr( Bexpr, params, False ) + CaStim.expr = 'x2 * exp( -((x0 - t)^2)/(2* ' + str(sw*sw) + ') )' + + print Adot.expr + print Bdot.expr + print CaStim.expr + + # Connections + Adot.x.num = 4 + moose.connect( Ca, 'nOut', Adot.x[0], 'input' ) + moose.connect( A, 'nOut', Adot.x[1], 'input' ) + moose.connect( B, 'nOut', Adot.x[2], 'input' ) + moose.connect( Z, 'nOut', Adot.x[3], 'input' ) + moose.connect( Adot, 'valueOut', A, 'increment' ) + + Bdot.x.num = 3 + if name == 'negFF': + moose.connect( Ca, 'nOut', Bdot.x[0], 'input' ) + else: + moose.connect( A, 'nOut', Bdot.x[0], 'input' ) + moose.connect( B, 'nOut', Bdot.x[1], 'input' ) + moose.connect( Z, 'nOut', Bdot.x[2], 'input' ) + moose.connect( Bdot, 'valueOut', B, 'increment' ) + + CaStim.x.num = 3 + moose.connect( phase, 'nOut', CaStim.x[0], 'input' ) + moose.connect( vel, 'nOut', CaStim.x[1], 'input' ) + moose.connect( ampl, 'nOut', CaStim.x[2], 'input' ) + moose.connect( CaStim, 'valueOut', Ca, 'setN' ) + + return compt + + +def makeBis(): + params = { + 'k0a':0.1, # Constant + 'k1a':-5.0, # Coeff for A + 'k2a':5.0, # Coeff for A^2 + 'k3a':-1.0, # Coeff for A^3 + 'k4a':10.0, # turnon of A by A and Ca + 'k5a':-5.0, # Turnoff of A by B + 'k1b':0.1, # turnon of B by A + 'k2b':-0.01, # Decay rate of B + 'diffusionLength':1.0e-6, # Diffusion characteristic length, used as voxel length too. + 'dendDiameter': 10e-6, # Diameter of section of dendrite in model + 'dendLength': 100e-6, # Length of section of dendrite in model + 'diffConstA':1.0, # Diffusion constant of A + 'diffConstB':1.0, # Diffusion constant of B + 'stimWidth' :5.0, # Stimulus width in seconds + 'stimAmplitude':1.0, # Stimulus amplitude, arb units. From FHN review + 'blankVoxelsAtEnd':10, # of voxels to leave blank at end of cylinder + 'preStimTime':40.0, # Time to run before turning on stimulus. + 'postStimTime':80.0, # Time to run after stimulus. ~3x decay time + 'settleTime':20.0, # Settling time of response, after stimulus. + # To include in analysis of total response over + # entire dendrite. + 'fnumber':1, # Number to append to fname + } + + makeChemProto( 'bis', + 'k0a + k1a*A + k2a*A*A + k3a*A*A*A + k4a*Ca*A/(1+A+10*B) + k5a*A*B', + 'k1b*A*A + k2b*B', + params ) + return params + +def makeFHN(): + params = { + 'k_t':2.5, # Time-const. + 'k_a':0.7, # Coeff1 + 'k_b':0.8, # Coeff2 + 'kxa': 2.0, # Offset for V for FHN eqns. + 'kxb': 0.8, # Offset for W for FHN eqns. + 'diffusionLength':1.0e-6, # Diffusion characteristic length, used as voxel length too. + 'dendDiameter': 10e-6, # Diameter of section of dendrite in model + 'dendLength': 100e-6, # Length of section of dendrite in model + 'diffConstA':7.5, # Diffusion constant of A + 'diffConstB':5.0, # Diffusion constant of B + 'stimWidth' :1.0, # Stimulus width in seconds + 'stimAmplitude':0.4, # Stimulus amplitude, arb units. From FHN review + 'blankVoxelsAtEnd':10, # of voxels to leave blank at end of cylinder + 'preStimTime':30.0, # Time to run before turning on stimulus. + 'postStimTime':40.0, # Time to run after stimulus. ~3x decay time + 'settleTime':20.0, # Settling time of response, after stimulus. + # To include in analysis of total response over + # entire dendrite. + 'fnumber': 1, # Number to append to fname + } + makeChemProto( 'fhn', + '5.0*(A - kxa - (A-kxa)^3/3 - (B-kxb) + Ca)', + '(A-kxa + k_a - k_b*(B-kxb))/k_t', + params ) + return params + + +def makeNegFB(): + params = { + 'k1a':-0.1, # Coeff for decay of A, slow. + 'k2a':-0.2, # Coeff for turnoff of A by B, medium. + 'k3a':10.0, # turnon of A by Ca, fast. + 'k1b':0.2, # turnon of B by A, medium + 'k2b':-0.1, # Decay rate of B, slow + 'diffusionLength':1.0e-6, # Diffusion characteristic length, used as voxel length too. + 'dendDiameter': 10e-6, # Diameter of section of dendrite in model + 'dendLength': 100e-6, # Length of section of dendrite in model + 'diffConstA':0.5, # Diffusion constant of A + 'diffConstB':1.0, # Diffusion constant of B + 'stimWidth' :1.0, # Stimulus width in seconds + 'stimAmplitude':1.0, # Stimulus amplitude, arb units. From FHN review + 'blankVoxelsAtEnd':10, #of voxels to leave blank at end of cylinder + 'preStimTime':10.0, # Time to run before turning on stimulus. + 'postStimTime':60.0, # Time to run after stimulus. ~3x decay time + 'settleTime':20.0, # Settling time of response, after stimulus. + # To include in analysis of total response over + # entire dendrite. + 'fnumber':1, # Number to append to fname + } + makeChemProto( 'negFB', + 'k1a*A + k2a*A*B + k3a*Ca', + 'k1b*A + k2b*B', + params ) + return params + + +def makeNegFF(): + params = { + 'k1a':-0.1, # Coeff for decay of A, slow. + 'k2a':-1.0, # Coeff for turnoff of A by B, medium. + 'k3a':10.0, # turnon of A by Ca, fast. + 'k1b':2.0, # turnon of B by Ca, medium + 'k2b':-0.1, # Decay rate of B, slow + 'diffusionLength':1.0e-6, # Diffusion characteristic length, used as voxel length too. + 'dendDiameter': 10e-6, # Diameter of section of dendrite in model + 'dendLength': 100e-6, # Length of section of dendrite in model + 'diffConstA':1.0, # Diffusion constant of A + 'diffConstB':2.0, # Diffusion constant of B + 'stimWidth' :1.0, # Stimulus width in seconds + 'stimAmplitude':1.0, # Stimulus amplitude, arb units. From FHN review + 'blankVoxelsAtEnd':10, # of voxels to leave blank at end of cylinder + 'preStimTime':10.0, # Time to run before turning on stimulus. + 'postStimTime':60.0, # Time to run after stimulus. ~3x decay time + 'settleTime':20.0, # Settling time of response, after stimulus. + # To include in analysis of total response over + # entire dendrite. + 'fnumber':1, # Number to append to fname + } + makeChemProto( 'negFF', + 'k1a*A + k2a*A*B + k3a*Ca', + 'k1b*Ca + k2b*B', + params ) + + return params + +if __name__ == '__main__': + moose.Neutral( '/library' ) + print "Making Bistable model" + makeBis() + print "Making FHN model" + makeFHN() + print "Making Negative Feedback model" + makeNegFB() + print "Making Negative Feedforward model" + makeNegFF() + + diff --git a/snippets/convert_Genesis2Sbml.py b/snippets/convert_Genesis2Sbml.py index d8d1a283f1647100beb2f9b873a8bb9a4b3b254a..8f42aee8838a85c4e5ce40d24fa9cb4d5caa1095 100644 --- a/snippets/convert_Genesis2Sbml.py +++ b/snippets/convert_Genesis2Sbml.py @@ -6,7 +6,7 @@ # Maintainer: # Created: Mon Jan 19 09:16:58 2015 (+0530) # Version: -# Last-Updated: Thr Dec 24 15:155:38 2012 (+0530) +# Last-Updated: Mon Nov 7 15:155:38 2012 (+0530) # By: Harsha Rani # Update #: # URL: @@ -46,6 +46,7 @@ # Code: import moose +from moose.SBML import * def main(): """This example illustrates loading a kinetic model defined in Genesis format into Moose using loadModel function and using writeSBML function @@ -56,7 +57,8 @@ def main(): moose.loadModel('../genesis/Kholodenko.g','/Kholodenko') #Writes model to xml file - moose.writeSBML('/Kholodenko','Kholodenko_tosbml.xml') + written = mooseWriteSBML('/Kholodenko','../genesis/Kholodenko_tosbml.xml') + print written if __name__ == '__main__': main() diff --git a/snippets/loadSbmlmodel.py b/snippets/loadSbmlmodel.py index 5ec6696daab47b75142e4bd4b9f33980db5bf54d..2781d9fcfaecd7fb864e1119326dd316a8394e1c 100644 --- a/snippets/loadSbmlmodel.py +++ b/snippets/loadSbmlmodel.py @@ -42,6 +42,8 @@ import numpy as np import matplotlib.pyplot as plt import sys import pylab +from moose.SBML import * +import os.path def main(): """ This example illustrates loading, running of an SBML model defined in XML format.\n @@ -51,37 +53,43 @@ def main(): As a general rule we created model under '/path/model' and plots under '/path/graphs'.\n """ - mfile = '../genesis/00001-sbml-l3v1.xml' - runtime = 20.0 - - if (len(sys.argv) >= 3): - if sys.argv[1][0]=='/': - mfile = sys.argv[1] - else: - mfile = '../genesis/'+sys.argv[1] - + mfile = "../genesis/00001-sbml-l3v1.xml" + try: + sys.argv[1] + except: + pass + else: + mfile = sys.argv[1] + + try: + sys.argv[2] + except: + runtime = 20.0 + else: runtime = float(sys.argv[2]) - - # Loading the sbml file into MOOSE, models are loaded in path/model - sbmlId = moose.readSBML(mfile,'sbml') + # Loading the sbml file into MOOSE, models are loaded in path/model + sbmlId = mooseReadSBML(mfile,'/sbml') + + if sbmlId.path != '/': + s1 = moose.element('/sbml/model/compartment/S1') + s2= moose.element('/sbml/model/compartment/S2') + + # Creating MOOSE Table, Table2 is for the chemical model + graphs = moose.Neutral( '/sbml/graphs' ) + outputs1 = moose.Table2 ( '/sbml/graphs/concS1') + outputs2 = moose.Table2 ( '/sbml/graphs/concS2') - s1 = moose.element('/sbml/model/compartment/S1') - s2= moose.element('/sbml/model/compartment/S2') - - # Creating MOOSE Table, Table2 is for the chemical model - graphs = moose.Neutral( '/sbml/graphs' ) - outputs1 = moose.Table2 ( '/sbml/graphs/concS1') - outputs2 = moose.Table2 ( '/sbml/graphs/concS2') - - # connect up the tables - moose.connect( outputs1,'requestOut', s1, 'getConc' ); - moose.connect( outputs2,'requestOut', s2, 'getConc' ); + # connect up the tables + moose.connect( outputs1,'requestOut', s1, 'getConc' ); + moose.connect( outputs2,'requestOut', s2, 'getConc' ); - - # Reset and Run - moose.reinit() - moose.start(runtime) + + # Reset and Run + moose.reinit() + moose.start(runtime) + return sbmlId,True + return sbmlId,False def displayPlots(): # Display all plots. @@ -95,5 +103,6 @@ def displayPlots(): quit() if __name__=='__main__': - main() - displayPlots() + modelPath, modelpathexist = main() + if modelpathexist == True: + displayPlots() diff --git a/snippets/nsdf_vec.py b/snippets/nsdf_vec.py index e96b3345d43c7ecc5304ee431e45a73ff745660b..879c26d08ea1e03d96ed57448bbf0daadc934e55 100644 --- a/snippets/nsdf_vec.py +++ b/snippets/nsdf_vec.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Sat Dec 19 22:27:27 2015 (-0500) # Version: -# Last-Updated: Tue Dec 29 12:50:02 2015 (-0500) +# Last-Updated: Thu Aug 11 11:09:33 2016 (-0400) # By: Subhasis Ray -# Update #: 134 +# Update #: 135 # URL: # Keywords: # Compatibility: @@ -100,7 +100,7 @@ def write_nsdf(): pulse.delay[0] = 5 * (ii+1) pulse.width[0] = 20 t_lead.threshold = 0.5 - moose.connect(pulse, 'output', t_lead,'Vm'); + moose.connect(pulse, 'output', t_lead,'Vm') moose.connect(nsdf, 'requestOut', pulse, 'getOutputValue') # ei = nsdf.eventInput[ii] # moose.connect(t_lead, 'spikeOut', ei, 'input') diff --git a/snippets/savemodel.py b/snippets/savemodel.py index 421908594679e9eaebce7d1ec0d7e5b12b94935d..bf29b914d6a3c8f7c2cdcd7f4929e9b7f21f9ef3 100644 --- a/snippets/savemodel.py +++ b/snippets/savemodel.py @@ -52,8 +52,10 @@ save the model back to Genesis format import sys #sys.path.append('../../python') import moose +from moose.genesis import * if __name__ == '__main__': """ The script demonstates to convert Chemical (Genesis) file back to Genesis file using moose """ model = moose.loadModel('../genesis/reaction.g', '/model') - moose.saveModel('/model', 'testsave.g') \ No newline at end of file + written = write('/model', 'testsave.g') + print written diff --git a/traub_2005/py/cell_test_util.py b/traub_2005/py/cell_test_util.py index 9af0750928a2b8ead35c8e24a0db1f37d0f8315f..d0ba68e43263fec3b64ca4406f50d71bac9b4f4e 100644 --- a/traub_2005/py/cell_test_util.py +++ b/traub_2005/py/cell_test_util.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Mon Oct 15 15:03:09 2012 (+0530) # Version: -# Last-Updated: Thu Jul 18 18:36:07 2013 (+0530) +# Last-Updated: Sat Aug 6 15:33:12 2016 (-0400) # By: subha -# Update #: 299 +# Update #: 303 # URL: # Keywords: # Compatibility: @@ -28,6 +28,7 @@ # # Code: +from __future__ import print_function from datetime import datetime import time @@ -71,7 +72,7 @@ def setup_current_step_model(model_container, solver: str - numerical method to use, can be `hsolve` or `ee` """ classname = 'cells.%s' % (celltype) - print 'mc=', model_container, 'dc=', data_container, 'ct=', celltype, 'pa=', pulsearray, 'classname=', classname + print('mc=', model_container, 'dc=', data_container, 'ct=', celltype, 'pa=', pulsearray, 'classname=', classname) cell_class = eval(classname) cell = cell_class('%s/%s' % (model_container.path, celltype)) pulsegen = moose.PulseGen('%s/pulse' % (model_container.path)) @@ -205,7 +206,7 @@ class SingleCellCurrentStepTest(unittest.TestCase): pylab.plot(nrn_data[nrn_indices,0], nrn_data[nrn_indices,1], label='Vm (mV) - neuron') except IOError: - print 'No neuron data found.' + print('No neuron data found.') pylab.legend() pylab.subplot(212) pylab.title('Presynaptic Vm') @@ -220,7 +221,7 @@ class SingleCellCurrentStepTest(unittest.TestCase): pylab.plot(nrn_data[nrn_indices,0], nrn_data[nrn_indices,1], label='Vm (mV) - neuron') except IOError: - print 'No neuron data found.' + print('No neuron data found.') pylab.legend() pylab.show() diff --git a/traub_2005/py/cells.py b/traub_2005/py/cells.py index 5818e042105d3111e313cb055eb5fb4100ce492c..530029c8007334e8d4719e3462879bb86e544480 100644 --- a/traub_2005/py/cells.py +++ b/traub_2005/py/cells.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Fri Mar 9 23:17:17 2012 (+0530) # Version: -# Last-Updated: Fri Jul 10 15:56:23 2015 (+0530) +# Last-Updated: Sat Aug 6 15:25:57 2016 (-0400) # By: subha -# Update #: 692 +# Update #: 694 # URL: # Keywords: # Compatibility: @@ -28,7 +28,7 @@ # # Code: - +from __future__ import print_function import csv import numpy as np from collections import defaultdict @@ -90,7 +90,7 @@ def read_keyvals(filename): if not tokens: continue if len(tokens) != 2: - print filename, ' - Tokens: ', tokens, len(tokens) + print(filename, ' - Tokens: ', tokens, len(tokens)) return None ret[tokens[1]].add(tokens[0]) except IOError: diff --git a/traub_2005/py/channel_test_util.py b/traub_2005/py/channel_test_util.py index 23c3f99d0df41da073510b82f14ec7619ad95de2..29f70c383b0869b3f60241345fae687a29cd0350 100644 --- a/traub_2005/py/channel_test_util.py +++ b/traub_2005/py/channel_test_util.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Wed May 30 23:51:58 2012 (+0530) # Version: -# Last-Updated: Sun Jun 3 20:07:30 2012 (+0530) +# Last-Updated: Sat Aug 6 15:26:45 2016 (-0400) # By: subha -# Update #: 115 +# Update #: 125 # URL: # Keywords: # Compatibility: @@ -27,6 +27,8 @@ # # Code: +from __future__ import print_function + import uuid import unittest import numpy as np @@ -49,24 +51,24 @@ def run_single_channel(channelname, Gbar, simtime, simdt=testutils.SIMDT, plotdt testutils.setup_clocks(simdt, plotdt) testutils.assign_clocks(model_container, data_container) moose.reinit() - print 'Starting simulation', testId, 'for', simtime, 's' + print('Starting simulation', testId, 'for', simtime, 's') moose.start(simtime) - print 'Finished simulation' + print('Finished simulation') vm_file = 'data/%s_Vm.dat' % (channelname) gk_file = 'data/%s_Gk.dat' % (channelname) ik_file = 'data/%s_Ik.dat' % (channelname) tseries = np.array(range(len(vm_data.vector))) * simdt - print 'Vm:', len(vm_data.vector), 'Gk', len(gk_data.vector), 'Ik', len(ik_data.vector) + print('Vm:', len(vm_data.vector), 'Gk', len(gk_data.vector), 'Ik', len(ik_data.vector)) data = np.c_[tseries, vm_data.vector] np.savetxt(vm_file, data) - print 'Saved Vm in', vm_file - print len(gk_data.vector), len(vm_data.vector) + print('Saved Vm in', vm_file) + print(len(gk_data.vector), len(vm_data.vector)) data = np.c_[tseries, gk_data.vector] np.savetxt(gk_file, data) - print 'Saved Gk in', gk_file + print('Saved Gk in', gk_file) data = np.c_[tseries, ik_data.vector] np.savetxt(ik_file, data) - print 'Saved Gk in', ik_file + print('Saved Gk in', ik_file) return params def compare_channel_data(series, channelname, param, simulator, x_range=None, plot=False): @@ -79,7 +81,7 @@ def compare_channel_data(series, channelname, param, simulator, x_range=None, pl try: ref_series = np.loadtxt(ref_file) except IOError, e: - print e + print(e) return -1.0 if plot: plt.figure() diff --git a/traub_2005/py/channelinit.py b/traub_2005/py/channelinit.py index 4573920ae3e44af4bb87ea92bc177f9005c93609..1b9b34bcff9834ec3c0ec4c2052af5820f204e2d 100644 --- a/traub_2005/py/channelinit.py +++ b/traub_2005/py/channelinit.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Wed May 23 21:24:11 2012 (+0530) # Version: -# Last-Updated: Fri May 25 11:42:08 2012 (+0530) +# Last-Updated: Sat Aug 6 14:35:20 2016 (-0400) # By: subha -# Update #: 74 +# Update #: 75 # URL: # Keywords: # Compatibility: @@ -53,6 +53,7 @@ def init_chanlib(): _channels.update(archan.initARChannelPrototypes()) _channels.update(cachans.initCaChannelPrototypes()) _channels.update(capool.initCaPoolPrototypes()) + _channels['spike'] = moose.SpikeGen('{}/spike'.format(config.modelSettings.libpath)) return _channels init_chanlib() diff --git a/traub_2005/py/config.py b/traub_2005/py/config.py index ea4a136cb96f695ebb5df6df9ca81082222fb771..7569af2d3e61545d38f5ac6edb9682df3eec4377 100644 --- a/traub_2005/py/config.py +++ b/traub_2005/py/config.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Wed May 23 11:31:40 2012 (+0530) # Version: -# Last-Updated: Wed Jun 12 15:33:57 2013 (+0530) +# Last-Updated: Sat Aug 6 15:25:16 2016 (-0400) # By: subha -# Update #: 128 +# Update #: 130 # URL: # Keywords: # Compatibility: @@ -28,6 +28,8 @@ # # Code: + +from __future__ import print_function import settings import os @@ -121,7 +123,7 @@ if not os.access(data_dir_prefix, os.F_OK): data_dir = os.path.join(data_dir_prefix, timestamp.strftime('%Y_%m_%d')) if not os.access(data_dir, os.F_OK): os.mkdir(data_dir) -print 'data_dir =', data_dir +print('data_dir =', data_dir) filename_suffix = '_%s_%d' % (timestamp.strftime('%Y%m%d_%H%M%S'), mypid) def handleError(self, record): diff --git a/traub_2005/py/deadlock_bug.py b/traub_2005/py/deadlock_bug.py index f7a70ccac4618260ab6df5046c1e47e03eed0fb3..d876cd7da438208f490f2c6fed70495d24970b95 100644 --- a/traub_2005/py/deadlock_bug.py +++ b/traub_2005/py/deadlock_bug.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Mon Jul 16 22:34:26 2012 (+0530) # Version: -# Last-Updated: Mon Jul 16 23:07:27 2012 (+0530) -# By: Subhasis Ray -# Update #: 18 +# Last-Updated: Sat Aug 6 15:32:49 2016 (-0400) +# By: subha +# Update #: 22 # URL: # Keywords: # Compatibility: @@ -28,6 +28,7 @@ # # Code: +from __future__ import print_function from collections import defaultdict import moose @@ -56,7 +57,7 @@ def read_keyvals(filename): if not tokens: continue if len(tokens) != 2: - print filename, ' - Tokens: ', tokens, len(tokens) + print(filename, ' - Tokens: ', tokens, len(tokens)) return None ret[tokens[1]].add(tokens[0]) except IOError: @@ -191,7 +192,7 @@ import uuid import moose def setupClocks(dt): - print 'Setting up clocks' + print('Setting up clocks') for ii in range(10): moose.setClock(ii, dt) @@ -234,7 +235,7 @@ def runsim(simtime, steplength=0.01): clock = moose.element('/clock') while clock.currentTime < simtime: moose.start(steplength) - print 'Current simulation time:', clock.currentTime + print('Current simulation time:', clock.currentTime) time.sleep(0.05) pulsearray = [[.05, 100e-3, 0.9e-9], @@ -250,7 +251,7 @@ class TestTCR(unittest.TestCase): def setUp(self): self.testId = uuid.uuid4().int params = setupCurrentStepModel(self.testId, 'TCR', pulsearray, simdt) - print 'Starting simulation' + print('Starting simulation') runsim(simtime) def testDefault(self): diff --git a/traub_2005/py/display_morphology.py b/traub_2005/py/display_morphology.py index d847e5b0dd284c4589fa1699768113f26c538d41..7722b23f563a00f02d2d1bed637be4822a5d0e7c 100644 --- a/traub_2005/py/display_morphology.py +++ b/traub_2005/py/display_morphology.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Fri Mar 8 11:26:13 2013 (+0530) # Version: -# Last-Updated: Thu Jul 18 15:12:01 2013 (+0530) -# By: subha -# Update #: 366 +# Last-Updated: Thu Aug 11 11:29:36 2016 (-0400) +# By: Subhasis Ray +# Update #: 389 # URL: # Keywords: # Compatibility: @@ -28,6 +28,7 @@ # # Code: +from __future__ import print_function """ Display/save the topology of one or all cells in traub_2005 demo. @@ -43,7 +44,6 @@ sys.path.append('../../../python') import os import numpy as np import matplotlib.pyplot as plt -import pygraphviz import networkx as nx import moose import cells @@ -76,8 +76,8 @@ def cell_to_graph(cell, label=False): msg = 'distalOut' else: raise Exception('No neighbors on raxial or distal') - es = [(c1.path, c2[0].path, {'weight': 2/ (moose.Compartment(c1).Ra + moose.Compartment(c2).Ra)}) \ - for c1 in moose.wildcardFind('%s/##[ISA=Compartment]' % (cell.path)) \ + es = [(c1.path, c2[0].path, {'weight': 2/ (c1.Ra + c2[0].Ra)}) \ + for c1 in moose.wildcardFind('%s/##[ISA=CompartmentBase]' % (cell.path)) \ for c2 in moose.Compartment(c1).neighbors[msg]] g = nx.Graph() g.add_edges_from(es) @@ -109,7 +109,7 @@ def plot_cell_topology(cell, label=False): weights = np.array([g.edge[e[0]][e[1]]['weight'] for e in g.edges()]) try: pos = nx.graphviz_layout(g,prog='twopi',root=cell.path + '/comp_1') - except NameError: + except (NameError, AttributeError) as e: # this is the best networkx can do by itself. Its Furchtman # Reingold layout ends up with overlapping edges even for a # tree. igraph does much better. @@ -131,7 +131,6 @@ import sys from getopt import getopt if __name__ == '__main__': - print sys.argv optlist, args = getopt(sys.argv[1:], 'lhp:c:', ['help']) celltype = '' pdf = '' @@ -144,15 +143,14 @@ if __name__ == '__main__': elif arg[0] == '-l': label = True elif arg[0] == '-h' or arg[0] == '--help': - print 'Usage: %s [-c CellType [-p filename]]' % (sys.argv[0]) - print 'Display/save the morphology of cell type "CellType".' - print 'Options:' - print '-c celltype (optional) display only an instance of the specified cell type. If CellType is empty or not specified, all prototype cells are displayed.' - print '-l label the compartments' - print '-p filename (optional) save outputin a pdf file named "filename".' - print '-h,--help print this help' + print('Usage: %s [-c CellType [-p filename]]' % (sys.argv[0])) + print('Display/save the morphology of cell type "CellType".') + print('Options:') + print('-c celltype (optional) display only an instance of the specified cell type. If CellType is empty or not specified, all prototype cells are displayed.') + print('-l label the compartments') + print('-p filename (optional) save outputin a pdf file named "filename".') + print('-h,--help print this help') sys.exit(0) - print 'args', optlist, args figures = [] if len(celltype) > 0: try: @@ -162,10 +160,9 @@ if __name__ == '__main__': # print 'Label', label plot_cell_topology(cell, label=label) except KeyError: - print '%s: no such cell type. Available are:' % (celltype) + print( '%s: no such cell type. Available are:' % (celltype)) for ii in cells.init_prototypes().keys(): - print ii, - print + print( ii) sys.exit(1) else: for cell, proto in cells.init_prototypes().items(): diff --git a/traub_2005/py/fig_a2_fs.py b/traub_2005/py/fig_a2_fs.py index bb5bb1d4100d8e67735a6030c33e43361b9e76da..625a6228b2be9f3407aa335dacbd75aa1ce4ae0f 100644 --- a/traub_2005/py/fig_a2_fs.py +++ b/traub_2005/py/fig_a2_fs.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Thu Jun 27 12:06:52 2013 (+0530) # Version: -# Last-Updated: Thu Jun 27 12:36:17 2013 (+0530) +# Last-Updated: Sat Aug 6 15:28:07 2016 (-0400) # By: subha -# Update #: 29 +# Update #: 30 # URL: # Keywords: # Compatibility: @@ -49,6 +49,7 @@ Reproduce the experiment for Fig A2 in Traub et al 2005. FS (deep basket cell) with 0.5 nA current pusle simulated for 1 s """ +from __future__ import print_function import numpy as np import pylab @@ -105,7 +106,7 @@ def main(): np.vstack((t, inject, vm)).transpose()) msg = 'Saved data for %g A current pulse in %s' % (amp, fname) config.logger.info(msg) - print msg + print(msg) pylab.title('%g nA' % (amp*1e9)) pylab.plot(t, vm, label='soma-Vm (mV)') stim_boundary = np.flatnonzero(np.diff(inject)) diff --git a/traub_2005/py/fig_a3.py b/traub_2005/py/fig_a3.py index 8d77e0f9849deef9a2aeaa2c512010d90f59cbb8..393ecaf1fd77a86305cc47d1a36bb411b647657b 100644 --- a/traub_2005/py/fig_a3.py +++ b/traub_2005/py/fig_a3.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Wed Jun 26 17:07:59 2013 (+0530) # Version: -# Last-Updated: Fri Jun 28 16:05:19 2013 (+0530) +# Last-Updated: Sat Aug 6 15:46:14 2016 (-0400) # By: subha -# Update #: 160 +# Update #: 161 # URL: # Keywords: # Compatibility: @@ -105,7 +105,7 @@ def main(): np.vstack((t, inject, vm)).transpose()) msg = 'Saved data for %g A current pulse in %s' % (a, fname) config.logger.info(msg) - print msg + print( msg) pylab.subplot(3,1,ii+1) pylab.title('%g nA' % (a*1e9)) pylab.plot(t, vm, label='soma-Vm (mV)') diff --git a/traub_2005/py/gui.py b/traub_2005/py/gui.py index e7af14f6ead3a38320071bd2534fdf3488afc55c..c77e68007780b82204cfe308a1185eab910b2cac 100644 --- a/traub_2005/py/gui.py +++ b/traub_2005/py/gui.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Fri Jul 12 11:53:50 2013 (+0530) # Version: -# Last-Updated: Sat Jul 11 18:59:17 2015 (+0530) -# By: subha -# Update #: 730 +# Last-Updated: Thu Aug 11 17:21:24 2016 (-0400) +# By: Subhasis Ray +# Update #: 781 # URL: # Keywords: # Compatibility: @@ -48,7 +48,7 @@ """ Display channel properties graphically """ - +from __future__ import print_function from datetime import datetime from PyQt4 import QtCore, QtGui from matplotlib import mlab @@ -59,8 +59,9 @@ from matplotlib import mlab from matplotlib.figure import Figure from matplotlib import patches from pylab import cm + from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas -from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar +from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar import networkx as nx import numpy as np @@ -134,7 +135,7 @@ class HHChanView(QtGui.QWidget): v = np.linspace(gate.min, gate.max, len(m)) self.mhaxes.plot(v, m, label='%s %s' % (gate.path, mlabel)) self.tauaxes.plot(v, tau, label='%s %s' % (gate.path, taulabel)) - print 'Plotted', gate.path, 'vmin=', gate.min, 'vmax=', gate.max, 'm[0]=', m[0], 'm[last]=', m[-1], 'tau[0]=', tau[0], 'tau[last]=', tau[-1] + print('Plotted', gate.path, 'vmin=', gate.min, 'vmax=', gate.max, 'm[0]=', m[0], 'm[last]=', m[-1], 'tau[0]=', tau[0], 'tau[last]=', tau[-1]) def plotActInact(self): """Plot the activation and inactivation variables of the selected channels""" @@ -153,9 +154,7 @@ class HHChanView(QtGui.QWidget): self.mhaxes.set_title('Activation/Inactivation') self.tauaxes = self.figure.add_subplot(2, 1, 2) self.tauaxes.set_title('Tau') - print self.channels for item in self.getChannelListWidget().selectedItems(): - print item.text() chan = self.channels[str(item.text())] if chan.Xpower > 0: path = '{}/gateX'.format(chan.path) @@ -193,41 +192,15 @@ class NetworkXWidget(QtGui.QWidget): axon, sd = axon_dendrites(g) sizes = node_sizes(g) * 50 if len(sizes) == 0: - print 'Empty graph for cell. Make sure proto file has `*asymmetric` on top. I cannot handle symmetric compartmental connections' + print('Empty graph for cell. Make sure proto file has `*asymmetric` on top. I cannot handle symmetric compartmental connections') return - weights = np.array([g.edge[e[0]][e[1]]['weight'] for e in g.edges()]) - pos = nx.graphviz_layout(g, prog='twopi') - xmin, ymin, xmax, ymax = 1e9, 1e9, -1e9, -1e9 - for p in pos.values(): - if xmin > p[0]: - xmin = p[0] - if xmax < p[0]: - xmax = p[0] - if ymin > p[1]: - ymin = p[1] - if ymax < p[1]: - ymax = p[1] - edge_widths = 10.0 * weights / max(weights) node_colors = ['k' if x in axon else 'gray' for x in g.nodes()] lw = [1 if n.endswith('comp_1') else 0 for n in g.nodes()] self.axes.clear() - self.axes.set_xlim((xmin-10, xmax+10)) - self.axes.set_ylim((ymin-10, ymax+10)) - for ii, e in enumerate(g.edges()): - p0 = pos[e[0]] - p1 = pos[e[1]] - a = patches.FancyArrow(p0[0], p0[1], p1[0] - p0[0], p1[1] - p0[1], width=edge_widths[ii], head_width=0.0, axes=self.axes, ec='none', fc='black') - self.axes.add_patch(a) - for ii, n in enumerate(g.nodes()): - if n in axon: - ec = 'black' - elif n.endswith('comp_1'): - ec = 'red' - else: - ec = 'none' - c = patches.Circle(pos[n], radius=sizes[ii], axes=self.axes, ec=ec, fc='gray', alpha=0.8) - self.axes.add_patch(c) - self.canvas.draw() + try: + nx.draw_graphviz(g, ax=self.axes, prog='twopi', node_color=node_colors, lw=lw) + except (NameError, AttributeError) as e: + nx.draw_spectral(g, ax=self.axes, node_color=node_colors, lw=lw, with_labels=False, ) class CellView(QtGui.QWidget): @@ -275,7 +248,6 @@ class CellView(QtGui.QWidget): self.cellListWidget.itemSelectionChanged.connect(self.displaySelected) # self.cellListWidget.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) # root = str(self.rootEdit.text()) - # print 'root = ', root for cell in self.getCells(): self.cellListWidget.addItem(cell) self.cellListWidget.setCurrentItem(self.cellListWidget.item(0)) @@ -328,7 +300,6 @@ class CellView(QtGui.QWidget): def displayCellMorphology(self, cellpath): cell = moose.element(cellpath) - print 'HERE' graph = cell_to_graph(cell) self.getCellMorphologyWidget().displayGraph(graph) @@ -348,11 +319,8 @@ class CellView(QtGui.QWidget): [1e9, 0, 0]]) # moose.le(model_container) # moose.le(data_container) - print '11111' - print model_container.path, data_container.path params['modelRoot'] = model_container.path params['dataRoot'] = data_container.path - print 'here' return params def displaySelected(self): @@ -369,7 +337,6 @@ class CellView(QtGui.QWidget): assert(len(cellnames) == 1) name = cellnames[0] params = self.createCell(name) - # print 'Here ......' # hsolve = moose.HSolve('%s/solver' % (params['cell'].path)) # hsolve.dt = simdt # hsolve.target = params['cell'].path @@ -419,7 +386,7 @@ class CellView(QtGui.QWidget): self.vmAxes.legend() self.plotCanvas.draw() td = np.mean(tdlist) - print 'Simulating %g s took %g s of computer time' % (simtime, td) + print('Simulating %g s took %g s of computer time' % (simtime, td)) # self.plotFigure.tight_layout() def getPlotWidget(self): diff --git a/traub_2005/py/test_capool.py b/traub_2005/py/test_capool.py index 3ca671d730018db6c4f227e151d4dd45fdba6c61..eee8ce6cce0d16ee9e0a03e2ab99a3c377f7d5ef 100644 --- a/traub_2005/py/test_capool.py +++ b/traub_2005/py/test_capool.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Sun Jun 3 20:31:03 2012 (+0530) # Version: -# Last-Updated: Mon Jun 4 11:58:01 2012 (+0530) +# Last-Updated: Sat Aug 6 15:27:45 2016 (-0400) # By: subha -# Update #: 61 +# Update #: 70 # URL: # Keywords: # Compatibility: @@ -28,6 +28,7 @@ # # Code: +from __future__ import print_function import uuid import numpy as np @@ -70,28 +71,28 @@ def run_capool(poolname, Gbar, simtime): ik_data = params['Ik'] params['Ca'] = ca_data moose.reinit() - print 'Starting simulation', testId, 'for', simtime, 's' + print('Starting simulation', testId, 'for', simtime, 's') moose.start(simtime) - print 'Finished simulation' + print('Finished simulation') vm_file = 'data/%s_Vm.dat' % (poolname) gk_file = 'data/%s_Gk.dat' % (poolname) ik_file = 'data/%s_Ik.dat' % (poolname) ca_file = 'data/%s_Ca.dat' % (poolname) tseries = np.array(range(len(vm_data.vector))) * simdt - print 'Vm:', len(vm_data.vector), 'Gk', len(gk_data.vector), 'Ik', len(ik_data.vector) + print('Vm:', len(vm_data.vector), 'Gk', len(gk_data.vector), 'Ik', len(ik_data.vector)) data = np.c_[tseries, vm_data.vector] np.savetxt(vm_file, data) - print 'Saved Vm in', vm_file + print('Saved Vm in', vm_file) data = np.c_[tseries, gk_data.vector] np.savetxt(gk_file, data) - print 'Saved Gk in', gk_file + print('Saved Gk in', gk_file) data = np.c_[tseries, ik_data.vector] np.savetxt(ik_file, data) - print 'Saved Ik in', ik_file - print '>>', len(ca_data.vector) + print('Saved Ik in', ik_file) + print('>>', len(ca_data.vector)) data = np.c_[tseries, ca_data.vector] np.savetxt(ca_file, data) - print 'Saved [Ca2+] in', ca_file + print('Saved [Ca2+] in', ca_file) return params @@ -102,7 +103,7 @@ class TestCaPool(ChannelTestBase): vm = np.array(params['Vm'].vector) gk = np.array(params['Gk'].vector) ca = np.array(params['Ca'].vector) - print len(ca) + print(len(ca)) tseries = np.arange(0, len(vm), 1.0) * simdt def testCaPool_Vm_Neuron(self): @@ -116,7 +117,7 @@ class TestCaPool(ChannelTestBase): self.assertLess(err, 0.01) def testCaPool_Ca_Neuron(self): - print self.ca.shape + print(self.ca.shape) data = np.c_[self.tseries, self.ca] err = compare_channel_data(data, self.poolname, 'Ca', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.01) diff --git a/traub_2005/py/test_kchans.py b/traub_2005/py/test_kchans.py index 2d08fd766996a73ed2d96c957dcd233fa560dfe6..0eb5eddb456f8185dff97ec08269196ddbe2b6f4 100644 --- a/traub_2005/py/test_kchans.py +++ b/traub_2005/py/test_kchans.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Wed May 30 23:51:58 2012 (+0530) # Version: -# Last-Updated: Sun Jun 3 20:07:30 2012 (+0530) +# Last-Updated: Sat Aug 6 15:30:28 2016 (-0400) # By: subha -# Update #: 115 +# Update #: 120 # URL: # Keywords: # Compatibility: @@ -27,6 +27,7 @@ # # Code: +from __future__ import print_function import uuid import unittest @@ -188,26 +189,26 @@ def run_cadep_channel(channelname, Gbar, simtime): ik_data = params['Ik'] ca_data = params['Ca'] moose.reinit() - print 'Starting simulation', testId, 'for', simtime, 's' + print('Starting simulation', testId, 'for', simtime, 's') moose.start(simtime) - print 'Finished simulation' + print('Finished simulation') vm_file = 'data/%s_Vm.dat' % (channelname) gk_file = 'data/%s_Gk.dat' % (channelname) ik_file = 'data/%s_Ik.dat' % (channelname) ca_file = 'data/%s_Ca.dat' % (channelname) tseries = np.array(range(len(vm_data.vector))) * simdt - print 'Vm:', len(vm_data.vector), 'Gk', len(gk_data.vector), 'Ik', len(ik_data.vector) + print('Vm:', len(vm_data.vector), 'Gk', len(gk_data.vector), 'Ik', len(ik_data.vector)) data = np.c_[tseries, vm_data.vector] np.savetxt(vm_file, data) - print 'Saved Vm in', vm_file + print('Saved Vm in', vm_file) data = np.c_[tseries, gk_data.vector] np.savetxt(gk_file, data) - print 'Saved Gk in', gk_file + print('Saved Gk in', gk_file) data = np.c_[tseries, ik_data.vector] np.savetxt(ik_file, data) - print 'Saved Ik in', ik_file + print('Saved Ik in', ik_file) np.savetxt(ca_file, data) - print 'Saved [Ca2+] in', ca_file + print('Saved [Ca2+] in', ca_file) return params diff --git a/traub_2005/py/test_nachans.py b/traub_2005/py/test_nachans.py index 1755b06c8b124bb6053e146927a79c3dcd16bda8..b96eb1b652e7d47e1e1d0faaf73f4a742ee0b113 100644 --- a/traub_2005/py/test_nachans.py +++ b/traub_2005/py/test_nachans.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Sat May 26 10:29:41 2012 (+0530) # Version: -# Last-Updated: Wed May 30 21:47:11 2012 (+0530) +# Last-Updated: Sat Aug 6 15:46:06 2016 (-0400) # By: subha -# Update #: 349 +# Update #: 417 # URL: # Keywords: # Compatibility: @@ -28,6 +28,7 @@ # # Code: +from __future__ import print_function import os os.environ['NUMPTHREADS'] = '1' @@ -52,30 +53,30 @@ class TestNaF(ChannelTestBase): tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaF_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...',) err = compare_channel_data(self.vm, TestNaF.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...',) err = compare_channel_data(self.gk, TestNaF.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaF_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaF_TCR(ChannelTestBase): channelname = 'NaF_TCR' @@ -84,30 +85,30 @@ class TestNaF_TCR(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaF_TCR_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaF_TCR.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF_TCR_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaF_TCR.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaF_TCR_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF_TCR_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaF2(ChannelTestBase): @@ -117,30 +118,30 @@ class TestNaF2(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaF2_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaF2.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK', end='') def testNaF2_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaF2.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaF2_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF2_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaF2_nRT(ChannelTestBase): @@ -150,30 +151,30 @@ class TestNaF2_nRT(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaF2_nRT_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaF2_nRT.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF2_nRT_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaF2_nRT.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaF2_nRT_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaF2_nRT_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaP(ChannelTestBase): channelname = 'NaP' @@ -182,30 +183,30 @@ class TestNaP(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaP_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaP.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaP_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaP.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaP_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print( 'Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaP_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaPF(ChannelTestBase): @@ -215,30 +216,30 @@ class TestNaPF(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaPF_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaPF.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaPF_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaPF.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaPF_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaPF_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaPF_SS(ChannelTestBase): @@ -248,30 +249,30 @@ class TestNaPF_SS(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaPF_SS_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaPF_SS.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaPF_SS_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaPF_SS.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaPF_SS_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaPF_SS_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') class TestNaPF_TCR(ChannelTestBase): @@ -281,30 +282,30 @@ class TestNaPF_TCR(ChannelTestBase): gk = np.asarray(params['Gk'].vector) tseries = np.array(range(0, len(params['Vm'].vector))) * simdt def testNaPF_TCR_Vm_Moose(self): - print 'Testing MOOSE Vm ...', + print('Testing MOOSE Vm ...', end='') err = compare_channel_data(self.vm, TestNaPF_TCR.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaPF_TCR_Gk_Moose(self): - print 'Testing MOOSE Gk ...', + print('Testing MOOSE Gk ...', end='') err = compare_channel_data(self.gk, TestNaPF_TCR.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.05) - print 'OK' + print('OK') def testNaPF_TCR_Vm_Neuron(self): - print 'Testing NEURON Vm ...', + print('Testing NEURON Vm ...', end='') data = np.c_[self.tseries, self.vm] err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime)) self.assertLess(err, 0.01) - print 'OK' + print('OK') def testNaPF_TCR_Gk_Neuron(self): - print 'Testing NEURON Gk ...', + print('Testing NEURON Gk ...', end='') data = np.c_[self.tseries, self.gk] err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True) self.assertLess(err, 0.05) - print 'OK' + print('OK') if __name__ == '__main__': diff --git a/traub_2005/py/test_singlecomp.py b/traub_2005/py/test_singlecomp.py index d5f109ee7670945564cb5ec41e3edc55a549405c..decd56dd20c7eb8a614389f7c7521ab649fd9999 100644 --- a/traub_2005/py/test_singlecomp.py +++ b/traub_2005/py/test_singlecomp.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Tue Jul 17 21:01:14 2012 (+0530) # Version: -# Last-Updated: Tue Aug 21 17:26:15 2012 (+0530) +# Last-Updated: Sat Aug 6 15:46:37 2016 (-0400) # By: subha -# Update #: 313 +# Update #: 317 # URL: # Keywords: # Compatibility: @@ -29,6 +29,7 @@ # # Code: +from __future__ import print_function import os os.environ['NUMPTHREADS'] = '1' @@ -118,7 +119,7 @@ def insert_ca(compartment, phi, tau): ca = moose.copy(CaPool.prototype, compartment)[0] ca.B = phi / (np.pi * compartment.length * compartment.diameter) ca.tau = tau - print ca.path, ca.B, ca.tau + print( ca.path, ca.B, ca.tau) for chan in moose.wildcardFind('%s/#[TYPE=HHChannel]' % (compartment.path)): if chan.name.startswith('KC') or chan.name.startswith('KAHP'): moose.connect(ca, 'concOut', chan, 'concen') @@ -178,7 +179,7 @@ class TestSingleComp(unittest.TestCase): moose.start(simtime) end = datetime.now() delta = end - start - print 'Simulation of %g s finished in %g s' % (simtime, delta.seconds + delta.microseconds*1e-6) + print( 'Simulation of %g s finished in %g s' % (simtime, delta.seconds + delta.microseconds*1e-6)) def testDefault(self): @@ -189,7 +190,7 @@ class TestSingleComp(unittest.TestCase): vm_axis.plot(nrndata[:,0], nrndata[:,1], label='Vm (mV) - nrn') ca_axis.plot(nrndata[:,0], nrndata[:,2], label='Ca (mM) - nrn') except IOError, e: - print e + print( e) tseries = np.linspace(0, simtime, len(self.tables['Vm'].vector)) * 1e3 # plotcount = len(channel_density) + 1 # rows = int(np.sqrt(plotcount) + 0.5) diff --git a/traub_2005/py/test_tcr.py b/traub_2005/py/test_tcr.py index 9eefe87a730ef119da380831caa21dad888112db..b148bf69dfc563a4fb112fd3bba0a6b5d1f15902 100644 --- a/traub_2005/py/test_tcr.py +++ b/traub_2005/py/test_tcr.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Mon Jul 16 16:12:55 2012 (+0530) # Version: -# Last-Updated: Tue Jun 11 17:29:14 2013 (+0530) +# Last-Updated: Sat Aug 6 15:29:42 2016 (-0400) # By: subha -# Update #: 527 +# Update #: 530 # URL: # Keywords: # Compatibility: @@ -28,7 +28,7 @@ # # Code: - +from __future__ import print_function import unittest from cell_test_util import setup_current_step_model, SingleCellCurrentStepTest import testutils @@ -80,9 +80,9 @@ class TestTCR(SingleCellCurrentStepTest): tab = moose.Table('%s/command' % (self.data_container.path)) moose.connect(tab, 'requestOut', clamp, 'getCommand') for ii in moose.wildcardFind('/##[TYPE=VClamp]'): - print ii.path + print(ii.path) self.runsim(simtime) - print tab, len(tab.vector) + print(tab, len(tab.vector)) pylab.plot(pylab.linspace(0, simtime, len(tab.vector)), tab.vector, 'kx') self.plot_vm() diff --git a/traub_2005/py/testutils.py b/traub_2005/py/testutils.py index e2a01ab2e5a2bb7e4d410d899e09cf1a9f615403..b3d6b68e2622687fad31a046cbce826f527c015f 100644 --- a/traub_2005/py/testutils.py +++ b/traub_2005/py/testutils.py @@ -6,9 +6,9 @@ # Maintainer: # Created: Sat May 26 10:41:37 2012 (+0530) # Version: -# Last-Updated: Fri Dec 7 16:27:24 2012 (+0530) +# Last-Updated: Sat Aug 6 15:45:51 2016 (-0400) # By: subha -# Update #: 400 +# Update #: 414 # URL: # Keywords: # Compatibility: @@ -28,6 +28,7 @@ # # Code: +from __future__ import print_function import os os.environ['NUMPTHREADS'] = '1' @@ -57,7 +58,7 @@ PLOTDT = 0.25e-3 lib = moose.Neutral(config.modelSettings.libpath) def setup_clocks(simdt, plotdt): - print 'Setting up clocks: simdt', simdt, 'plotdt', plotdt + print( 'Setting up clocks: simdt', simdt, 'plotdt', plotdt) moose.setClock(INITCLOCK, simdt) moose.setClock(ELECCLOCK, simdt) moose.setClock(CHANCLOCK, simdt) @@ -132,18 +133,18 @@ def step_run(simtime, steptime, verbose=True): """Run the simulation in steps of `steptime` for `simtime`.""" clock = moose.Clock('/clock') if verbose: - print 'Starting simulation for', simtime + print( 'Starting simulation for', simtime) while clock.currentTime < simtime - steptime: moose.start(steptime) if verbose: - print 'Simulated till', clock.currentTime, 's' + print( 'Simulated till', clock.currentTime, 's') remaining = simtime - clock.currentTime if remaining > 0: if verbose: - print 'Running the remaining', remaining, 's' + print( 'Running the remaining', remaining, 's') moose.start(remaining) if verbose: - print 'Finished simulation' + print( 'Finished simulation') def make_testcomp(containerpath): @@ -241,7 +242,7 @@ def compare_data_arrays(left, right, relative='maxw', plot=False, x_range=None): """ if len(left.shape) != len(right.shape): - print left.shape, right.shape + print( left.shape, right.shape) raise ValueError('Arrays to be compared must have same dimensions.') # y is the intrepolation result for x array using xp and fp when xp and x do not match. # xp and fp are interpolation table's independent and dependent variables @@ -269,7 +270,7 @@ def compare_data_arrays(left, right, relative='maxw', plot=False, x_range=None): else: raise ValueError('Cannot handle more than 2 dimensional arrays.') if left.shape[0] != right.shape[0]: - print 'Array sizes not matching: (%d <> %d) - interpolating' % (left.shape[0], right.shape[0]) + print( 'Array sizes not matching: (%d <> %d) - interpolating' % (left.shape[0], right.shape[0])) y = np.interp(x, xp, fp) else: # assume we have the same X values when sizes are the same y = np.array(fp) @@ -283,7 +284,7 @@ def compare_data_arrays(left, right, relative='maxw', plot=False, x_range=None): xp = xp[indices] fp = fp[indices] err = y - yp - print min(err), max(err), min(y), max(y), min(yp), max(yp) + print( min(err), max(err), min(y), max(y), min(yp), max(yp)) # I measure a conservative relative error as maximum of all the # errors between pairs of points with all_y = np.r_[y, yp] @@ -310,7 +311,7 @@ def compare_cell_dump(left, right, rtol=1e-3, atol=1e-8, row_header=True, col_he """This is a utility function to compare various compartment parameters for a single cell model dumped in csv format using NEURON and MOOSE.""" - print 'Comparing:', left, 'with', right + print( 'Comparing:', left, 'with', right) ret = True left_file = open(left, 'rb') right_file = open(right, 'rb') @@ -323,11 +324,11 @@ def compare_cell_dump(left, right, rtol=1e-3, atol=1e-8, row_header=True, col_he rheader.remove('comp') rheader = sorted(rheader) if len(lheader) != len(rheader): - print 'Column number mismatch: left %d <-> right %d' % (len(lheader), len(rheader)) + print( 'Column number mismatch: left %d <-> right %d' % (len(lheader), len(rheader))) return False for ii in range(len(lheader)): if lheader[ii] != rheader[ii]: - print ii, '-th column name mismatch:', lheader[ii], '<->', rheader[ii] + print( ii, '-th column name mismatch:', lheader[ii], '<->', rheader[ii]) return False index = 2 left_end = False @@ -342,15 +343,15 @@ def compare_cell_dump(left, right, rtol=1e-3, atol=1e-8, row_header=True, col_he except StopIteration: right_end = True if left_end and not right_end: - print left, 'run out of line after', index, 'rows' + print( left, 'run out of line after', index, 'rows') return False if right_end and not left_end: - print right, 'run out of line after', index, 'rows' + print( right, 'run out of line after', index, 'rows') return False if left_end and right_end: return ret if len(left_row) != len(right_row): - print 'No. of columns differ: left - ', len(left_row), 'right -', len(right_row) + print( 'No. of columns differ: left - ', len(left_row), 'right -', len(right_row)) ret = False break for key in lheader: @@ -358,11 +359,11 @@ def compare_cell_dump(left, right, rtol=1e-3, atol=1e-8, row_header=True, col_he left = float(left_row[key]) right = float(right_row[key]) if not np.allclose(float(left), float(right), rtol=rtol, atol=atol): - print 'Mismatch in row:%s, column:%s. Values: %g <> %g' % (index, key, left, right) + print( 'Mismatch in row:%s, column:%s. Values: %g <> %g' % (index, key, left, right)) ret = False except ValueError, e: - print e - print 'Row:', index, 'Key:', key, left_row[key], right_row[key] + print( e) + print( 'Row:', index, 'Key:', key, left_row[key], right_row[key]) index = index + 1 return ret diff --git a/tutorials/Rdesigneur/rdes_ex3.1.py b/tutorials/Rdesigneur/rdes_ex3.1.py new file mode 100644 index 0000000000000000000000000000000000000000..9729a0d653942428734e7966205fe06f789ff876 --- /dev/null +++ b/tutorials/Rdesigneur/rdes_ex3.1.py @@ -0,0 +1,54 @@ +#################################################################### +# Rdesigneur example 3.1 +# Making an axon with a propagating action potential. +#################################################################### +import numpy as np +import moose +import pylab +import rdesigneur as rd + +numAxonSegments = 200 +comptLen = 10e-6 +comptDia = 1e-6 +RM = 1.0 +RA = 10.0 +CM = 0.01 + +def makeAxonProto(): + axon = moose.Neuron( '/library/axon' ) + prev = rd.buildCompt( axon, 'soma', RM = RM, RA = RA, CM = CM, dia = 10e-6, x=0, dx=comptLen) + theta = 0 + x = comptLen + y = 0.0 + + for i in range( numAxonSegments ): + dx = comptLen * np.cos( theta ) + dy = comptLen * np.sin( theta ) + r = np.sqrt( x * x + y * y ) + theta += comptLen / r + compt = rd.buildCompt( axon, 'axon' + str(i), RM = RM, RA = RA, CM = CM, x = x, y = y, dx = dx, dy = dy, dia = comptDia ) + moose.connect( prev, 'axial', compt, 'raxial' ) + prev = compt + x += dx + y += dy + + return axon + +moose.Neutral( '/library' ) +makeAxonProto() + +rdes = rd.rdesigneur( + chanProto = [['make_HH_Na()', 'Na'], ['make_HH_K()', 'K']], + cellProto = [['elec','axon']], + chanDistrib = [ + ['Na', '#', 'Gbar', '1200' ], + ['K', '#', 'Gbar', '360' ]], + stimList = [['soma', '1', '.', 'inject', '(t>0.01 && t<0.2) * 2e-11' ]], + plotList = [['soma', '1', '.', 'Vm', 'Membrane potential']], + moogList = [['#', '1', '.', 'Vm', 'Vm (mV)']] +) + +rdes.buildModel() +moose.reinit() + +rdes.displayMoogli( 0.00005, 0.05, 0.0 ) diff --git a/tutorials/Rdesigneur/rdes_ex3.2.py b/tutorials/Rdesigneur/rdes_ex3.2.py new file mode 100644 index 0000000000000000000000000000000000000000..fc453ebdbbc876ca1d00253b8dfccbf9a76e6e95 --- /dev/null +++ b/tutorials/Rdesigneur/rdes_ex3.2.py @@ -0,0 +1,69 @@ +#################################################################### +# Rdesigneur example 3.2 +# Making a myelinated axon with a propagating action potential. +#################################################################### +import numpy as np +import moose +import pylab +import rdesigneur as rd + +numAxonSegments = 405 +nodeSpacing = 100 +comptLen = 10e-6 +comptDia = 2e-6 # 2x usual +RM = 100.0 # 10x usual +RA = 5.0 +CM = 0.001 # 0.1x usual + +nodeDia = 1e-6 +nodeRM = 1.0 +nodeCM = 0.01 + +def makeAxonProto(): + axon = moose.Neuron( '/library/axon' ) + x = 0.0 + y = 0.0 + prev = rd.buildCompt( axon, 'soma', RM = RM, RA = RA, CM = CM, dia = 10e-6, x=0, dx=comptLen) + theta = 0 + x = comptLen + + for i in range( numAxonSegments ): + r = comptLen + dx = comptLen * np.cos( theta ) + dy = comptLen * np.sin( theta ) + r = np.sqrt( x * x + y * y ) + theta += comptLen / r + if i % nodeSpacing == 0: + compt = rd.buildCompt( axon, 'axon' + str(i), RM = nodeRM, RA = RA, CM = nodeCM, x = x, y = y, dx = dx, dy = dy, dia = nodeDia ) + else: + compt = rd.buildCompt( axon, 'axon' + str(i), RM = RM, RA = RA, CM = CM, x = x, y = y, dx = dx, dy = dy, dia = comptDia ) + moose.connect( prev, 'axial', compt, 'raxial' ) + prev = compt + x += dx + y += dy + + return axon + +moose.Neutral( '/library' ) +makeAxonProto() + +rdes = rd.rdesigneur( + chanProto = [['make_HH_Na()', 'Na'], ['make_HH_K()', 'K']], + cellProto = [['elec','axon']], + chanDistrib = [ + ['Na', '#', 'Gbar', '12000 * (dia < 1.5e-6)' ], + ['K', '#', 'Gbar', '3600 * (dia < 1.5e-6)' ]], + stimList = [['soma', '1', '.', 'inject', '(t>0.01 && t<0.2) * 1e-10' ]], + plotList = [['soma,axon100,axon200,axon300,axon400', '1', '.', 'Vm', 'Membrane potential']], + moogList = [['#', '1', '.', 'Vm', 'Vm (mV)']] +) + + +rdes.buildModel() + +for i in moose.wildcardFind( "/model/elec/#/Na" ): + print i.parent.name, i.Gbar + +moose.reinit() + +rdes.displayMoogli( 0.00005, 0.05, 0.0 )