Top level directory is: ./conn2eff/ and contains the following subdirectories:
-
data/- contains large data files and the scripts for slower processing steps.
-
scripts/figscontains the scripts for generating main figures and data in the paper.ED_figsscripts for generate extended data figures.
-
src/lib.py- contains functions that are reused across scripts (simulations and estimators, includes commented out examples).
-
Download original data from: Flywire:
neurons.csv,connections.csvandclassification.csv. to folder:'./data/'and unzip to csv files. -
Run
'./data/connectome_data.py'to convert these csv's to a sparse matrix format and compute its eigendecomposition. Files generated are:
C_index_to_rootid.csv: convert between original ids and index from 0-n neurons in connectome matrixmeta_data.csv: metadata for each neuron when available about cell type etc.connectome_sgn_cnt_sp_mat.npz: sparse matrix of the connectomeconnectome_sgn_cnt_scaled_sp_mat.npz: sparse matrix of the connectome scaled by abs of the largest eigenvalueeigenvalues_1000.npy: eigenvalues of the connectomeeigvec_1000.npy: eigenvectors of the connectomeconnectome_sgn_cnt_prob.csv: connectome in list form with P(excitatory) (used for measurement error sims)
Go to each folder in figs (fig1, fig2, ...) and first run scripts appended with data (if there are any) to generate data files. Then run scripts appended with fig to generate the figures, PDFs will be written to the same folder.
These include ED fig 9a-d, 10. To generate these figures:
- Run data script
'./scripts/ED_figs/eig_robust/eig_robust_data.py'to generate the data for the robustness of eigendecomposition results. Files are saved in./data/:
eigenvalues_robust.ncand *eigenvector_robust.nc: eigenvalues and vectors of the connectome for several different transformations:original: the original connectome matrixtanh_1: the connectome matrix scaled by the max abs syn count then the tanh function applied with a scaling factor of 1tanh_2: the connectome matrix scaled by the max abs syn count then the tanh function applied with a scaling factor of 2tanh_10: the connectome matrix scaled by the max abs syn count then the tanh function applied with a scaling factor of 10sign: the connectome matrix binarized by the sign functionshuffled_i: the connectome matrix with the synapse counts rows and column indices shuffledmeasurement_error_i: the connectome matrix with the synapse counts randomly set by a poisson process with mean equal to original count of each entry and sign randomly flipped according to the prob of NT.
eig_corruption.csv: for SNR=1 the indices and correlations of original to corrupted eigenvectors where corruption is gaussian noise. One figure is made ED fig 9a and saved in the same folder,ED_fig_9a_max_correlation_eigenv.pngthis gives the correlation between original and corrupted eigenvectors for SNR levels 100,10
To generate all other robustness figures:
- Run figure script
'./scripts/ED_figs/eig_robust/eig_robust_fig.py'
ED Fig 3,4
Run './scripts/ED_figs/IV_app_to_conductance_model.py'
ED Fig 5,6
Run scripts/ED_figs/IV_estimate_ar(p).py and scripts/ED_figs/misspec_prior_lin_iv_sim.py
ED Fig 8
Run './scripts/ED_figs/eig_further_char.py'