Exemple #1
0
# get CX_rois
CX_rois = ['PB', 'NO', 'FB', 'EB', 'AB(L)', 'AB(R)']
#CX_rois = ['PB']
empty_rois = []
ths = [i for i in range(150)]
#ths = [0,1,2,3,4,5,6,7,8,9,10,12,14,18,22,25,30,35,45,50,52,54,55,57,59,62,65,70,90,110]

# h_results = {'h':[],'h_randwire':[],'h_randweight':[]}

#hpy = lambda x: np.random.randn()
reldir = '../'

for roi in CX_rois:
    try:
        if roi not in empty_rois:
            n, conn = fetch_adjacency(adjpath=os.path.join(
                reldir, conf.datasets_dir, 'noncropped_traced_' + roi))
            for th in ths:
                print(th, roi)
                path = os.path.join(reldir, conf.results_dir, 'CX_study_th',
                                    f'th={th};roi={roi}.txt')
                if not os.path.exists(path):
                    temp = conn[conn['weight'] > th]
                    nlist, adj = conn2adj(temp)
                    if temp.shape[0] > 0:
                        print('adj size =', adj.shape, 'non-zero elements =',
                              temp.shape[0])

                        #fh
                        h = hnx(adj)

                        #fh random rewiring
from neuprint import Client

from config import conf
from dataset_utils import fetch_primary_roi_datasets, fetch_adjacency

c = Client(conf.neuprint_URL, conf.dataset_version, conf.api_token)
_ = fetch_primary_roi_datasets(client=c)

_, _ = fetch_adjacency(rois=[],
                       client=c,
                       include_nonprimary=False,
                       prefix='noncropped_traced_2')