Ejemplo n.º 1
0
    strangesr08s = [(0, 1500e6), # r08 desynched, us
                    (1550e6, np.inf)] # r08 synched, us, end is ~ 2300s
    ptc22tr1r10s = [ptc22.tr1.r10, ptc22.tr1.r10]
    strangesr10s = [(0, 1400e6), # r10 synched, us
                    (1480e6, np.inf)] # r10 desynched, us, end is ~ 2300s

    ptc22tr1recs = [ptc22.tr1.r05, ptc22.tr1.r08, ptc22.tr1.r10, ptc22.tr1.r19]
    ptc22tr2recs = [ptc22.tr2.r28, ptc22.tr2.r33]

    # ptc15.tr7c:
    SEPMAX = 1675
    # get superset of active nids for all natexps of both recs in ptc15tr7crecs:
    stranges = etrangesr74 + etrangesr95b # 8 stranges in total
    recs = [ptc15.tr7c.r74]*4 + [ptc15.tr7c.r95b]*4 # 8 recs corresponding to 8 stranges
    ssnids, recsecnids = get_ssnids(recs, stranges)
    ssseps = get_seps(ssnids, ptc15.tr7c.alln)
    # get separate supersets of active nids for all 4 natexps in each recording:
    ptc15tr7crecsecnids = [np.unique(np.hstack(recsecnids[:4])),
                           np.unique(np.hstack(recsecnids[4:]))]
    # do psthcorr plots and collect ssrho matrices:
    ssrhos = []
    for rec, nids in zip(ptc15tr7crecs, ptc15tr7crecsecnids):
        ssrho = psthcorr(rec, nids=nids, ssnids=ssnids, ssseps=ssseps, natexps=True) # in sec
        ssrhos.append(ssrho)
    # plot differences in superset rho matrices for the two recordings:
    psthcorrdiff(ssrhos, ssseps, 'r74-r95b')

    ## rho for ns1 figure:
    #In [124]: np.where(ssnids == 328)
    #Out[124]: (array([31]),)
    #In [125]: np.where(ssnids == 345)
Ejemplo n.º 2
0
            rates = cs / BINW  # normalize counts by binw to get rates
            err = rates - psth  # 2D error array between trial responses and PSTH
            errs.append(
                err.ravel())  # flatten across trials for use in corrcoef()
        errs = np.asarray(errs)
        # calculate corrs between flattened 2D err arrays for all cell pairs:
        nrho = np.corrcoef(errs)
        nrho[diagis] = np.nan  # nan the diagonal, which imshow plots as white

        # collect rho and nrho values:
        lti = np.tril_indices(nn, -1)  # lower triangle indices of rho matrix
        rhoslist[slabel].append(rho[lti])
        nrhoslist[slabel].append(nrho[lti])

        # collect corresponding pairwise neuron separation distances:
        sepslist[slabel].append(get_seps(nids, rec.alln))

        if PLOTRHOMATRICES:
            # plot rho matrix:
            figure(figsize=FIGSIZE)
            imshow(rho, vmin=VMIN, vmax=VMAX,
                   cmap='jet')  # cmap='gray' is too bland
            nidticks = np.arange(0, nn, 10)
            xticks(nidticks)
            yticks(nidticks)
            if SHOWCOLORBAR:
                colorbar(ticks=[-1, 0, 1])
            titlestr = '_'.join(
                [rec.absname, 'rho_mat',
                 str(slabel), KIND, KERNEL, BINWMS])
            gcfm().window.setWindowTitle(titlestr)
Ejemplo n.º 3
0
            cs = n2count[nid] # 2D array of trial spike counts, one row per trial
            rates = cs / BINW # normalize counts by binw to get rates
            err = rates - psth # 2D error array between trial responses and PSTH
            errs.append(err.ravel()) # flatten across trials for use in corrcoef()
        errs = np.asarray(errs)
        # calculate corrs between flattened 2D err arrays for all cell pairs:
        nrho = np.corrcoef(errs)
        nrho[diagis] = np.nan # nan the diagonal, which imshow plots as white

        # collect rho and nrho values:
        lti = np.tril_indices(nn, -1) # lower triangle indices of rho matrix
        rhoslist[slabel].append(rho[lti])
        nrhoslist[slabel].append(nrho[lti])

        # collect corresponding pairwise neuron separation distances:
        sepslist[slabel].append(get_seps(nids, rec.alln))

        if PLOTRHOMATRICES:
            # plot rho matrix:
            figure(figsize=FIGSIZE)
            imshow(rho, vmin=VMIN, vmax=VMAX, cmap='jet') # cmap='gray' is too bland
            nidticks = np.arange(0, nn, 10)
            xticks(nidticks)
            yticks(nidticks)
            if SHOWCOLORBAR:
                colorbar(ticks=[-1, 0, 1])
            titlestr = '_'.join([rec.absname, 'rho_mat', str(slabel),
                                 KIND, KERNEL, BINWMS])
            gcfm().window.setWindowTitle(titlestr)
            tight_layout(pad=0.3)
Ejemplo n.º 4
0
    strangesr10s = [
        (0, 1400e6),  # r10 synched, us
        (1480e6, np.inf)
    ]  # r10 desynched, us, end is ~ 2300s

    ptc22tr1recs = [ptc22.tr1.r05, ptc22.tr1.r08, ptc22.tr1.r10, ptc22.tr1.r19]
    ptc22tr2recs = [ptc22.tr2.r28, ptc22.tr2.r33]

    # ptc15.tr7c:
    SEPMAX = 1675
    # get superset of active nids for all natexps of both recs in ptc15tr7crecs:
    stranges = etrangesr74 + etrangesr95b  # 8 stranges in total
    recs = [ptc15.tr7c.r74] * 4 + [ptc15.tr7c.r95b
                                   ] * 4  # 8 recs corresponding to 8 stranges
    ssnids, recsecnids = get_ssnids(recs, stranges)
    ssseps = get_seps(ssnids, ptc15.tr7c.alln)
    # get separate supersets of active nids for all 4 natexps in each recording:
    ptc15tr7crecsecnids = [
        np.unique(np.hstack(recsecnids[:4])),
        np.unique(np.hstack(recsecnids[4:]))
    ]
    # do psthcorr plots and collect ssrho matrices:
    ssrhos = []
    for rec, nids in zip(ptc15tr7crecs, ptc15tr7crecsecnids):
        ssrho = psthcorr(rec,
                         nids=nids,
                         ssnids=ssnids,
                         ssseps=ssseps,
                         natexps=True)  # in sec
        ssrhos.append(ssrho)
    # plot differences in superset rho matrices for the two recordings: