• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python rdesigneur.rdesigneur函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中rdesigneur.rdesigneur函数的典型用法代码示例。如果您正苦于以下问题:Python rdesigneur函数的具体用法?Python rdesigneur怎么用?Python rdesigneur使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rdesigneur函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: makeModel

def makeModel():
    moose.Neutral( '/library' )
    # Here we illustrate building the chem proto directly. This is not
    # good practice as it takes the model definition away from the 
    # declaration of prototypes.
    makeChemProto( 'cProto' )
    rdes = rd.rdesigneur( useGssa = False, \
                combineSegments = False, \
                meshLambda = 1e-6, \
            cellProto = [['makeCellProto()', 'elec' ]] ,\
            spineProto = [['makeSpineProto()', 'spine' ]] ,\
            chemProto = [['cProto', 'chem' ]] ,\
            spineDistrib = [ \
                ['spine', '#', \
                'spineSpacing', str( spineSpacing ), \
                'spineSpacingDistrib', str( spineSpacingDistrib ), \
                'angle', str( spineAngle ), \
                'angleDistrib', str( spineAngleDistrib ), \
                'size', str( spineSize ), \
                'sizeDistrib', str( spineSizeDistrib ) ] \
            ], \
            chemDistrib = [ \
                [ "chem", "#", "install", "1" ] \
            ],
            adaptorList = [ \
                [ 'psd/Ca', 'conc', '.', 'inject', 0, 2e-9 ], \
                ] \
        )
    rdes.buildModel( '/model' )
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:29,代码来源:testRdesigneur.py


示例2: main

def main():
    ######## Put your favourite cell model here ######
    ##This one is from PMID 22730554: Suo et al J. Mol Cell Biol 2012
    filename = 'cells/ko20x-07.CNG.swc'
    moose.Neutral( '/library' )
    rdes = rd.rdesigneur( \
            cellProto = [[ filename, 'elec' ] ],\
            passiveDistrib = passiveDistrib_,
            chanProto = chanProto_,
            chanDistrib = chanDistrib_
        )
    rdes.buildModel( '/model' )
    moose.reinit()

    ################## Now we store plots ########################
    somaVm = moose.Table( '/somaVm' )
    moose.connect( somaVm, 'requestOut', rdes.soma, 'getVm' )
    ################## Now we set up the display ########################
    compts = moose.wildcardFind( "/model/elec/#[ISA=CompartmentBase]" )
    compts[0].inject = inject

    print("Setting Up 3D Display")
    app = QtGui.QApplication(sys.argv)
    vm_viewer = create_vm_viewer(rdes, somaVm)
    vm_viewer.show()
    vm_viewer.start()
    return app.exec_()
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:27,代码来源:Fig2E.py


示例3: makeModel

def makeModel():
    moose.Neutral( '/library' )
    makeCellProto( 'cellProto' )
    makeChemProto( 'cProto' )
    makeSpineProto2( 'spine' )
    rdes = rd.rdesigneur( useGssa = False, \
            combineSegments = False, \
            stealCellFromLibrary = True, \
            meshLambda = 1e-6, \
            cellProto = [['cellProto', 'elec' ]] ,\
            spineProto = [['spineProto', 'spine' ]] ,\
            chemProto = [['cProto', 'chem' ]] ,\
            spineDistrib = [ \
                ['spine', '#', \
                'spacing', str( spineSpacing ), \
                'spacingDistrib', str( spineSpacingDistrib ), \
                'angle', str( spineAngle ), \
                'angleDistrib', str( spineAngleDistrib ), \
                'size', str( spineSize ), \
                'sizeDistrib', str( spineSizeDistrib ) ] \
            ], \
            chemDistrib = [ \
                [ "chem", "#", "install", "1" ] \
            ],
            adaptorList = [ \
                [ 'psd/Ca', 'conc', '.', 'inject', False, 0, 2e-9 ], \
                ] \
        )
    rdes.buildModel( '/model' )
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:29,代码来源:testWigglySpines.py


示例4: buildRdesigneur

def buildRdesigneur():
    ##################################################################
    # Here we define which prototypes are to be loaded in to the system.
    # Each specification has the format
    # source [localName]
    # source can be any of
    # filename.extension,   # Identify type of file by extension, load it.
    # function(),           # func( name ) builds object of specified name
    # file.py:function() ,  # load Python file, run function(name) in it.
    # moose.Classname       # Make obj moose.Classname, assign to name.
    # path                  # Already loaded into library or on path.
    # After loading the prototypes, there should be an object called 'name'
    # in the library.
    ##################################################################
    spineProto = [ \
        ['makeSpineProto()', 'spine' ]
    ]

    ##################################################################
    # Here we define what goes where, and any parameters. Each distribution
    # has the format
    # protoName, path, field, expr, [field, expr]...
    # where 
    #   protoName identifies the prototype to be placed on the cell
    #   path is a MOOSE wildcard path specifying where to put things
    #   field is the field to assign.
    #   expr is a math expression to define field value. This uses the
    #     muParser. Built-in variables are p, g, L, len, dia.
    #     The muParser provides most math functions, and the Heaviside 
    #     function H(x) = 1 for x > 0 is also provided.
    ##################################################################
    passiveDistrib = [ 
            [ ".", "#", "RM", "2.8", "CM", "0.01", "RA", "1.5",  \
                "Em", "-58e-3", "initVm", "-65e-3" ], \
            [ ".", "#axon#", "RA", "0.5" ] \
        ]
    spineDistrib = [ \
            ["spine", '#apical#', "spineSpacing", "20e-6", \
                "spineSpacingDistrib", "2e-6", \
                "angle", "0", \
                "angleDistrib", str( 2*PI ), \
                "size", "1", \
                "sizeDistrib", "0.5" ] \
        ]

    ######################################################################
    # Having defined everything, now to create the rdesigneur and proceed
    # with creating the model.
    ######################################################################
    

    rdes = rd.rdesigneur(
        combineSegments = combineSegments, \
        stealCellFromLibrary = True, \
        passiveDistrib = passiveDistrib, \
        spineDistrib = spineDistrib, \
        spineProto = spineProto \
    )

    return rdes
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:60,代码来源:Fig5A.py


示例5: main

def main():
    ######## Put your favourite cell model here ######
    ##This one is from PMID 19146814: Peng et al Neuron 2009
    filename = 'cells/K-18.CNG.swc'
    moose.Neutral( '/library' )
    rdes = rd.rdesigneur( \
            cellProto = [[ filename, 'elec' ] ],\
            spineProto = [['makeSpineProto()', 'spine' ]] ,\
            spineDistrib = [ \
                ['spine', '#', \
                'spacing', spineSpacing, \
                'spacingDistrib', str( minSpacing ), \
                'angle', str( spineAngle ), \
                'angleDistrib', str( spineAngleDistrib ), \
                'size', str( spineSize ), \
                'sizeDistrib', str( spineSizeDistrib ) ] \
            ] \
        )
    rdes.buildModel('/model')
    moose.reinit()
    compts = moose.wildcardFind( "/model/elec/#[ISA=CompartmentBase]" )
    compts[0].inject = inject

    ################## Now we set up the display ########################
    print "Setting Up 3D Display"
    app = QtGui.QApplication(sys.argv)
    vm_viewer = create_vm_viewer(rdes)
    vm_viewer.showMaximized()
    vm_viewer.start()
    return app.exec_()
开发者ID:2pysarthak,项目名称:moose-examples,代码行数:30,代码来源:Fig2D.py


示例6: makeModel

def makeModel():
    segLen = length / numDendSeg
    rdes = rd.rdesigneur(
        stealCellFromLibrary = True,
        elecPlotDt = elecPlotDt,
        verbose = False,
        # cellProto syntax: ['ballAndStick', 'name', somaDia, somaLength, dendDia, dendLength, numDendSegments ]
        # The numerical arguments are all optional
        cellProto = 
            [['ballAndStick', 'soma', dia, segLen, dia, length,numDendSeg]],
        chanProto = [['make_glu()', 'glu'],['make_NMDA()', 'nmda']],
        passiveDistrib = [[ '#', 'RM', str(RM), 'CM', str(CM), 'RA', str(RA) ]],
        chanDistrib = [
            ['glu', 'dend10,dend20,dend30,dend40', 'Gbar', str(gluGbar)],
            ['nmda', 'dend10,dend20,dend30,dend40', 'Gbar', str(nmdaGbar)],
        ],
        stimList = [
            ['dend10', '1','glu', 'periodicsyn', '{}*(t>{:.3f} && t<{:.3f})'.format( inputFreq, rec[0].onset, rec[0].onset + inputDuration) ],
            ['dend20', '1','glu', 'periodicsyn', '{}*(t>{:.3f} && t<{:.3f})'.format( inputFreq, rec[1].onset, rec[1].onset + inputDuration) ],
            ['dend30', '1','glu', 'periodicsyn', '{}*(t>{:.3f} && t<{:.3f})'.format( inputFreq, rec[2].onset, rec[2].onset + inputDuration) ],
            ['dend40', '1','glu', 'periodicsyn', '{}*(t>{:.3f} && t<{:.3f})'.format( inputFreq, rec[3].onset, rec[3].onset + inputDuration) ],
        ],
        plotList = [['soma,dend10,dend20,dend30,dend40', '1', '.', 'Vm' ]],
    )
    rdes.buildModel()
    #for i in moose.wildcardFind( '/model/elec/dend#/glu/sh/synapse/synInput_rs' ):
        #i.refractT = 0.0
    moose.connect( '/model/elec/dend10/glu/sh/synapse/synInput_rs', 'spikeOut', '/model/elec/dend10/nmda/sh/synapse', 'addSpike' )
    moose.connect( '/model/elec/dend20/glu/sh/synapse/synInput_rs', 'spikeOut', '/model/elec/dend20/nmda/sh/synapse', 'addSpike' )
    moose.connect( '/model/elec/dend30/glu/sh/synapse/synInput_rs', 'spikeOut', '/model/elec/dend30/nmda/sh/synapse', 'addSpike' )
    moose.connect( '/model/elec/dend40/glu/sh/synapse/synInput_rs', 'spikeOut', '/model/elec/dend40/nmda/sh/synapse', 'addSpike' )
开发者ID:dilawar,项目名称:moose-examples,代码行数:31,代码来源:ephys4_seq_summation.py


示例7: makeModel

def makeModel():
    cd = [
            ['glu', 'soma', 'Gbar', str(gluGbar)],
            ['GABA', 'soma', 'Gbar', str(gabaGbar)],
            ['K_A', 'soma', 'Gbar', str(K_A_Gbar)]
    ]
    cd.extend( spikingDistrib )
     
    rdes = rd.rdesigneur(
        elecPlotDt = elecPlotDt,
        stealCellFromLibrary = True,
        verbose = False,
        chanProto = [
            ['make_glu()', 'glu'],['make_GABA()', 'GABA'],
            ['make_K_A()','K_A'],
            ['make_Na()', 'Na'],['make_K_DR()', 'K_DR'],
        ],
        cellProto = [['somaProto', 'cellBase', dia, dia]],
        passiveDistrib = [[ '#', 'RM', str(RM), 'CM', str(CM), 'RA', str(RA) ]],
        chanDistrib = cd,
        stimList = [
            ['soma', '1','glu', 'periodicsyn', '{}*(t>{:.3f} && t<{:.3f})'.format( inputFreq, gluOnset, gluOnset + inputDuration) ],
            ['soma', '1','GABA', 'periodicsyn', '{}*(t>{:.3f} && t<{:.3f})'.format( inputFreq, gabaOnset, gabaOnset + inputDuration) ],
        ],
        plotList = [['soma', '1','.', 'Vm']],
    )
    moose.element( '/library/GABA' ).Ek = -0.07
    rdes.buildModel()
开发者ID:dilawar,项目名称:moose-examples,代码行数:28,代码来源:ephys6_div_normalization.py


示例8: loadModel

def loadModel(filename, chanProto, chanDistrib, passiveDistrib):
    """Load the model and insert channels """
    global modelName
    global nchans, ncompts

    # Load in the swc file.
    modelName = "elec"
    cellProto = [ ( filename, modelName ) ]
    rdes = rd.rdesigneur( cellProto = cellProto
            , combineSegments = True
            , passiveDistrib = passiveDistrib
            , chanProto = chanProto
            , chanDistrib = chanDistrib
            )

    rdes.buildModel('/model')

    compts = moose.wildcardFind( "/model/%s/#[ISA=CompartmentBase]"%modelName )
    setupStimuls( compts[0] )

    for compt in compts:
        vtab = moose.Table( '%s/vm' % compt.path )
        moose.connect( vtab, 'requestOut', compt, 'getVm' )
        _records[compt.path] = vtab

    nchans  = len(set([x.path for x in
        moose.wildcardFind('/model/elec/##[TYPE=ZombieHHChannel]')])
        )
    _logger.info("Total channels: %s" % nchans)
    return _records
开发者ID:BhallaLab,项目名称:benchmarks,代码行数:30,代码来源:loader_moose.py


示例9: makeModel

def makeModel():
    moose.Neutral( '/library' )
    makeCellProto( 'cellProto' )
    makeChemProto( 'cProto' )
    makeSpineProto2( 'spine' )
    rdes = rd.rdesigneur( useGssa = False, \
            combineSegments = False, \
            stealCellFromLibrary = True, \
            diffusionLength = 1e-6, \
            cellProto = [['cellProto', 'elec' ]] ,\
            spineProto = [['spineProto', 'spine' ]] ,\
            chemProto = [['cProto', 'chem' ]] ,\
            spineDistrib = [ \
                ['spine', '#', \
                'spacing', str( spineSpacing ), \
                'spacingDistrib', str( spineSpacingDistrib ), \
                'angle', str( spineAngle ), \
                'angleDistrib', str( spineAngleDistrib ), \
                'size', str( spineSize ), \
                'sizeDistrib', str( spineSizeDistrib ) ] \
            ], \
            chemDistrib = [ \
                [ "chem", "dend", "install", "1" ] \
            ],
            adaptorList = [ \
                [ 'psd/z', 'n', 'spine', 'psdArea', 10.0e-15, 300e-15 ], \
                ] \
        )
    rdes.buildModel( '/model' )
    x = moose.vec( '/model/chem/dend/x' )
    x.concInit = 0.0
    for i in range( 0,20 ):
        x[i].concInit = concInit
开发者ID:asiaszmek,项目名称:moose,代码行数:33,代码来源:rxdSpineSize.py


示例10: makeModel

def makeModel():
    spineAngle= numpy.pi / 2.0
    spineAngleDistrib = 0.0
    
    moose.Neutral( '/library' )
    makeCellProto( 'cellProto' )
    makeChemProto( 'cProto' )
    makeSpineProto2( 'spine' )
    rdes = rd.rdesigneur( 
            elecDt = 50e-6,
            chemDt = 5e-3,
            useGssa = False, \
            combineSegments = False, \
            stealCellFromLibrary = True, \
            diffusionLength = 1e-6, \
            cellProto = [['cellProto', 'elec' ]] ,\
            spineProto = [['spineProto', 'spine' ]] ,\
            chemProto = [['cProto', 'chem' ]] ,\
            spineDistrib = [ \
                ['spine', '#', 
                    str( spineSpacing ), str( spineSpacingDistrib ),
                    str( spineSize ), str( spineSizeDistrib ),
                    str( spineAngle ), str( spineAngleDistrib ) ]
            ], \
            chemDistrib = [ \
                [ "chem", "#", "install", "1" ] \
            ],
            adaptorList = [ \
                [ 'psd/Ca', 'conc', '.', 'inject', False, 0, 2e-9 ], \
                ] \
        )
    rdes.buildModel( '/model' )
开发者ID:dilawar,项目名称:moose-examples,代码行数:32,代码来源:testWigglySpines.py


示例11: test2

def test2( ):
    if moose.exists( '/model' ):
        moose.delete( '/model' )

    rdes = rd.rdesigneur(
        stimList = [['soma', '1', '.', 'inject', '(t>0.1 && t<0.2) * 2e-8' ]],
        plotList = [['soma', '1', '.', 'Vm', 'Soma membrane potential']]
    )
    rdes.buildModel()
    moose.reinit()
    moose.start( 0.3 )
开发者ID:hrani,项目名称:moose-core,代码行数:11,代码来源:test_rdesigneur.py


示例12: main

def main():
    """
This example illustrates loading a model from an SWC file, inserting
spines, and viewing it.

    """
    app = QtGui.QApplication(sys.argv)
    filename = 'barrionuevo_cell1zr.CNG.swc'
    #filename = 'h10.CNG.swc'
    moose.Neutral( '/library' )
    rdes = rd.rdesigneur( \
            cellProto = [[ filename, 'elec' ] ],\
            spineProto = [['makeSpineProto()', 'spine' ]] ,\
            spineDistrib = [ \
                ['spine', '#apical#', \
                'spacing', str( spineSpacing ), \
                'spacingDistrib', str( minSpacing ), \
                'angle', str( spineAngle ), \
                'angleDistrib', str( spineAngleDistrib ), \
                'size', str( spineSize ), \
                'sizeDistrib', str( spineSizeDistrib ) ] \
            ] \
        )
    rdes.buildModel( '/model' )
    moose.reinit()

    # Now we set up the display
    compts = moose.wildcardFind( "/model/elec/#[ISA=CompartmentBase]" )
    compts[0].inject = inject
    ecomptPath = [x.path for x in compts]
    morphology = moogli.read_morphology_from_moose(name = "", path = "/model/elec")
    #morphology.create_group( "group_all", ecomptPath, -0.08, 0.02, \
    #        [0.0, 0.5, 1.0, 1.0], [1.0, 0.0, 0.0, 0.9] )
    morphology.create_group( "group_all", ecomptPath, -0.08, 0.02, \
            gnuplot )

    viewer = moogli.DynamicMorphologyViewerWidget(morphology)
    viewer.set_background_color( 1.0, 1.0, 1.0, 1.0 )
    def callback( morphology, viewer ):
        moose.start( frameRunTime )
        Vm = [moose.element( x ).Vm for x in compts]
        morphology.set_color( "group_all", Vm )
        currTime = moose.element( '/clock' ).currentTime
        #print currTime, compts[0].Vm
        if ( currTime < runtime ):
            return True
        return False

    viewer.set_callback( callback, idletime = 0 )
    viewer.showMaximized()
    viewer.show()
    app.exec_()
开发者ID:asiaszmek,项目名称:moose,代码行数:52,代码来源:insertSpines.py


示例13: loadModel

def loadModel(filename, args):
    """Load the model and insert channels """
    global modelName
    global nchans, ncompts

    # Load in the swc file.
    modelName = "elec"
    cellProto = [ ( filename, modelName ) ]

    passiveDistrib = []
    chanDistrib = []
    if args.insert_channels:
        chanProto = [
                ['./chans/hd.xml'], 
                ['./chans/kap.xml'], 
                ['./chans/kad.xml'], 
                ['./chans/kdr.xml'], 
                ['./chans/na3.xml'], 
                ['./chans/nax.xml'], 
                ]

        passiveDistrib = [ 
                [ ".", "#", "RM", "2.8", "CM", "0.01", "RA", "1.5",  
                    "Em", "-58e-3", "initVm", "-65e-3" ], 
                [ ".", "#axon#", "RA", "0.5" ] 
                ]

        for c in _args.insert_channels:
            chanDistrib.append( c.split(";"))

    rdes = rd.rdesigneur( cellProto = cellProto
            , combineSegments = True
            , passiveDistrib = passiveDistrib
            , chanProto = chanProto
            , chanDistrib = chanDistrib
            )

    rdes.buildModel('/model')

    compts = moose.wildcardFind( "/model/%s/#[ISA=CompartmentBase]"%modelName )
    setupStimuls( compts[0] )

    for compt in compts:
        vtab = moose.Table( '%s/vm' % compt.path )
        moose.connect( vtab, 'requestOut', compt, 'getVm' )
        _records[compt.path] = vtab

    nchans  = len(set([x.path for x in
        moose.wildcardFind('/model/elec/##[TYPE=ZombieHHChannel]')])
        )
    _logger.info("Total channels: %s" % nchans)
开发者ID:BhallaLab,项目名称:benchmarks,代码行数:51,代码来源:loader_moose.py


示例14: runPanelCDEF

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 = int(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
开发者ID:dilawar,项目名称:moose-examples,代码行数:49,代码来源:Fig2_v4.py


示例15: makeModel

def makeModel():
    segLen = length / numDendSeg
    rdes = rd.rdesigneur(
        stealCellFromLibrary = True,
        elecPlotDt = elecPlotDt,
        verbose = False,
        # cellProto syntax: ['ballAndStick', 'name', somaDia, somaLength, dendDia, dendLength, numDendSegments ]
        # The numerical arguments are all optional
        cellProto = 
            [['ballAndStick', 'soma', dia, segLen, dia, length, numDendSeg]],
        passiveDistrib = [[ '#', 'RM', str(RM), 'CM', str(CM), 'RA', str(RA) ]],
        stimList = [['soma', '1', '.', 'inject', stimStr ]],
        plotList = [['dend3,dend18,dend33,dend49', '1', '.', 'Vm' ]],
    )
    rdes.buildModel()
开发者ID:dilawar,项目名称:moose-examples,代码行数:15,代码来源:ephys1_cable.py


示例16: makeModel

def makeModel():
    rdes = rd.rdesigneur( useGssa = False, \
                combineSegments = False, \
                cellPortion = "/model/elec/#",  \
                meshLambda = 1e-6, \
                adaptorList = [ \
                    ( 'psd', '.', 'inject', 'Ca', False, 0, 2e-9 ) \
                    ], \
                addSpineList = [ \
                    ( 'spine', '#', \
                    spineSpacing, spineSpacingDistrib, spineSizeDistrib, \
                    0.0, 0.0, numpy.pi, numpy.pi / 2.0 ) \
                    ]
                )
    # Make a 'bare' spine: No synchans, no ion chans, no Ca.
    rdes.addSpineProto( 'spine', RM, RA, CM, \
             synList = (), chanList = (), caTau = 0.0 )
    elec = moose.Neutral( '/tempelec' )
    '''
    ecompt = rdes._buildCompt( elec, 'dend', 100e-6, 2.0e-6, 0, RM, RA, CM )
    ecompt.x0 = 0
    ecompt.x = 0
    ecompt.y0 = 0
    ecompt.y = 0
    ecompt.z0 = 0
    ecompt.z = 100e-6
    '''
    ecompt = []
    for i in range( numDendSegments ):
        ec = rdes._buildCompt( elec, 'dend' + str(i), segLen, 2.0e-6, i * segLen, RM, RA, CM )
        ecompt.append( ec )
        if i > 0:
            moose.connect( ecompt[i-1], 'raxial', ec, 'axial' )
    for i in ecompt:
        i.z0 = i.x0
        i.x0 = 0
        i.z = i.x
        i.x = 0

    chem = moose.Neutral( '/tempchem' )
    for i in ( 'dend', 'spine', 'psd' ):
        compt = moose.CubeMesh( '/tempchem/' + i )
        compt.volume = 1e-18
        ca = moose.Pool( '/tempchem/' + i + '/Ca' )
        ca.concInit = 0.08e-3
        ca.diffConst = 1e-12
    rdes.buildFromMemory( '/tempelec', '/tempchem' )
开发者ID:csiki,项目名称:moose-1,代码行数:47,代码来源:testRdesigneur.py


示例17: main

def main():
    app = QtGui.QApplication(sys.argv)
    filename = 'barrionuevo_cell1zr.CNG.swc'
    #filename = 'h10.CNG.swc'
    moose.Neutral( '/library' )
    rdes = rd.rdesigneur()
    rdes.addSpineProto( 'spine', RM, RA, CM, \
             synList = (), chanList = (), caTau = 0.0 )
    moose.Neutral( '/model' )
    cell = moose.loadModel( filename, '/model/testSwc' )
    cell[0].spineSpecification = [ 'spine #apical# '+ spineArgLine, \
        'spine #dend# ' + spineArgLine ]
    cell[0].parseSpines()
    # moose.le( cell )
    for i in range( 8 ):
        moose.setClock( i, simdt )
    hsolve = moose.HSolve( '/model/testSwc/hsolve' )
    hsolve.dt = simdt
    hsolve.target = '/model/testSwc/soma'
    moose.reinit()

    # Now we set up the display
    compts = moose.wildcardFind( "/model/testSwc/#[ISA=CompartmentBase]" )
    compts[0].inject = inject
    ecomptPath = map( lambda x : x.path, compts )
    morphology = moogli.read_morphology_from_moose(name = "", path = "/model/testSwc")
    morphology.create_group( "group_all", ecomptPath, -0.08, 0.02, \
            [0.0, 0.5, 1.0, 1.0], [1.0, 0.0, 0.0, 0.9] ) 

    viewer = moogli.DynamicMorphologyViewerWidget(morphology)
    def callback( morphology, viewer ):
        moose.start( frameRunTime )
        Vm = map( lambda x: moose.element( x ).Vm, compts )
        morphology.set_color( "group_all", Vm )
        currTime = moose.element( '/clock' ).currentTime
        #print currTime, compts[0].Vm
        if ( currTime < runtime ):
            return True
        return False

    viewer.set_callback( callback, idletime = 0 )
    viewer.showMaximized()
    viewer.show()
    app.exec_()
开发者ID:iampritishpatil,项目名称:moose,代码行数:44,代码来源:insertSpines.py


示例18: makeModel

def makeModel():
    rdes = rd.rdesigneur(
        elecPlotDt = elecPlotDt,
        stealCellFromLibrary = True,
        verbose = False,
        #chanProto = [['make_glu()', 'glu'],['make_GABA()', 'GABA']],
        chanProto = [
            ['make_Na()', 'Na'],
            ['make_K_DR()', 'K_DR'],
            ['make_K_A()', 'K_A'],
            ['make_Ca()', 'Ca'],
            ['make_Ca_conc()', 'Ca_conc'],
            ['make_K_AHP()', 'K_AHP'],
            ['make_K_C()', 'K_Ca'],
        ],
        # cellProto syntax: ['ballAndStick', 'name', somaDia, somaLength, dendDia, dendLength, numDendSegments ]
        # The numerical arguments are all optional
        cellProto = 
            [['somaProto', 'cellBase', diameter, diameter]],
        passiveDistrib = [[ '#', 'RM', str(RM), 'CM', str(CM), 'RA', str(RA) ]],
        chanDistrib = [
            ['Ca_conc', 'soma', 'tau', '0.01333' ],
            ['Na', 'soma', 'Gbar', '100' ],
            ['K_DR', 'soma', 'Gbar', '100' ],
            ['K_A', 'soma', 'Gbar', '100' ],
            ['Ca', 'soma', 'Gbar', '100' ],
            ['K_Ca', 'soma', 'Gbar', '100' ],
            ['K_AHP', 'soma', 'Gbar', '10' ],
        ],
        plotList = [['soma', '1','.', 'Vm'], ['soma', '1', 'Ca_conc', 'Ca']]
    )
    moose.element( '/library/Ca_conc' ).CaBasal=0.08e-3
    rdes.buildModel()
    for i in moose.wildcardFind( '/model/elec/soma/#[ISA=ChanBase]' ):
        i.modulation = 1e-6
    moose.element( '/model/elec/soma/Na' ).modulation = 1
    moose.element( '/model/elec/soma/K_DR' ).modulation = 1
开发者ID:dilawar,项目名称:moose-examples,代码行数:37,代码来源:ephys5_channel_mixer.py


示例19: makeFuncRate

    moose.connect( C, 'nOut', func.x[0], 'input' )
    moose.connect( func, 'valueOut', reac, 'setNumKf' )
    moose.connect( reac, 'sub', A, 'reac' )
    moose.connect( reac, 'prd', B, 'reac' )

    A.concInit = 1
    B.concInit = 0
    C.concInit = 0
    reac.Kb = 1


makeFuncRate()

rdes = rd.rdesigneur(
        turnOffElec = True,
        #This subdivides the 50-micron cylinder into 2 micron voxels
        diffusionLength = 2e-6,
        cellProto = [['somaProto', 'soma', 5e-6, 50e-6]],
        chemProto = [['chem', 'chem']],
        chemDistrib = [['chem', 'soma', 'install', '1' ]],
        plotList = [['soma', '1', 'dend/A', 'conc', 'A conc', 'wave'],
            ['soma', '1', 'dend/C', 'conc', 'C conc', 'wave']],
)
rdes.buildModel()

C = moose.element( '/model/chem/dend/C' )
C.vec.concInit = [ 1+np.sin(x/5.0) for x in range( len(C.vec) ) ]
moose.reinit()
moose.start(10)
rdes.display()
开发者ID:dilawar,项目名称:moose-examples,代码行数:30,代码来源:ex7.6_func_controls_reac_rate.py


示例20:

import moose
import pylab
import rdesigneur as rd
rdes = rd.rdesigneur(
    chanProto = [['make_HH_Na()', 'Na'], ['make_HH_K()', 'K']],
    chanDistrib = [ 
        ['Na', 'soma', 'Gbar', '1200' ], 
        ['K', 'soma', 'Gbar', '360' ]],
    stimList = [['soma', '1', '.', 'inject', '(t>0.1 && t<0.2) * 1e-8' ]],
    plotList = [['soma', '1', '.', 'Vm', 'Membrane potential']]
)

rdes.buildModel()
moose.reinit()
moose.start( 0.3 )

rdes.display()
开发者ID:dharmasam9,项目名称:moose-core,代码行数:17,代码来源:rdes_ex3.py



注:本文中的rdesigneur.rdesigneur函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python rdflib.ConjunctiveGraph类代码示例发布时间:2022-05-26
下一篇:
Python defaultParams.iteritems函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap