本文整理汇总了Python中ucl.physiol.neuroconstruct.project.ProjectManager.doRunNeuron方法的典型用法代码示例。如果您正苦于以下问题:Python ProjectManager.doRunNeuron方法的具体用法?Python ProjectManager.doRunNeuron怎么用?Python ProjectManager.doRunNeuron使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ucl.physiol.neuroconstruct.project.ProjectManager
的用法示例。
在下文中一共展示了ProjectManager.doRunNeuron方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ArrayList
# 需要导入模块: from ucl.physiol.neuroconstruct.project import ProjectManager [as 别名]
# 或者: from ucl.physiol.neuroconstruct.project.ProjectManager import doRunNeuron [as 别名]
0, 0, 0, 0.5, 0,
stim_seg_detailed,
0.5, 0, None)
# delete all existing probes
project.generatedPlotSaves.reset()
# set up voltage recording at the specified points along the dendrite being stimulated
project.generatedPlotSaves.addPlotSaveDetails('Golgi_reduced_v', project.simPlotInfo.getSimPlot('Golgi_reduced_v'), ArrayList([0]), ArrayList(rec_segs_reduced), False, False)
project.generatedPlotSaves.addPlotSaveDetails('Golgi_detailed_v', project.simPlotInfo.getSimPlot('Golgi_detailed_v'), ArrayList([0]), ArrayList(rec_segs_detailed), False, False)
# generate and compile neuron files
print "Generating NEURON scripts..."
simulator_seed = random.getrandbits(32)
project.neuronFileManager.generateTheNeuronFiles(sim_config, None, NeuronFileManager.RUN_HOC,simulator_seed)
compile_process = ProcessManager(project.neuronFileManager.getMainHocFile())
compile_success = compile_process.compileFileWithNeuron(0,0)
# simulate
if compile_success:
print "Simulating: simulation reference " + sim_ref
pm.doRunNeuron(sim_config)
timefile_path = sim_path + '/time.dat'
while not os.path.exists(timefile_path):
time.sleep(0.1)
data_string = "Data reference " + sim_ref
for k,i in enumerate(rec_segs_detailed):
data_string = data_string + " " + str(i) + " " + str(rec_dists_detailed[k])
print data_string
System.exit(0)
示例2: ProcessManager
# 需要导入模块: from ucl.physiol.neuroconstruct.project import ProjectManager [as 别名]
# 或者: from ucl.physiol.neuroconstruct.project.ProjectManager import doRunNeuron [as 别名]
pm.doGenerate(simConfig.getName(), randomseed)
while pm.isGenerating():
print "Waiting for the project to be generated..."
time.sleep(2)
myProject.neuronFileManager.setSuggestedRemoteRunTime(10)
myProject.neuronFileManager.generateTheNeuronFiles(simConfig, None, NeuronFileManager.RUN_HOC, randomseed)
print "Generated NEURON files for: "+simRef
compileProcess = ProcessManager(myProject.neuronFileManager.getMainHocFile())
compileSuccess = compileProcess.compileFileWithNeuron(0,0)
print "Compiled NEURON files for: "+simRef
if compileSuccess:
pm.doRunNeuron(simConfig)
print "Set running simulation: "+simRef
time.sleep(5) # wait for the process to be sent out
#####################'''
'''##### Rerunning the same configuration + background exc #####
simRef = prefix+"syn"+str(synapses)+"E1500_"+str(t)
print "Simref: "+simRef
myProject.simulationParameters.setReference(simRef)
refStored.append(simRef)
##### RUN BLOCK background exc #####
示例3: generateF_ICurve
# 需要导入模块: from ucl.physiol.neuroconstruct.project import ProjectManager [as 别名]
# 或者: from ucl.physiol.neuroconstruct.project.ProjectManager import doRunNeuron [as 别名]
#.........这里部分代码省略.........
preStim.setDel(NumberGenerator(preStimDel))
preStim.setDur(NumberGenerator(preStimDur))
self.myProject.elecInputInfo.updateStim(preStim)
# stim = self.myProject.elecInputInfo.getStim(simConfig.getInputs().get(1))
stim = self.myProject.elecInputInfo.getStim("Input_4")
stim.setAmp(NumberGenerator(stimAmp))
stim.setDel(NumberGenerator(stimDel))
stim.setDur(NumberGenerator(stimDur))
self.myProject.elecInputInfo.updateStim(stim)
print "Next stim: "+ str(stim)
self.myProject.simulationParameters.setReference(simRef)
if simulator == "NEURON":
self.myProject.neuronFileManager.generateTheNeuronFiles(simConfig,
None,
NeuronFileManager.RUN_HOC,
self.simulatorSeed)
print "Generated NEURON files for: "+simRef
compileProcess = ProcessManager(self.myProject.neuronFileManager.getMainHocFile())
compileSuccess = compileProcess.compileFileWithNeuron(0,0)
print "Compiled NEURON files for: "+simRef
if compileSuccess:
pm.doRunNeuron(simConfig)
print "Set running simulation: "+simRef
self.simsRunning.append(simRef)
if simulator == "GENESIS":
compartmentalisation = GenesisCompartmentalisation()
self.myProject.genesisFileManager.generateTheGenesisFiles(simConfig,
None,
compartmentalisation,
self.simulatorSeed)
print "Generated GENESIS files for: "+simRef
pm.doRunGenesis(simConfig)
print "Set running simulation: "+simRef
self.simsRunning.append(simRef)
time.sleep(1) # Wait for sim to be kicked off
simReferences[simRef] = stimAmp
stimAmp = stimAmp +stimAmpInc
print
print "Finished running "+str(len(simReferences))+" simulations for project "+ projFile.getAbsolutePath()
print "These can be loaded and replayed in the previous simulation browser in the GUI"
print
while (len(self.simsRunning)>0):
print "Sims currently running: "+str(self.simsRunning)
print "Waiting..."
time.sleep(4) # wait a while...
self.updateSimsRunning()
#simReferences = {'PySim_0.3':0.3,'PySim_0.4':0.4,'PySim_0.5':0.5}
示例4: make_fF_Curve
# 需要导入模块: from ucl.physiol.neuroconstruct.project import ProjectManager [as 别名]
# 或者: from ucl.physiol.neuroconstruct.project.ProjectManager import doRunNeuron [as 别名]
#.........这里部分代码省略.........
TEXT_START_FINITIALIZE = "\n" + "gTrainFile = new File() \n" + "vector = new Vector(100000) \n" + "access GranuleCell_mod_tonic[0].Soma \n" + "clamp = new SEClamp(0.5) \n" + "clamp.amp1 = 0 \n" + "clamp.dur1 = 1e9 \n" + """gTrainFile.ropen("E:/neuroConstruct/models/Dan_GranCell/gTrains_nS/gAMPA_""" + str(currentTrain) + """.txt") \n""" + "vector.scanf(gTrainFile) \n" + "gTrainFile.close \n" + "for i = 0, vector.size() -1 { \n" + " if (vector.x[i] <= 0) { \n" + " vector.x[i] = 1e-20 \n" + " } \n" + " } \n" + "for i = 0, vector.size() -1 { \n" + " vector.x[i] = ( 1 / vector.x[i] ) * 1000 \n" + " } \n" + "vector.play(&clamp.rs, 0.03) \n" # This
TEXT_START_FINITIALIZE = TEXT_START_FINITIALIZE + ADD_TO_START_FINITIALIZE
TEXT_TO_RECORD_I = """// currently not used \n"""
TEXT_TO_RECORD_I = TEXT_TO_RECORD_I + ADD_TO_RECORD_I
self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.BEFORE_CELL_CREATION, TEXT_BEFORE_CREATION)
self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.START_FINITIALIZE, TEXT_START_FINITIALIZE)
self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.AFTER_SIMULATION, TEXT_TO_RECORD_I)
print "Next Train: "+ str(currentTrain)
self.myProject.simulationParameters.setReference(simRef)
if simulator == "NEURON":
self.myProject.neuronFileManager.generateTheNeuronFiles(simConfig,
None,
NeuronFileManager.RUN_HOC,
self.simulatorSeed)
print "Generated NEURON files for: "+simRef
compileProcess = ProcessManager(self.myProject.neuronFileManager.getMainHocFile())
compileSuccess = compileProcess.compileFileWithNeuron(0,0)
print "Compiled NEURON files for: "+simRef
if compileSuccess:
pm.doRunNeuron(simConfig)
print "Set running simulation: "+simRef
self.simsRunning.append(simRef)
if simulator == "GENESIS":
compartmentalisation = GenesisCompartmentalisation()
self.myProject.genesisFileManager.generateTheGenesisFiles(simConfig,
None,
compartmentalisation,
self.simulatorSeed)
print "Generated GENESIS files for: "+simRef
pm.doRunGenesis(simConfig)
print "Set running simulation: "+simRef
self.simsRunning.append(simRef)
time.sleep(1) # Wait for sim to be kicked off
simReferences[simRef] = currentTrain
currentTrain = currentTrain + 1
print
print "Finished running "+str(len(simReferences))+" simulations for project "+ projFile.getAbsolutePath()
print "These can be loaded and replayed in the previous simulation browser in the GUI"
print
while (len(self.simsRunning)>0):
print "Sims currently running: "+str(self.simsRunning)
print "Waiting..."
time.sleep(4) # wait a while...
self.updateSimsRunning()
#simReferences = {'PySim_0.3':0.3,'PySim_0.4':0.4,'PySim_0.5':0.5}
示例5: generateV_ICurve
# 需要导入模块: from ucl.physiol.neuroconstruct.project import ProjectManager [as 别名]
# 或者: from ucl.physiol.neuroconstruct.project.ProjectManager import doRunNeuron [as 别名]
#.........这里部分代码省略.........
TEXT_START_FINITIALIZE = "GranuleCell_mod_tonic[0].Soma {\n" + "clampobj = new SEClamp(0.5)\n" + "clampobj.dur1 = 150.0" + "\n" + "clampobj.amp1 = -100.0" + "\n" + "clampobj.dur2 = " + str(stimDur) + "\n" + "clampobj.amp2 = " + str(stimAmp) + "\n" + "clampobj.dur3 = 150.0" + "\n" + "clampobj.amp3 = -40.0" + "\n" + "clampobj.rs = 0.00001\n" + "record_current = new Vector()" + "\n" + "record_current.record(&clampobj.i)" + "\n" + "}\n" #This should do the trick
TEXT_START_FINITIALIZE = TEXT_START_FINITIALIZE + ADD_TO_START_FINITIALIZE
TEXT_TO_RECORD_I = """data_save = new File() \n""" + """strdef filename \n""" + """sprint(filename, """" + self.myProject.getProjectMainDirectory().getAbsolutePath() + """/simulations/current%.3f.txt", clampobj.amp2) \n""" + """data_save.wopen(filename) \n""" + """record_current.printf(data_save) \n""" + """data_save.close() \n"""
TEXT_TO_RECORD_I = TEXT_TO_RECORD_I + ADD_TO_RECORD_I
self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.BEFORE_CELL_CREATION, TEXT_BEFORE_CREATION)
# self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.BEFORE_INITIAL, TEXT_BEFORE_INIT)
self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.START_FINITIALIZE, TEXT_START_FINITIALIZE)
self.myProject.neuronSettings.setNativeBlock(NativeCodeLocation.AFTER_SIMULATION, TEXT_TO_RECORD_I)
print "Next stim: "+ str(stimAmp)
self.myProject.simulationParameters.setReference(simRef)
if simulator == "NEURON":
self.myProject.neuronFileManager.generateTheNeuronFiles(simConfig,
None,
NeuronFileManager.RUN_HOC,
self.simulatorSeed)
print "Generated NEURON files for: "+simRef
compileProcess = ProcessManager(self.myProject.neuronFileManager.getMainHocFile())
compileSuccess = compileProcess.compileFileWithNeuron(0,0)
print "Compiled NEURON files for: "+simRef
if compileSuccess:
pm.doRunNeuron(simConfig)
print "Set running simulation: "+simRef
self.simsRunning.append(simRef)
if simulator == "GENESIS":
compartmentalisation = GenesisCompartmentalisation()
self.myProject.genesisFileManager.generateTheGenesisFiles(simConfig,
None,
compartmentalisation,
self.simulatorSeed)
print "Generated GENESIS files for: "+simRef
pm.doRunGenesis(simConfig)
print "Set running simulation: "+simRef
self.simsRunning.append(simRef)
time.sleep(1) # Wait for sim to be kicked off
simReferences[simRef] = stimAmp
stimAmp = stimAmp +stimAmpInc
print
print "Finished running "+str(len(simReferences))+" simulations for project "+ projFile.getAbsolutePath()
print "These can be loaded and replayed in the previous simulation browser in the GUI"
print
while (len(self.simsRunning)>0):
print "Sims currently running: "+str(self.simsRunning)
print "Waiting..."
time.sleep(4) # wait a while...
self.updateSimsRunning()
#simReferences = {'PySim_0.3':0.3,'PySim_0.4':0.4,'PySim_0.5':0.5}