def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell(
     )  #for alternative approach see managerSimulationTest.py
     os.chdir(pwd)
     self.rec = {"time": None, "response": None, "stimulus": None}
     self.regionslist_str = list(self.chosenmodel.regions.keys())
示例#2
0
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     self.simtime = datetime.datetime.now()
     os.chdir(pwd)
     # self.chosenmodel.regions ->
     # {"soma": ["v", "i_cap"], "axon": ["v"],
     # "channels": {"soma": {"hh": ["il", "el"], "pas": ["i"]}, "axon": {"pas": ["i"]}}}
     # Voltage clamp
     self.sec_runtimeparam = {
         "dt": 0.1,
         "celsius": 30,
         "tstop": 35,
         "v_init": 65
     }
     self.sec_stimparameters = {
         "type": ["voltage", "SEClamp"],
         "stimlist": [{
             'amp1': 0.,
             'dur1': 10.0
         }, {
             'amp2': -70.0,
             'dur2': 20.0
         }],
         "tstop": self.sec_runtimeparam["tstop"]
     }
     self.sec_rec_t = [
         t * self.sec_runtimeparam["dt"] for t in range(
             int(self.sec_runtimeparam["tstop"] /
                 self.sec_runtimeparam["dt"]))
     ]
     self.sec_rec_stim = numpy.random.rand(1, len(self.sec_rec_t))[0]
     self.sec_rec_resp = numpy.random.rand(7, len(self.sec_rec_t))
     self.sec_recordings = {
         "time": self.sec_rec_t,
         "response": {
             "soma": [self.sec_rec_resp[0], self.sec_rec_resp[1]],
             "axon": [self.sec_rec_resp[2]],
             "channels": {
                 "soma": {
                     "hh": [self.sec_rec_resp[3], self.sec_rec_resp[4]],
                     "pas": [self.sec_rec_resp[5]]
                 },
                 "axon": {
                     "pas": [self.sec_rec_resp[3]]
                 }
             }
         },
         "stimulus": self.sec_rec_stim
     }
     #
     tm = TranscribeManager()
     tm.load_metadata(chosenmodel=self.chosenmodel,
                      simtime=self.simtime,
                      recordings=self.sec_recordings,
                      runtimeparameters=self.sec_runtimeparam,
                      stimparameters=self.sec_stimparameters)
     tm.compile_nwbfile()
     self.fullname = tm.save_nwbfile()
示例#3
0
 def setUp(self):
     self.pwd = os.getcwd()
     # Create two files with/without stimulus
     #fab = Fabricator() # NOTE: Reader() is an exception for not instantiating
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
     #
     self.ec = ExecutiveControl()
     #
     if os.path.isdir(pwd + os.sep + "responses"):
         shutil.rmtree("responses")
     #
     runtimeparam = {"dt": 0.1, "celsius": 30, "tstop": 200.0, "v_init": 65}
     stimparam = {
         "type": ["current", "IClamp"],
         "stimlist": [{
             "amp": 0.5,
             "dur": 100.0,
             "delay": 10.0
         }, {
             "amp": 1.0,
             "dur": 50.0,
             "delay": 10.0 + 100.0
         }],
         "tstop":
         runtimeparam["tstop"]
     }
     #
     # Write for stimulus
     self.ec.launch_model(parameters=runtimeparam,
                          stimparameters=stimparam,
                          stimloc=self.chosenmodel.cell.soma,
                          onmodel=self.chosenmodel)
     self.ec.save_response()
     # Get filename
     self.file_stim = fm.show_filenames_with_path(
         ["responses", "cells", "DummyTest"])
     # save for comparison
     self.stimulus_for_comparison = numpy.array(
         self.ec.recordings["stimulus"])
     #
     # Write for nostimulus
     self.ec.launch_model(parameters=runtimeparam, onmodel=self.chosenmodel)
     self.ec.save_response()
     # Get filename
     self.file_nostim = fm.show_filenames_with_path(
         ["responses", "cells", "DummyTest"])
     for key in self.file_stim:
         del self.file_nostim[key]
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
     # No stimulus
     self.no_runtimeparam = {
         "dt": 0.01,
         "celsius": 30,
         "tstop": 10,
         "v_init": 65
     }
     # IClamp
     self.ic_runtimeparam = {
         "dt": 0.01,
         "celsius": 30,
         "tstop": 200,
         "v_init": 65
     }
     self.ic_stimparameters = {
         "type": ["current", "IClamp"],
         "stimlist": [{
             "amp": 0.5,
             "dur": 100.0,
             "delay": 10.0
         }, {
             "amp": 1.0,
             "dur": 50.0,
             "delay": 10.0 + 100.0
         }],
         "tstop":
         self.ic_runtimeparam["tstop"]
     }
     # SEClamp
     self.sec_runtimeparam = {
         "dt": 0.01,
         "celsius": 30,
         "tstop": 35,
         "v_init": 65
     }
     self.sec_stimparameters = {
         "type": ["voltage", "SEClamp"],
         "stimlist": [{
             'amp1': 0.,
             'dur1': 10.0
         }, {
             'amp2': -70.0,
             'dur2': 20.0
         }],
         "tstop": self.sec_runtimeparam["tstop"]
     }
示例#5
0
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     self.simtime = datetime.datetime.now()
     os.chdir(pwd)
     # self.chosenmodel.regions ->
     # {"soma": ["v", "i_cap"], "axon": ["v"],
     # "channels": {"soma": {"hh": ["il", "el"], "pas": ["i"]}, "axon": {"pas": ["i"]}}}
     # No stimulus
     self.no_runtimeparam = {"dt": 0.01, "celsius": 30, "tstop": 10, "v_init": 65}
     self.no_rec_t = [ t*self.no_runtimeparam["dt"] for t in
                  range( int( self.no_runtimeparam["tstop"]/self.no_runtimeparam["dt"] ) ) ]
     self.no_rec_resp = numpy.random.rand(7,len(self.no_rec_t))
     self.no_rec_stim = "Model is not stimulated" # response["stimulus"]
     #self.no_stimtype = None # stimparameters["type"] = ["current", "IClamp"]
     self.no_recordings = {"time": self.no_rec_t,
        "response": {"soma": [self.no_rec_resp[0], self.no_rec_resp[1]],
                     "axon": [ self.no_rec_resp[2] ],
        "channels": {"soma": {"hh": [self.no_rec_resp[3], self.no_rec_resp[4]],
                              "pas":[ self.no_rec_resp[5] ]},
                     "axon": {"pas":[ self.no_rec_resp[3] ]}}},
        "stimulus": "Model is not stimulated"}
     #self.no_respmd = tg.forrecording( chosenmodel = self.chosenmodel,
     #                                  recordings = self.no_recordings,
     #                                  runtimeparameters = self.no_runtimeparam )
     #self.no_epochmd = eg.epochcontainer( chosenmodel = self.chosenmodel,
     #                                     parameters = self.no_runtimeparam )
     # IClamp
     self.ic_runtimeparam = {"dt": 0.01, "celsius": 30, "tstop": 10, "v_init": 65}
     self.ic_stimparameters = {"type": ["current", "IClamp"],
                           "stimlist": [ {"amp": 0.5, "dur": 100.0, "delay": 10.0},
                                         {"amp": 1.0, "dur": 50.0, "delay": 10.0+100.0} ],
                           "tstop": self.ic_runtimeparam["tstop"]}
     self.ic_rec_t = [ t*self.ic_runtimeparam["dt"] for t in
               range( int( self.ic_runtimeparam["tstop"]/self.ic_runtimeparam["dt"] ) ) ]
     self.ic_rec_stim = numpy.random.rand(1,len(self.ic_rec_t))[0]
     self.ic_rec_resp = numpy.random.rand(7,len(self.ic_rec_t))
     self.ic_recordings = {"time": self.ic_rec_t,
        "response": {"soma": [self.ic_rec_resp[0], self.ic_rec_resp[1]],
                     "axon": [ self.ic_rec_resp[2] ],
        "channels": {"soma": {"hh": [self.ic_rec_resp[3], self.ic_rec_resp[4]],
                              "pas":[ self.ic_rec_resp[5] ]},
                     "axon": {"pas":[ self.ic_rec_resp[6] ]}}},
        "stimulus": self.ic_rec_stim}
     #self.ic_respmd = tg.forrecording( chosenmodel = self.chosenmodel,
     #                                  recordings = self.ic_recordings,
     #                                  runtimeparameters = self.ic_runtimeparam,
     #                                  stimparameters = self.ic_stimparameters )
     #self.ic_epochmd = eg.epochcontainer( chosenmodel = self.chosenmodel,
     #                                     parameters = self.ic_stimparameters )
     # Voltage clamp
     self.sec_runtimeparam = {"dt": 0.1, "celsius": 30, "tstop": 35, "v_init": 65}
     self.sec_stimparameters = {"type": ["voltage", "SEClamp"],
                            "stimlist": [ {'amp1': 0., 'dur1': 10.0},
                                     {'amp2': -70.0, 'dur2': 20.0} ],
                            "tstop": self.sec_runtimeparam["tstop"]}
     self.sec_rec_t = [ t*self.sec_runtimeparam["dt"] for t in
                range( int( self.sec_runtimeparam["tstop"]/self.sec_runtimeparam["dt"] ) ) ]
     self.sec_rec_stim = numpy.random.rand(1,len(self.sec_rec_t))[0]
     self.sec_rec_resp = numpy.random.rand(7,len(self.sec_rec_t))
     self.sec_recordings = {"time": self.sec_rec_t,
        "response": {"soma": [self.sec_rec_resp[0], self.sec_rec_resp[1]],
                     "axon": [ self.sec_rec_resp[2] ],
        "channels": {"soma": {"hh": [self.sec_rec_resp[3], self.sec_rec_resp[4]],
                              "pas":[ self.sec_rec_resp[5] ]},
                     "axon": {"pas":[ self.sec_rec_resp[3] ]}}},
        "stimulus": self.sec_rec_stim}
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     self.simtime = datetime.datetime.now()
     os.chdir(pwd)
示例#7
0
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell(
     )  #for alternative approach see managerSimulationTest.py
     os.chdir(pwd)
     #self.regionslist_str = list(self.chosenmodel.regions.keys())
     self.no_parameters = {
         "dt": 0.1,
         "celsius": 30,
         "tstop": 10,
         "v_init": 65
     }
     self.ic_parameters = {
         "dt": 0.1,
         "celsius": 30,
         "tstop": 35,
         "v_init": 65
     }
     self.ic_stimparam = {
         "type": ["current", "IClamp"],
         "stimlist": [{
             'amp': 0.5,
             'dur': 10.0,
             'delay': 5.0
         }, {
             'amp': 1.0,
             'dur': 20.0,
             'delay': 5.0 + 10.0
         }],
         "tstop":
         self.ic_parameters["tstop"]
     }
     self.sec_parameters = {
         "dt": 0.1,
         "celsius": 30,
         "tstop": 35,
         "v_init": 65
     }
     self.sec_stimparam = {
         "type": ["voltage", "SEClamp"],
         "stimlist": [{
             'amp1': 0.,
             'dur1': 10.0
         }, {
             'amp2': -70.0,
             'dur2': 20.0
         }],
         "tstop": self.sec_parameters["tstop"]
     }
     self.ir_parameters = {
         "dt": 0.1,
         "celsius": 30,
         "tstop": 35,
         "v_init": 65
     }
     self.ir_stimparam = {
         "type": ["current", "IRamp"],
         "stimlist": [{
             "amp_initial": 0.0,
             "amp_final": 0.5,
             "dur": 5.0,
             "delay": 5.0
         }, {
             "amp_initial": 0.5,
             "amp_final": 1.0,
             "dur": 5.0,
             "delay": 10.0
         }, {
             "amp_initial": 1.0,
             "amp_final": 0.5,
             "dur": 5.0,
             "delay": 15.0
         }, {
             "amp_initial": 0.5,
             "amp_final": 0.0,
             "dur": 5.0,
             "delay": 20.0
         }],
         "tstop":
         self.ir_parameters["tstop"]
     }
示例#8
0
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
     #
     self.parameters = {"dt": 0.1, "celsius": 20, "tstop": 10, "v_init": 65}
示例#9
0
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
示例#10
0
 def setUp(self):
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
     self.rec = {"time": None, "response": None, "stimulus": None}
     self.regionslist_str = list(self.chosenmodel.regions.keys())
示例#11
0
 def setUp(self):
     self.st = Stimulator()
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
示例#12
0
 def setUp(self):
     #self.fm = FilingManager() #instance for non: static & class methods.
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
 def setUp(self):
     #self.tg = TimeseriesGenerator()
     #self.pwd = os.getcwd()
     os.chdir(rootwd)
     self.chosenmodel = DummyCell()
     os.chdir(pwd)
     #
     # self.chosenmodel.regions ->
     # {"soma": ["v", "i_cap"], "axon": ["v"],
     # "channels": {"soma": {"hh": ["il", "el"], "pas": ["i"]}, "axon": {"pas": ["i"]}}}
     #
     # The following are generated via RegionParser in operatorsTranscribe/regionparser.py
     #self.regionlist = ["soma", "axon"]
     #self.componentgrouplist = ["channels"]
     #self.regionlist_of_of_componentgroup = ["soma", "axon"]
     #self.soma_componentlist = ["hh", "pas"]
     #self.axon_componentlist = ["pas"]
     # No stimulus
     self.no_runtimeparam = {
         "dt": 0.01,
         "celsius": 30,
         "tstop": 10,
         "v_init": 65
     }
     self.no_rec_t = [
         t * self.no_runtimeparam["dt"] for t in range(
             int(self.no_runtimeparam["tstop"] /
                 self.no_runtimeparam["dt"]))
     ]
     self.no_rec_resp = numpy.random.rand(7, len(self.no_rec_t))
     self.no_rec_stim = "Model is not stimulated"  # response["stimulus"]
     #self.no_stimtype = None # stimparameters["type"] = ["current", "IClamp"]
     self.no_recordings = {
         "time": self.no_rec_t,
         "response": {
             "soma": [self.no_rec_resp[0], self.no_rec_resp[1]],
             "axon": [self.no_rec_resp[2]],
             "channels": {
                 "soma": {
                     "hh": [self.no_rec_resp[3], self.no_rec_resp[4]],
                     "pas": [self.no_rec_resp[5]]
                 },
                 "axon": {
                     "pas": [self.no_rec_resp[3]]
                 }
             }
         },
         "stimulus": "Model is not stimulated"
     }
     # IClamp
     self.ic_runtimeparam = {
         "dt": 0.01,
         "celsius": 30,
         "tstop": 10,
         "v_init": 65
     }
     self.ic_stimparameters = {
         "type": ["current", "IClamp"],
         "stimlist": [{
             "amp": 0.5,
             "dur": 100.0,
             "delay": 10.0
         }, {
             "amp": 1.0,
             "dur": 50.0,
             "delay": 10.0 + 100.0
         }],
         "tstop":
         self.ic_runtimeparam["tstop"]
     }
     self.ic_rec_t = [
         t * self.ic_runtimeparam["dt"] for t in range(
             int(self.ic_runtimeparam["tstop"] /
                 self.ic_runtimeparam["dt"]))
     ]
     self.ic_rec_stim = numpy.random.rand(1, len(self.ic_rec_t))[0]
     self.ic_rec_resp = numpy.random.rand(7, len(self.ic_rec_t))
     self.ic_recordings = {
         "time": self.ic_rec_t,
         "response": {
             "soma": [self.ic_rec_resp[0], self.ic_rec_resp[1]],
             "axon": [self.ic_rec_resp[2]],
             "channels": {
                 "soma": {
                     "hh": [self.ic_rec_resp[3], self.ic_rec_resp[4]],
                     "pas": [self.ic_rec_resp[5]]
                 },
                 "axon": {
                     "pas": [self.ic_rec_resp[3]]
                 }
             }
         },
         "stimulus": self.ic_rec_stim
     }
     # Voltage clamp
     self.sec_runtimeparam = {
         "dt": 0.1,
         "celsius": 30,
         "tstop": 35,
         "v_init": 65
     }
     self.sec_stimparameters = {
         "type": ["voltage", "SEClamp"],
         "stimlist": [{
             'amp1': 0.,
             'dur1': 10.0
         }, {
             'amp2': -70.0,
             'dur2': 20.0
         }],
         "tstop": self.sec_runtimeparam["tstop"]
     }
     self.sec_rec_t = [
         t * self.sec_runtimeparam["dt"] for t in range(
             int(self.sec_runtimeparam["tstop"] /
                 self.sec_runtimeparam["dt"]))
     ]
     self.sec_rec_stim = numpy.random.rand(1, len(self.sec_rec_t))[0]
     self.sec_rec_resp = numpy.random.rand(7, len(self.sec_rec_t))
     self.sec_recordings = {
         "time": self.sec_rec_t,
         "response": {
             "soma": [self.sec_rec_resp[0], self.sec_rec_resp[1]],
             "axon": [self.sec_rec_resp[2]],
             "channels": {
                 "soma": {
                     "hh": [self.sec_rec_resp[3], self.sec_rec_resp[4]],
                     "pas": [self.sec_rec_resp[5]]
                 },
                 "axon": {
                     "pas": [self.sec_rec_resp[3]]
                 }
             }
         },
         "stimulus": self.sec_rec_stim
     }