Exemple #1
0
    def test_ttl_simple(self):
        # this fails when
        # test_integration.py is run
        # AND
        # test_roundtrip_py is run
        # but NOT when either is run independently
        from neurondm import Config, Neuron, Phenotype, NegPhenotype

        config = Config('test-ttl', ttl_export_dir=tel, py_export_dir=pyel)
        Neuron(Phenotype('TEMP:turtle-phenotype'))
        Neuron(NegPhenotype('TEMP:turtle-phenotype'))
        config.write()
        a = config.neurons()

        config2 = Config('test-ttl', ttl_export_dir=tel, py_export_dir=pyel)
        config2.load_existing()
        config2.write_python()
        b = config2.neurons()

        config3 = Config('test-ttl', ttl_export_dir=tel, py_export_dir=pyel)
        config3.load_python()
        c = config3.neurons()

        print(a, b, c)
        assert config.existing_pes is not config2.existing_pes is not config3.existing_pes
        assert a == b == c
Exemple #2
0
    def test_zz_adopt(self):
        from neurondm.lang import Neuron, Phenotype, Config
        ndl_config = Config('neuron_data_lifted')
        ndl_config.load_existing()
        bn_config = Config('basic-neurons')
        bn_config.load_existing()
        ndl_neurons = ndl_config.neurons()
        bn_neurons = bn_config.neurons()
        config = Config('__test_output', ttl_export_dir=tel)
        shapeshifter = Neuron(Phenotype('TEMP:soul-stealer'))
        for n in ndl_neurons:
            shapeshifter.adopt_meta(n)

        assert list(n.synonyms)
        assert list(n.definitions)
        n.write()

        assert list(shapeshifter.synonyms)
        assert list(shapeshifter.definitions)
        shapeshifter.write()

        # it eats _all_ of them
        allsyns = set(shapeshifter.synonyms)
        alldefs = set(shapeshifter.definitions)
        assert all(s in allsyns for s in n.synonyms)
        assert all(s in alldefs for s in n.definitions)
Exemple #3
0
def needs_keast_namespace():
    """ define neurons for keast spinal """
    common = {
        L1: (L1_vr, L1_wr),
        L2: (L2_vr, L2_wr),
    }
    common67 = {
        L1: (L1_gr, ),
        L2: (L2_gr, ),
    }

    neuron_2 = [Neuron(PG, n_bl, synloc) for synloc in (BNWsyn, BDWsyn)]
    neuron_4 = []

    with Neuron(SPG4, n_ps, PGax, n_bl):
        for soma_location_id in four_soma_locs:
            somaloc = Phenotype(soma_location_id, slp)
            for exits_via in ((L6_gr, ), (
                    S1ax,
                    S1_gr,
            )):
                for synapses_on in (BNVWsyn, BDVWsyn):
                    # 4
                    n4 = Neuron(somaloc, *exits_via, synapses_on)
                    neuron_4.append(n4)

    neuron_6 = []
    neuron_7 = []
    neuron_8 = []
    with NeuronKeast2020(VII, SPGfcon):
        for i, somaloc in enumerate((L1, L2)):
            soma_index = i + 2  # L1 aligns to the 3rd the sypathetic ganglion
            with Neuron(somaloc, *common[somaloc]):
                with Neuron(n_ls, *common67[somaloc]):
                    # 6
                    n6 = Neuron(IMGax, n_hg, PGsyn)
                    neuron_6.append(n6)  # TODO fcon
                    # 7
                    n7 = Neuron(IMGsyn)
                    neuron_7.append(n7)  # TODO fcon

                # 8
                for syn_index, synloc in enumerate(four_soma_locs):
                    axons_in = syn_chain_axons_in(syn_index, soma_index)
                    syn = Phenotype(synloc, synp)
                    n8 = Neuron(syn, *axons_in)
                    neuron_8.append(n8)
Exemple #4
0
 def test_fail(self):
     from neurondm.lang import Neuron, Phenotype, Config
     bn_config = Config('basic-neurons')
     # TODO config.activate()? context manager for config ... too ...
     Neuron(Phenotype('TEMP:test'))
     try:
         bn_config.load_existing()
         raise AssertionError(
             'Should have failed because a neuron has been created')
     except Config.ExistingNeuronsError as e:
         pass
Exemple #5
0
    def test_py_simple(self):
        from neurondm import Config, Neuron, Phenotype, NegPhenotype

        config = Config('test-py', ttl_export_dir=tel, py_export_dir=pyel)
        n1 = Neuron(Phenotype('TEMP:python-phenotype'))
        n2 = Neuron(NegPhenotype('TEMP:python-phenotype'))
        assert n1 != n2
        config.write_python()

        config2 = Config('test-py', ttl_export_dir=tel, py_export_dir=pyel)
        config2.load_python()  # FIXME load existing python ...
        config2.write()

        config3 = Config('test-py', ttl_export_dir=tel, py_export_dir=pyel)
        config3.load_existing()

        assert config.existing_pes is not config2.existing_pes is not config3.existing_pes
        assert config.neurons() == config2.neurons() == config3.neurons()
Exemple #6
0
    def test_0_equality(self):
        """ make sure that __eq__ and __hash__ are implmented correctly """
        from neurondm import Config, Neuron, Phenotype, NegPhenotype
        from neurondm import LogicalPhenotype, AND, OR, ilxtr
        from neurondm import NeuronCUT, NeuronEBM

        config = Config('test-equality',
                        ttl_export_dir=tel,
                        py_export_dir=pyel)

        pp = Phenotype(ilxtr.a)
        pn = NegPhenotype(ilxtr.a)
        assert pp != pn
        assert hash(pp) != hash(pn)

        assert Phenotype(ilxtr.c) == Phenotype(ilxtr.c)
        assert NegPhenotype(ilxtr.c) == NegPhenotype(ilxtr.c)
        assert hash(Phenotype(ilxtr.c)) == hash(Phenotype(ilxtr.c))
        assert hash(NegPhenotype(ilxtr.c)) == hash(NegPhenotype(ilxtr.c))

        lppo = LogicalPhenotype(OR, pp, Phenotype(ilxtr.b))
        lppa = LogicalPhenotype(AND, pp, Phenotype(ilxtr.b))
        lpno = LogicalPhenotype(OR, pn, NegPhenotype(ilxtr.b))
        assert lppo != lppa
        assert lppo != lpno
        assert lppa != lpno
        assert hash(lppo) != hash(lppa)
        assert hash(lppo) != hash(lpno)
        assert hash(lppa) != hash(lpno)

        lpe1 = LogicalPhenotype(OR, Phenotype(ilxtr.c), Phenotype(ilxtr.d))
        lpe2 = LogicalPhenotype(OR, Phenotype(ilxtr.c), Phenotype(ilxtr.d))
        assert lpe1 == lpe2
        assert hash(lpe1) == hash(lpe2)

        # make sure that self.pes equality works
        assert (pp, pn, lppo, lppa, lpno) == (pp, pn, lppo, lppa, lpno)

        npp = Neuron(pp)
        npn = Neuron(pn)
        assert npp != npn
        assert hash(npp) != hash(npn)

        nlppo = Neuron(lppo)
        nlppa = Neuron(lppa)
        nlpno = Neuron(lpno)

        assert nlppo != nlppa
        assert nlppo != nlpno
        assert nlppa != nlpno
        assert hash(nlppo) != hash(nlppa)
        assert hash(nlppo) != hash(nlpno)
        assert hash(nlppa) != hash(nlpno)

        assert Neuron(pp) == Neuron(pp)
        assert Neuron(pn) == Neuron(pn)
        assert hash(Neuron(pp)) == hash(Neuron(pp))
        assert hash(Neuron(pn)) == hash(Neuron(pn))

        assert NeuronCUT(pp) != NeuronEBM(pp)
        assert hash(NeuronCUT(pp)) != hash(NeuronEBM(pp))
Exemple #7
0
def needs_keast_namespace(config):
    """ define neurons for keast spinal """

    plut = {v:k for k, v in Keast2020.items()}
    def fn(phen):
        return plut[phen]

    # define the inferred parents for neuron populations
    for n in (2, 4, 5, 6, 7, 8, 9, 10, 11, 12):
        NeuronKeast2020(Keast2020[f'ntk_{n}'], id_=ntkb[str(n)], **kld(n))
        # FIXME hack
        config.out_graph.add((npkb[str(n)], rdfs.subClassOf, ilxtr.Phenotype))

    # FIXME spinal cord white matter axons are missing from these bags

    # neuron populations
    neuron_1 = [kNeuron(PG, n_bl, BDWsyn, BNWsyn, para, post, id_=ntkb['1'], **kld(1))]  # pos
    neuron_2 = [kNeuron(PG, n_bl, synloc, sym, post, ntk_2_ent, id_=ntku[f'2-{fn(synloc)}'])
                for synloc in (BDWsyn, BNWsyn)]  # sos # FIXME smooth muslce only
    neuron_3 = [kNeuron(IMG, BDWsyn, BNWsyn, sym, post, id_=ntkb['3'], **kld(3))]  # sos # FIXME smooth muscle only

    neuron_4 = []  # sos
    with Neuron(n_ps, PGax, n_bl, sym, post, id_=ntkh['common-4']):
        for soma_location_id in four_soma_locs:
            somaloc = Phenotype(soma_location_id, slp)
            for exits_via in ((L6_gr,), (S1ax, S1_gr,)):
                for synapses_on in (BNVWsyn, BDVWsyn):
                    # 4
                    n4 = kNeuron(
                        somaloc, *exits_via, synapses_on, ntk_4_ent,
                        id_=ntku[f'4-{fn(somaloc)}-{fn(exits_via[0])}-{fn(synapses_on)}'])
                    neuron_4.append(n4)

    neuron_5 = []  # pre
    with Neuron(VII, n_ps, PGax, PGsyn, ntk_1_fcon, para, pre,
                id_=ntkh['common-5']):
        for somaloc, ventral_root_exit in zip((L6,    S1),
                                              (L6_vr, S1_vr)):
            n5 = kNeuron(somaloc, ventral_root_exit, ntk_5_ent,
                         id_=ntku[f'5-{fn(somaloc)}'])
            neuron_5.append(n5)

    common = {L1: (L1_vr, L1_wr),
              L2: (L2_vr, L2_wr),}
    common67 = {L1: (L1_gr,),
                L2: (L2_gr,),}

    neuron_6 = []  # sre
    neuron_7 = []  # sre
    neuron_8 = []  # sre
    with Neuron(VII, WMax, sos_fcon, sym, pre,
                id_=ntkh['common-6-7-8']):
        for i, somaloc in enumerate((L1, L2)):
            soma_index = i + 2  # L1 aligns to the 3rd the sypathetic ganglion
            # which is of course the L1 sypathetic ganglion, but it is
            # the 3rd ganlion in the model with a neuron 4 soma
            with Neuron(somaloc, *common[somaloc], id_=ntkh[f'common-6-7-8-{fn(somaloc)}']):
                with Neuron(n_ls, *common67[somaloc], id_=ntkh[f'common-6-7-{fn(somaloc)}-extra']):
                    # 6
                    n6 = kNeuron(IMGax, n_hg, PGsyn, ntk_6_ent, ntk_2_fcon,
                                 id_=ntku[f'6-{fn(somaloc)}'])
                    neuron_6.append(n6)
                    # 7
                    n7 = kNeuron(IMGsyn, ntk_7_ent, ntk_3_fcon,
                                 id_=ntku[f'7-{fn(somaloc)}'])
                    neuron_7.append(n7)

                # 8
                for syn_index, synloc in enumerate(four_soma_locs):
                    axons_in = syn_chain_axons_in(syn_index, soma_index)
                    syn = Phenotype(synloc, synp)
                    n8 = kNeuron(syn, *axons_in, ntk_8_ent, ntk_4_fcon,
                                 id_=ntku[f'8-{fn(somaloc)}-{fn(syn)}'])
                    neuron_8.append(n8)

    neuron_9 = []  # slm
    with Neuron(IX, WMax, n_pu, URTsyn, motor, id_=ntkh['common-9']):
        for somaloc, ventral_root_exit in zip((L5,    L6),
                                              (L5_vr, L6_vr)):
            n9 = kNeuron(somaloc, ventral_root_exit, ntk_9_ent, id_=ntku[f'9-{fn(somaloc)}'])
            neuron_9.append(n9)

    neuron_10 = []  # fos
    neuron_11 = []  # fos
    neuron_12 = []  # fos
    with Neuron(Isyn, IIsyn, Vsyn, VIIsyn, Xsyn, sens,
                id_=ntkh['common-10-11-12']):  # 10 11 12 XXX layers are wrong, intersection has to come before phenotype
        for somaloc in (L6_dr, S1_dr):
            n10 = kNeuron(somaloc, n_ps_dn, PGdn, n_bl_dn, ntk_10_ent,
                          id_=ntku[f'10-{fn(somaloc)}'])  # TODO a bunch of other sensory terminals
            neuron_10.append(n10)

            n12 = kNeuron(somaloc, n_pu_dn, URTdn, ntk_12_ent,
                          id_=ntku[f'12-{fn(somaloc)}'])  # TODO URTdn layer is rhabdosphincter
            neuron_12.append(n12)

        for somaloc in (L1_dr, L2_dr):
            n11 = kNeuron(somaloc, n_ls_dn, IMGdn, n_hg_dn, PGdn, n_bl_dn, ntk_11_ent,
                          id_=ntku[f'11-{fn(somaloc)}'])  # TODO bladder and layers
            neuron_11.append(n11)

    # thankfully alphabetical from head to toe
    with Neuron(pons_ax, id_=ntkh['axon-pons']):
        with Neuron(midbrain_ax, id_=ntkh['axon-midbrain']):
            with Neuron(dienc_ax, id_=ntkh['axon-dienceph']):
                with Neuron(cn_ax, id_=ntkh['axon-cernuc']):
                    neuron_13 = [kNeuron(BNST, BRGTNsyn, id_=ntkb['13'], **kld(13))]  # soma in BNST   ???
                    neuron_14 = [kNeuron(CeA, BRGTNsyn, id_=ntkb['14'], **kld(14))]   # soma in CeA    ???
                neuron_15 = [kNeuron(MPOA, BRGTNsyn, id_=ntkb['15'], **kld(15))]  # soma in MPOA   ???
                neuron_16 = [kNeuron(MnPO, BRGTNsyn, id_=ntkb['16'], **kld(16))]  # soma in MnPO   ???
                neuron_17 = [kNeuron(LPOA, BRGTNsyn, id_=ntkb['17'], **kld(17))]  # soma in LPOA   ???
                neuron_18 = [kNeuron(LHA, BRGTNsyn, id_=ntkb['18'], **kld(18))]   # soma in LHA    ???
            neuron_19 = [kNeuron(VLPAG, BRGTNsyn, id_=ntkb['19'], **kld(19))] # soma in VLPAG  ???
        neuron_20 = [kNeuron(BRGTN, id_=ntkb['20'], **kld(20))]  # soma in BRGTN  ??? # TODO many a syntapse


    # implicit types (parents) # FIXME XXX required modelling in many cases
    fos = first_order_sensory = [neuron_10, neuron_11, neuron_12]
    slm = somatic_lower_motor = [neuron_9]

    _pre = parasympathetic_pre_ganglionic = [neuron_5]
    pos = parasympathetic_post_ganglionic = [neuron_1]
    # para pre -> has soma located in some not sympathetic chain and projects to some ganglion that is also projected to by some sym pre
    # para post -> has reverse connection phenotype some para pre

    sre = sympathetic_pre_ganglionic = [neuron_6, neuron_7, neuron_8]
    sos = sympathetic_post_ganglionic = [neuron_2, neuron_3, neuron_4]
Exemple #8
0
class Keast2020(LocalNameManager):

    locals().update(ntks)  # LOL ?! this works !?

    # soma layers
    VII= Phenotype('UBERON:0016578', sllp)  # 'ilxtr:spinal-VII'
    IX = Phenotype('UBERON:0016580', sllp)  # 'ilxtr:spinal-IX'

    # soma locations

    #L1 = Phenotype('ilxtr:spinal-L1', slp)
    #L2 = Phenotype('ilxtr:spinal-L2', slp)
    #L5 = Phenotype('ilxtr:spinal-L5', slp)
    #L6 = Phenotype('ilxtr:spinal-L6', slp)
    #S1 = Phenotype('ilxtr:spinal-S1', slp)
    L1 = Phenotype('UBERON:0006448', slp)  # XXX fma in sct
    L2 = Phenotype('UBERON:0006450', slp)  # XXX fma in sct
    L5 = Phenotype('UBERON:0006447', slp)  # XXX fma in sct
    L6 = Phenotype('ILX:0793358', slp)
    S1 = Phenotype('UBERON:0006460', slp)  # XXX fma in sct

    IMG = Phenotype('UBERON:0005453', slp)  # ilxtr:IMG
    PG = Phenotype('UBERON:0016508', slp)  # ilxtr:PG

    #L1_dr = Phenotype('ilxtr:dr-L1', slp)  # soma implies ax + dn
    #L2_dr = Phenotype('ilxtr:dr-L2', slp)
    #L6_dr = Phenotype('ilxtr:dr-L6', slp)
    #S1_dr = Phenotype('ilxtr:dr-S1', slp)
    L1_dr = Phenotype('UBERON:0002855', slp)  # soma implies ax + dn
    L2_dr = Phenotype('UBERON:0002856', slp)
    L6_dr = Phenotype('ILX:0793360', slp)
    S1_dr = Phenotype('UBERON:0002860', slp)

    # sort of nerves
    L1_vr = Phenotype('ILX:0785421', alp)  # ventral root 'ilxtr:vr-L1'  # XXX fma in sct
    L1_wr = Phenotype('ILX:0793220', alp)  # white ramus 'ilxtr:wr-L1'  # XXX FMA in sct

    L1_gr = Phenotype('ILX:0785825', alp)  # gray ramus 'ilxtr:gr-L1'  # XXX fma in sct

    L2_vr = Phenotype('ILX:0788675', alp)  # 'ilxtr:vr-L2'  # XXX fma in sct
    L2_wr = Phenotype('ILX:0793221', alp)  # 'ilxtr:wr-L2'  # XXX FMA in sct

    L2_gr = Phenotype('ILX:0785733', alp)  # 'ilxtr:gr-L2'  # XXX fma in sct

    L5_vr = Phenotype('ILX:0791148', alp)  # 'ilxtr:vr-L5'  # XXX fma in sct

    L6_gr = Phenotype('ILX:0739299', alp)  # 'ilxtr:gr-L6'
    L6_vr = Phenotype('ILX:0793615', alp)  # 'ilxtr:vr-L6'

    S1_gr = Phenotype('ILX:0793228', alp)  # 'ilxtr:gr-S1'  # XXX fma in sct
    S1_vr = Phenotype('ILX:0792853', alp)  # 'ilxtr:vr-S1'  # XXX fma in sct

    IMGax = Phenotype('UBERON:0005453', alp)
    PGax = Phenotype('UBERON:0016508', alp)

    S1ax = Phenotype('ILX:0793350', alp)  # 'ilxtr:sc-S1'

    # ilxtr:spinal-white-matter technically a layer
    # FIXME because axon location does not have cardianlity 1 WMax is
    # ambiguous unless it is composed with a layer of the spinal cord
    # because the operation is not commutative with card > 1
    #WMax = Phenotype('ilxtr:spinal-white-matter', alp)
    WMax = Phenotype('UBERON:0002318', alp)


    # sensory dendrite sort of nerves
    IMGdn = Phenotype('UBERON:0005453', dlp)
    PGdn = Phenotype('UBERON:0016508', dlp)

    # XXX FIXME I'm being something of a literalist here, and guessing that
    # the boxes that are drawn for these might not actually be what is intended
    cn_ax = Phenotype('UBERON:0010011', alp)  # collection of basal ganglia, syn cerebral nuclei ??
    dienc_ax = Phenotype('UBERON:0001894', alp)
    midbrain_ax = Phenotype('UBERON:0001891', alp)
    pons_ax = Phenotype('UBERON:0000988', alp)
    medulla_ax = Phenotype('UBERON:0001896', alp)

    # nerves
    #n_bl = Phenotype('ilxtr:nerve-bladder', alp)
    #n_hg = Phenotype('ilxtr:nerve-hypogastric', alp)
    #n_ls = Phenotype('ilxtr:nerve-lumbar-splanic', alp)
    #n_ps = Phenotype('ilxtr:nerve-pelvic-splanic', alp) # splanchnic
    #n_pu = Phenotype('ilxtr:nerve-pudendal', alp)
    n_bl = Phenotype('ILX:0793559', alp)
    n_hg = Phenotype('UBERON:0005303', alp)
    n_ls = Phenotype('UBERON:0018683', alp)
    n_ps = Phenotype('UBERON:0018675', alp)
    n_pu = Phenotype('UBERON:0011390', alp)

    # sensory ??ents
    #n_bl_dn = Phenotype('ilxtr:nerve-bladder', dlp)
    #n_hg_dn = Phenotype('ilxtr:nerve-hypogastric', dlp)
    #n_ls_dn = Phenotype('ilxtr:nerve-lumbar-splanic', dlp)
    #n_ps_dn = Phenotype('ilxtr:nerve-pelvic-splanic', dlp)
    #n_pu_dn = Phenotype('ilxtr:nerve-pudendal', dlp)
    n_bl_dn = Phenotype('ILX:0793559', dlp)
    n_hg_dn = Phenotype('UBERON:0005303', dlp)
    n_ls_dn = Phenotype('UBERON:0018683', dlp)
    n_ps_dn = Phenotype('UBERON:0018675', dlp)
    n_pu_dn = Phenotype('UBERON:0011390', dlp)

    #URTdn = Phenotype('ilxtr:urethra', dlp)
    URTdn = Phenotype('UBERON:0000057', dlp)

    # synaptic locations
    IMGsyn = Phenotype('UBERON:0005453', synp)
    PGsyn = Phenotype('UBERON:0016508', synp)

    BNVWsyn = Phenotype('ilxtr:bladder-neck-vessel-wall', synp)
    BDVWsyn = Phenotype('ilxtr:bladder-dome-vessel-wall', synp)

    BDWsyn = Phenotype('ilxtr:bladder-dome-wall', synp)
    BNWsyn = Phenotype('ILX:0774144', synp)  # 'ilxtr:bladder-neck-wall'

    #URTsyn = Phenotype('ilxtr:urethra', synp)
    URTsyn = Phenotype('UBERON:0000057', synp)

    BNST = Phenotype('UBERON:0001880', slp)
    CeA = Phenotype('UBERON:0002883', slp)  # central amygdala
    MPOA = Phenotype('UBERON:0007769', slp)
    MnPO = Phenotype('UBERON:0002625', slp)
    LPOA = Phenotype('UBERON:0001931', slp)
    LHA = Phenotype('UBERON:0002430', slp)
    VLPAG = Phenotype('ILX:0793626', slp) # vent lat peri aq gray
    BRGTN = Phenotype('UBERON:0007632', slp) # barrington's nucleus

    BRGTNsyn = Phenotype('UBERON:0007632', synp)

    # FIXME synp into layer has the cardinality issue
    # with the fact that (intersection (phenotype layer hp) (phenotype region hp))
    # is not commutative with (phenotype (intersection layer region) hp)
    # when the relationship hp allows cardinality > 1

    #Isyn = Phenotype('ilxtr:spinal-I', synp)
    #IIsyn = Phenotype('ilxtr:spinal-II', synp)
    #Vsyn = Phenotype('ilxtr:spinal-V', synp)
    #VIIsyn = Phenotype('ilxtr:spinal-VII', synp)
    #Xsyn = Phenotype('ilxtr:spinal-X', synp)
    Isyn = Phenotype('UBERON:0006118', synp)
    IIsyn = Phenotype('ILX:0110092', synp)
    Vsyn = Phenotype('UBERON:0016576', synp)
    VIIsyn = Phenotype('UBERON:0016578', synp)
    Xsyn = Phenotype('ILX:0110100', synp)

    # sensory substructure locations

    # target cell types
    #ntk_4 = Phenotype('ilxtr:neuron-phenotype-keast-4', 'ilxtr:hasPhenotype')  # FIXME what is this really?
    #ntk_4_ent = EntailedPhenotype('ilxtr:neuron-phenotype-keast-4', 'ilxtr:hasPhenotype')  # FIXME what is this really?
    # XXX using a specific phenotype here is undesireable, because it must _always_ be asserted
    # in order for membership to be determined, this is true for individuals as well, therefore this
    # should be used as entailed restriction so that anything that matches the necessary contitions
    # will automatically classify as a result

    # is this a phenotype or a superclass? XXX kind of dirty to do it this way by creating an aribrary
    # phenotype that is borne by these, but being marked as a keast-type-4 neuron is a thing so here we are
    # in a pure type world, this would be the coloring and the numbering, but it is more assertional
    # making it a superclass is probably better than

    ntk_1_fcon = Phenotype('ilxtr:neuron-type-keast-1', fconp)
    ntk_2_fcon = Phenotype('ilxtr:neuron-type-keast-2', fconp)
    ntk_3_fcon = Phenotype('ilxtr:neuron-type-keast-3', fconp)
    ntk_4_fcon = Phenotype('ilxtr:neuron-type-keast-4', fconp)

    # FIXME this is super confusing, but this id is equivalent to all
    # neurons that bear the ilxtr:neuron-phenotype-sym-post phenotype
    sos_fcon = Phenotype('ilxtr:sympathetic-post-ganglionic', fconp)  # FIXME likely overly broad?

    # (para)?sympathetic colorings (until we can get deeper modelling correct)
    #para_pre = Phenotype('ilxtr:neuron-phenotype-para-pre')
    #para_post = Phenotype('ilxtr:neuron-phenotype-para-post')
    #sym_pre = Phenotype('ilxtr:neuron-phenotype-sym-pre')
    #sym_post = Phenotype('ilxtr:neuron-phenotype-sym-post')

    para = Phenotype('ilxtr:ParasympatheticPhenotype')
    sym = Phenotype('ilxtr:SympatheticPhenotype')
    pre = Phenotype('ilxtr:PreGanglionicPhenotype')
    post = Phenotype('ilxtr:PostGanglionicPhenotype')

    sens = Phenotype('ilxtr:SensoryPhenotype')
    motor = Phenotype('ilxtr:MotorPhenotype')
Exemple #9
0
    # para pre -> has soma located in some not sympathetic chain and projects to some ganglion that is also projected to by some sym pre
    # para post -> has reverse connection phenotype some para pre

    sre = sympathetic_pre_ganglionic = [neuron_6, neuron_7, neuron_8]
    sos = sympathetic_post_ganglionic = [neuron_2, neuron_3, neuron_4]
    # sym pre -> has forward connection phenotype some neuron population with cell body ni synaptic chain or other sympathetic ganglion???
    # sym post -> has reverse connection phenotype some sym pre
    # XXX these definitions are not good an collide with para I think

    #[print(repr(n)) for n in Neuron.neurons()]


ntks = {k: v
        for i in range(1,13)
        for (k, v) in (
                (f'ntk_{i}', Phenotype(npkb[str(i)], 'ilxtr:hasPhenotype')),
                (f'ntk_{i}_ent', EntailedPhenotype(npkb[str(i)], 'ilxtr:hasPhenotype')))}


class Keast2020(LocalNameManager):

    locals().update(ntks)  # LOL ?! this works !?

    # soma layers
    VII= Phenotype('UBERON:0016578', sllp)  # 'ilxtr:spinal-VII'
    IX = Phenotype('UBERON:0016580', sllp)  # 'ilxtr:spinal-IX'

    # soma locations

    #L1 = Phenotype('ilxtr:spinal-L1', slp)
    #L2 = Phenotype('ilxtr:spinal-L2', slp)
Exemple #10
0
class Keast2020(LocalNameManager):
    # soma layers
    VII = Phenotype('ilxtr:spinal-VII', 'ilxtr:hasSomaLocatedInLayer')

    # soma locations
    L1 = Phenotype('ilxtr:spinal-L1', slp)
    L2 = Phenotype('ilxtr:spinal-L2', slp)
    IMG = Phenotype('ilxtr:IMG', slp)
    PG = Phenotype('ilxtr:PG', slp)

    # sort of nerves
    L1_vr = Phenotype('ilxtr:vr-L1', alp)
    L1_wr = Phenotype('ilxtr:wr-L1', alp)
    L1_gr = Phenotype('ilxtr:gr-L1', alp)

    L2_vr = Phenotype('ilxtr:vr-L2', alp)
    L2_wr = Phenotype('ilxtr:wr-L2', alp)
    L2_gr = Phenotype('ilxtr:gr-L2', alp)

    L6_gr = Phenotype('ilxtr:gr-L6', alp)
    S1_gr = Phenotype('ilxtr:gr-S1', alp)

    IMGax = Phenotype('ilxtr:IMG', alp)
    PGax = Phenotype('ilxtr:PG', alp)

    S1ax = Phenotype('ilxtr:sc-S1', alp)

    # nerves
    n_ls = Phenotype('ilxtr:nerve-lumbar-splanic', alp)
    n_hg = Phenotype('ilxtr:nerve-hypogastric', alp)
    n_ps = Phenotype('ilxtr:nerve-pelvic-splanic', alp)
    n_bl = Phenotype('ilxtr:nerve-bladder', alp)

    # synaptic locations
    IMGsyn = Phenotype('ilxtr:IMG', synp)
    PGsyn = Phenotype('ilxtr:PG', synp)

    BNVWsyn = Phenotype('ilxtr:bladder-neck-vessel-wall', synp)
    BDVWsyn = Phenotype('ilxtr:bladder-dome-vessel-wall', synp)

    BDWsyn = Phenotype('ilxtr:bladder-dome-wall', synp)
    BNWsyn = Phenotype('ilxtr:bladder-neck-wall', synp)

    # target cell types
    SPGfcon = Phenotype('ilxtr:sympathetic-post-ganglionic', fconp)
    SPG4 = Phenotype('ilxtr:keast-neuron-4-type',
                     'ilxtr:hasPhenotype')  # FIXME what is this really?
Exemple #11
0

four_soma_locs = [
    'ilxtr:sc-T12',
    'ilxtr:sc-T13',
    'ilxtr:sc-L1',
    'ilxtr:sc-L2',
    'ilxtr:sc-L3',
    'ilxtr:sc-L4',
    'ilxtr:sc-L5',
    'ilxtr:sc-L6',
    #'ilxtr:sc-S1',
]

[
    setattr(Keast2020, f'sc{sl.split("-")[-1]}', Phenotype(sl, slp))
    for sl in four_soma_locs
]

[
    setattr(Keast2020, f'sc{sl.split("-")[-1]}ax', Phenotype(sl, alp))
    for sl in four_soma_locs
]

[
    setattr(Keast2020, f'sc{sl.split("-")[-1]}syn', Phenotype(sl, synp))
    for sl in four_soma_locs
]

sympathetic_chain_axons = [Phenotype(l, alp)
                           for l in four_soma_locs]  # FIXME intersegmental