Statistics of symmetry measure for networks of neurons (Esposito et al. 2014)

 Download zip file 
Help downloading and running models
The code reproduces Figures 1, 2, 3A and 3C from Esposito et al "Measuring symmetry, asymmetry and randomness in neural networks". It provides the statistics of the symmetry measure defined in the paper for networks of neurons with random connections drawn from uniform and gaussian distributions.
1 . Esposito U, Giugliano M, van Rossum M, Vasilaki E (2014) Measuring symmetry, asymmetry and randomness in neural network connectivity. PLoS One 9:e100805 [PubMed]
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism:
Cell Type(s):
Gap Junctions:
Simulation Environment: MATLAB;
Model Concept(s): Connectivity matrix;
%% Numerical simulation for the symmetry measure. Uniform distribution

function [s] = sym_measure (matrix)

%Parameters and variables necessary for running this code without external call. Also a loop over the value of a is needed
%n_samples = 10000;                                            %number of matrixes in the sample
%N = 200;                                                      %number of neurons
%max_w = 1;
%a = 0:0.1:0.9;                                                %pruning values
%number_points = size(a,2);                                    %number of points in the plot
%sample_mean = zeros(number_points);
%sample_variance = zeros(number_points);

%symm = zeros(1,n_samples);

%for iter = 1:n_samples
    %sample_matrix = max_w .* rand(N) .* (rand(N) > a);      %generate a random NxN matrix from zero to max_w and introduce pruning a
        upper = triu(matrix,1);                      %extract the upper triangle matrix
        lower = tril(matrix,-1)';                    %extract the lower triangle matrix and transpose it
        x = upper(:);                                       %convert the matrix into a vector
        y = lower(:);                                       %convert the matrix into a vector
        temp = x + y;                                       %sum vector elements==sum the reciprocal elements of the matrix
        nonzero_index = find(temp~=0.);                     %create a vector whoose elements are the index of the non zero elements in temp
        K = length(nonzero_index);                          %counts how many elements of temp are nonzero==counts the number of pairs connections for which at least one direction is nonzero
        if K > 0
            s = 1 - sum ( abs(x(nonzero_index)-y(nonzero_index)) ./ (x(nonzero_index)+y(nonzero_index)) ) / K;
            s = 0;
        %sprintf('Point number %d iteration number %d',n,iter)

%sample_mean = mean(symm);
%sample_variance = var(symm);