Calculate a similarity score between connectivity matrices that penalises small differences between low and does not heavily penalise large differences between high weights. Algorithm from Jarrell et al. 2012.

hemibrain_connectivity_similarity(x, y, c1 = 0.5, c2 = 0.18, normalise = TRUE)

# S3 method for numeric
hemibrain_connectivity_similarity(x, y, c1 = 0.5, c2 = 0.18, normalise = TRUE)

# S3 method for matrix
hemibrain_connectivity_similarity(x, y, c1 = 0.5, c2 = 0.18, normalise = TRUE)

hemibrain_connectivity_similarity_distance(
  m,
  c1 = 0.5,
  c2 = 0.18,
  normalise = FALSE,
  diag = FALSE,
  upper = FALSE
)

hemibrain_connectivity_similarity_matrix(
  m,
  c1 = 0.5,
  c2 = 0.18,
  normalise = FALSE
)

Arguments

x

a vector/matrix of connectivities, where each entry in the vector or each column in the matrix is a different target/input neuron/cell_type

y

a different vector/matrix of connectivities

c1

determines how negatively we want to punish a case such as the one above. Default C1 is chosen so that 1 and 5 are weakly dissimilar.

c2

determines the point where the similarity of the two numbers switches from negative to positive. Default C2 is chosen so that 10 and 100 synapses are weakly similar.

normalise

perform a min-max normalisation on the similarity scores as in Schlegel et al. 2015

m

an n x m adjacency matrix

diag

for connectivity_similarity_distance. Logical value indicating whether the diagonal of the distance matrix should be printed by print.dist.

upper

for connectivity_similarity_distance. Logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist.

References

Jarrell TA, Wang Y, Bloniarz AE, Brittin CA, Xu M, Thomson JN, Albertson DG, Hall DH, Emmons SW (2012) "The connectome of a decision-making neural network." Science (80- ) 337: 437–444.