brainconn: Brain connectivity analysis in Python¶
brainconn is a Python package for graph theoretic analysis of neuroimaging data.
Contents¶
What is graph theory?¶
Graph theory refers to methods for measures graphs.
What is brainconn?¶
brainconn is a Python package for the calculation of graph theoretic metrics from neuroimaging data.
API Reference¶
brainconn.centrality
: Centrality¶
Metrics which identify the most important nodes in graphs.
brainconn.centrality |
Metrics which identify the most important nodes in graphs. |
brainconn.centrality.betweenness_bin (G) |
Node betweenness centrality is the fraction of all shortest paths in the network that contain a given node. |
brainconn.centrality.betweenness_wei (G) |
Node betweenness centrality is the fraction of all shortest paths in the network that contain a given node. |
brainconn.centrality.diversity_coef_sign (W, ci) |
The Shannon entropy-based diversity coefficient measures the diversity of intermodular connections of individual nodes and ranges from 0 to 1. |
brainconn.centrality.edge_betweenness_bin (G) |
Edge betweenness centrality is the fraction of all shortest paths in the network that contain a given edge. |
brainconn.centrality.edge_betweenness_wei (G) |
Edge betweenness centrality is the fraction of all shortest paths in the network that contain a given edge. |
brainconn.centrality.eigenvector_centrality_und (CIJ) |
Eigenector centrality is a self-referential measure of centrality: nodes have high eigenvector centrality if they connect to other nodes that have high eigenvector centrality. |
brainconn.centrality.erange (CIJ) |
Shortcuts are central edges which significantly reduce the characteristic path length in the network. |
brainconn.centrality.flow_coef_bd (CIJ) |
Computes the flow coefficient for each node and averaged over the network, as described in Honey et al. |
brainconn.centrality.gateway_coef_sign (W, ci) |
The gateway coefficient is a variant of participation coefficient. |
brainconn.centrality.kcoreness_centrality_bd (CIJ) |
The k-core is the largest subgraph comprising nodes of degree at least k. |
brainconn.centrality.kcoreness_centrality_bu (CIJ) |
The k-core is the largest subgraph comprising nodes of degree at least k. |
brainconn.centrality.module_degree_zscore (W, ci) |
The within-module degree z-score is a within-module version of degree centrality. |
brainconn.centrality.pagerank_centrality (A, d) |
The PageRank centrality is a variant of eigenvector centrality. |
brainconn.centrality.participation_coef (W, ci) |
Participation coefficient is a measure of diversity of intermodular connections of individual nodes. |
brainconn.centrality.participation_coef_sign (W, ci) |
Participation coefficient is a measure of diversity of intermodular connections of individual nodes. |
brainconn.centrality.subgraph_centrality (CIJ) |
The subgraph centrality of a node is a weighted sum of closed walks of different lengths in the network starting and ending at the node. |
brainconn.clustering
: Clustering¶
Metrics which group nodes within graphs into clusters.
brainconn.clustering |
Metrics which group nodes within graphs into clusters. |
brainconn.clustering.agreement (ci[, buffsz]) |
Takes as input a set of vertex partitions CI of dimensions [vertex x partition]. |
brainconn.clustering.agreement_weighted (ci, wts) |
D = AGREEMENT_WEIGHTED(CI,WTS) is identical to AGREEMENT, with the exception that each partitions contribution is weighted according to the corresponding scalar value stored in the vector WTS. |
brainconn.clustering.clustering_coef_bd (A) |
The clustering coefficient is the fraction of triangles around a node (equiv. |
brainconn.clustering.clustering_coef_bu (G) |
The clustering coefficient is the fraction of triangles around a node (equiv. |
brainconn.clustering.clustering_coef_wd (W) |
The weighted clustering coefficient is the average “intensity” of triangles around a node. |
brainconn.clustering.clustering_coef_wu (W) |
The weighted clustering coefficient is the average “intensity” of triangles around a node. |
brainconn.clustering.clustering_coef_wu_sign (W) |
Returns the weighted clustering coefficient generalized or separated for positive and negative weights. |
brainconn.clustering.consensus_und (D, tau[, …]) |
This algorithm seeks a consensus partition of the agreement matrix D. |
brainconn.clustering.get_components (A[, …]) |
Returns the components of an undirected graph specified by the binary and undirected adjacency matrix adj. |
brainconn.clustering.get_components_old (A[, …]) |
Returns the components of an undirected graph specified by the binary and undirected adjacency matrix adj. |
brainconn.clustering.number_of_components (A) |
|
brainconn.clustering.transitivity_bd (A) |
Transitivity is the ratio of ‘triangles to triplets’ in the network. |
brainconn.clustering.transitivity_bu (A) |
Transitivity is the ratio of ‘triangles to triplets’ in the network. |
brainconn.clustering.transitivity_wd (W) |
Transitivity is the ratio of ‘triangles to triplets’ in the network. |
brainconn.clustering.transitivity_wu (W) |
Transitivity is the ratio of ‘triangles to triplets’ in the network. |
brainconn.core
: Core¶
Metrics which identify the most important nodes in graphs.
brainconn.core |
Metrics which identify the most important nodes in graphs. | ||
brainconn.core.assortativity_bin (CIJ[, flag]) |
The assortativity coefficient is a correlation coefficient between the degrees of all nodes on two opposite ends of a link. | ||
brainconn.core.assortativity_wei (CIJ[, flag]) |
The assortativity coefficient is a correlation coefficient between the strengths (weighted degrees) of all nodes on two opposite ends of a link. | ||
brainconn.core.core_periphery_dir (W[, gamma, C0]) |
The optimal core/periphery subdivision is a partition of the network into two nonoverlapping groups of nodes, a core group and a periphery group. | ||
brainconn.core.kcore_bd (CIJ, k[, peel]) |
The k-core is the largest subnetwork comprising nodes of degree at least k. | ||
brainconn.core.kcore_bu (CIJ, k[, peel]) |
The k-core is the largest subnetwork comprising nodes of degree at least k. | ||
brainconn.core.local_assortativity_wu_sign (W) |
Local assortativity measures the extent to which nodes are connected to nodes of similar strength. | ||
brainconn.core.rich_club_bd (CIJ[, klevel]) |
The rich club coefficient, R, at level k is the fraction of edges that connect nodes of degree k or higher out of the maximum number of edges that such nodes might share. | ||
brainconn.core.rich_club_bu (CIJ[, klevel]) |
The rich club coefficient, R, at level k is the fraction of edges that connect nodes of degree k or higher out of the maximum number of edges that such nodes might share. | ||
brainconn.core.rich_club_wd (CIJ[, klevel]) |
|
||
brainconn.core.rich_club_wu (CIJ[, klevel]) |
|
||
brainconn.core.score_wu (CIJ, s) |
The s-core is the largest subnetwork comprising nodes of strength at least s. |
brainconn.degree
: Degree¶
Metrics which identify the most important nodes in graphs.
brainconn.degree |
Metrics which identify the most important nodes in graphs. |
brainconn.degree.degrees_dir (CIJ) |
Node degree is the number of links connected to the node. |
brainconn.degree.degrees_und (CIJ) |
Node degree is the number of links connected to the node. |
brainconn.degree.jdegree (CIJ) |
This function returns a matrix in which the value of each element (u,v) corresponds to the number of nodes that have u outgoing connections and v incoming connections. |
brainconn.degree.strengths_dir (CIJ) |
Node strength is the sum of weights of links connected to the node. |
brainconn.degree.strengths_und (CIJ) |
Node strength is the sum of weights of links connected to the node. |
brainconn.degree.strengths_und_sign (W) |
Node strength is the sum of weights of links connected to the node. |
brainconn.distance
: Distance¶
Metrics which identify the most important nodes in graphs.
brainconn.distance |
Metrics which identify the most important nodes in graphs. |
brainconn.distance.breadthdist (CIJ) |
The binary reachability matrix describes reachability between all pairs of nodes. |
brainconn.distance.breadth (CIJ, source) |
Implementation of breadth-first search. |
brainconn.distance.charpath (D[, …]) |
The characteristic path length is the average shortest path length in the network. |
brainconn.distance.cycprob (Pq) |
Cycles are paths which begin and end at the same node. |
brainconn.distance.distance_bin (G) |
The distance matrix contains lengths of shortest paths between all pairs of nodes. |
brainconn.distance.distance_wei (G) |
The distance matrix contains lengths of shortest paths between all pairs of nodes. |
brainconn.distance.distance_wei_floyd (adjacency) |
Computes the topological length of the shortest possible path connecting every pair of nodes in the network. |
brainconn.distance.retrieve_shortest_path (s, …) |
Returns nodes comprising shortest path between s and t |
brainconn.distance.efficiency_bin (G[, local]) |
The global efficiency is the average of inverse shortest path length, and is inversely related to the characteristic path length. |
brainconn.distance.efficiency_wei (Gw[, local]) |
The global efficiency is the average of inverse shortest path length, and is inversely related to the characteristic path length. |
brainconn.distance.findpaths (CIJ, qmax, sources) |
Paths are sequences of linked nodes, that never visit a single node more than once. |
brainconn.distance.findwalks (CIJ) |
Walks are sequences of linked nodes, that may visit a single node more than once. |
brainconn.distance.mean_first_passage_time (…) |
Calculates mean first passage time of adjacency |
brainconn.distance.reachdist (CIJ[, …]) |
The binary reachability matrix describes reachability between all pairs of nodes. |
brainconn.distance.search_information (adjacency) |
Calculates search information of adjacency. |
brainconn.generative
: Generative¶
Metrics which identify the most important nodes in graphs.
brainconn.generative |
Metrics which identify the most important nodes in graphs. |
brainconn.generative.generative_model (A, D, …) |
Generates synthetic networks using the models described in Betzel et al. |
brainconn.generative.evaluate_generative_model (A, …) |
Generates synthetic networks with parameters provided and evaluates their energy function. |
brainconn.modularity
: Modularity¶
Metrics which identify the most important nodes in graphs.
brainconn.modularity |
Metrics which identify the most important nodes in graphs. |
brainconn.modularity.ci2ls (ci) |
Convert from a community index vector to a 2D python list of modules The list is a pure python list, not requiring numpy. |
brainconn.modularity.ls2ci (ls[, zeroindexed]) |
Convert from a 2D python list of modules to a community index vector. |
brainconn.modularity.community_louvain (W[, …]) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes which maximizes the number of within-group edges and minimizes the number of between-group edges. |
brainconn.modularity.link_communities (W[, …]) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes which maximizes the number of within-group edges and minimizes the number of between-group edges. |
brainconn.modularity.modularity_dir (A[, …]) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_finetune_dir (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_finetune_und (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_finetune_und_sign (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_louvain_dir (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_louvain_und (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_louvain_und_sign (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_probtune_und_sign (W) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_und (A[, …]) |
The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes in a way that maximizes the number of within-group edges, and minimizes the number of between-group edges. |
brainconn.modularity.modularity_und_sign (W, ci) |
This function simply calculates the signed modularity for a given partition. |
brainconn.modularity.partition_distance (cx, cy) |
This function quantifies the distance between pairs of community partitions with information theoretic measures. |
brainconn.motifs
: Motifs¶
Metrics which identify the most important nodes in graphs.
brainconn.motifs |
Metrics which identify the most important nodes in graphs. |
brainconn.motifs.find_motif34 (m[, n]) |
This function returns all motif isomorphs for a given motif id and class (3 or 4). |
brainconn.motifs.make_motif34lib () |
This function generates the motif34lib.mat library required for all other motif computations. |
brainconn.motifs.motif3funct_bin (A) |
Functional motifs are subsets of connection patterns embedded within anatomical motifs. |
brainconn.motifs.motif3funct_wei (W) |
Functional motifs are subsets of connection patterns embedded within anatomical motifs. |
brainconn.motifs.motif3struct_bin (A) |
Structural motifs are patterns of local connectivity. |
brainconn.motifs.motif3struct_wei (W) |
Structural motifs are patterns of local connectivity. |
brainconn.motifs.motif4funct_bin (A) |
Functional motifs are subsets of connection patterns embedded within anatomical motifs. |
brainconn.motifs.motif4funct_wei (W) |
Functional motifs are subsets of connection patterns embedded within anatomical motifs. |
brainconn.motifs.motif4struct_bin (A) |
Structural motifs are patterns of local connectivity. |
brainconn.motifs.motif4struct_wei (W) |
Structural motifs are patterns of local connectivity. |
brainconn.physical_connectivity
: Physical connectivity¶
Metrics which identify the most important nodes in graphs.
brainconn.physical_connectivity |
Metrics which identify the most important nodes in graphs. |
brainconn.physical_connectivity.density_dir (CIJ) |
Density is the fraction of present connections to possible connections. |
brainconn.physical_connectivity.density_und (CIJ) |
Density is the fraction of present connections to possible connections. |
brainconn.physical_connectivity.rentian_scaling (A, …) |
Physical Rentian scaling (or more simply Rentian scaling) is a property of systems that are cost-efficiently embedded into physical space. |
brainconn.reference
: Reference¶
Metrics which identify the most important nodes in graphs.
brainconn.reference |
Metrics which identify the most important nodes in graphs. |
brainconn.reference.latmio_dir_connected (R, itr) |
This function “latticizes” a directed network, while preserving the in- and out-degree distributions. |
brainconn.reference.latmio_dir (R, itr[, D]) |
This function “latticizes” a directed network, while preserving the in- and out-degree distributions. |
brainconn.reference.latmio_und_connected (R, itr) |
This function “latticizes” an undirected network, while preserving the degree distribution. |
brainconn.reference.latmio_und (R, itr[, D]) |
This function “latticizes” an undirected network, while preserving the degree distribution. |
brainconn.reference.makeevenCIJ (n, k, sz_cl) |
This function generates a random, directed network with a specified number of fully connected modules linked together by evenly distributed remaining random connections. |
brainconn.reference.makefractalCIJ (mx_lvl, …) |
This function generates a directed network with a hierarchical modular organization. |
brainconn.reference.makerandCIJdegreesfixed (…) |
This function generates a directed random network with a specified in-degree and out-degree sequence. |
brainconn.reference.makerandCIJ_dir (n, k) |
This function generates a directed random network |
brainconn.reference.makerandCIJ_und (n, k) |
This function generates an undirected random network |
brainconn.reference.makeringlatticeCIJ (n, k) |
This function generates a directed lattice network with toroidal boundary counditions (i.e. |
brainconn.reference.maketoeplitzCIJ (n, k, s) |
This function generates a directed network with a Gaussian drop-off in edge density with increasing distance from the main diagonal. |
brainconn.reference.null_model_dir_sign (W[, …]) |
This function randomizes an directed network with positive and negative weights, while preserving the degree and strength distributions. |
brainconn.reference.null_model_und_sign (W[, …]) |
This function randomizes an undirected network with positive and negative weights, while preserving the degree and strength distributions. |
brainconn.reference.randmio_dir (R, itr) |
This function randomizes a directed network, while preserving the in- and out-degree distributions. |
brainconn.reference.randmio_dir_connected (R, itr) |
This function randomizes a directed network, while preserving the in- and out-degree distributions. |
brainconn.reference.randmio_dir_signed (R, itr) |
This function randomizes a directed weighted network with positively and negatively signed connections, while preserving the positive and negative degree distributions. |
brainconn.reference.randmio_und (R, itr) |
This function randomizes an undirected network, while preserving the degree distribution. |
brainconn.reference.randmio_und_connected (R, itr) |
This function randomizes an undirected network, while preserving the degree distribution. |
brainconn.reference.randmio_und_signed (R, itr) |
This function randomizes an undirected weighted network with positive and negative weights, while simultaneously preserving the degree distribution of positive and negative weights. |
brainconn.reference.randomize_graph_partial_und (A, …) |
A = RANDOMIZE_GRAPH_PARTIAL_UND(A,B,MAXSWAP) takes adjacency matrices A and B and attempts to randomize matrix A by performing MAXSWAP rewirings. |
brainconn.reference.randomizer_bin_und (R, alpha) |
This function randomizes a binary undirected network, while preserving the degree distribution. |
brainconn.similarity
: Similarity¶
Metrics which identify the most important nodes in graphs.
brainconn.similarity |
Metrics which identify the most important nodes in graphs. |
brainconn.similarity.corr_flat_dir (a1, a2) |
Returns the correlation coefficient between two flattened adjacency matrices. |
brainconn.similarity.corr_flat_und (a1, a2) |
Returns the correlation coefficient between two flattened adjacency matrices. |
brainconn.similarity.dice_pairwise_und (a1, a2) |
Calculates pairwise dice similarity for each vertex between two matrices. |
brainconn.similarity.edge_nei_overlap_bd (CIJ) |
This function determines the neighbors of two nodes that are linked by an edge, and then computes their overlap. |
brainconn.similarity.edge_nei_overlap_bu (CIJ) |
This function determines the neighbors of two nodes that are linked by an edge, and then computes their overlap. |
brainconn.similarity.gtom (adj, nr_steps) |
The m-th step generalized topological overlap measure (GTOM) quantifies the extent to which a pair of nodes have similar m-th step neighbors. |
brainconn.similarity.matching_ind (CIJ) |
For any two nodes u and v, the matching index computes the amount of overlap in the connection patterns of u and v. |
brainconn.similarity.matching_ind_und (CIJ0) |
M0 = MATCHING_IND_UND(CIJ) computes matching index for undirected graph specified by adjacency matrix CIJ. |
brainconn.nbs
: Network-based statistic¶
Network-based statistic calculation.
brainconn.nbs |
Network-based statistic calculation. |
brainconn.nbs.nbs_bct (x, y, thresh[, k, …]) |
Performs the NBS for populations X and Y for a t-statistic threshold of alpha. |
brainconn.utils
: Utility functions¶
Utility functions.
brainconn.utils |
Utility functions. |
brainconn.utils.matrix |
Other utility functions. |
brainconn.utils.visualization |
Tools for visualizing graphs. |
brainconn.utils.misc |
Miscellaneous utility functions. |
Example gallery¶
Degree¶
Calculate centrality measures¶
Centrality is a thing with stuff and things.
# sphinx_gallery_thumbnail_number = 3
Start with the necessary imports¶
import os.path as op
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import brainconn
Get some data¶
corr = np.loadtxt(op.join(brainconn.utils.get_resource_path(), 'example_corr.txt'))
# Zero diagonal
adj_wei = corr - np.eye(corr.shape[0])
adj_bin = brainconn.utils.binarize(brainconn.utils.threshold_proportional(adj_wei, 0.2))
Look at weighted adjacency matrix¶
fig, ax = plt.subplots(figsize=(7, 7))
ax.imshow(adj_wei)
fig.show()

Look at binary adjacency matrix¶
fig, ax = plt.subplots(figsize=(7, 7))
ax.imshow(adj_bin)
fig.show()

Compute stuff¶
betw_wei = brainconn.centrality.betweenness_wei(adj_wei)
betw_bin = brainconn.centrality.betweenness_bin(adj_bin)
edg_betw_wei = brainconn.centrality.edge_betweenness_wei(adj_wei)[0]
idx = np.triu_indices(edg_betw_wei.shape[0], k=1)
edg_betw_wei = edg_betw_wei[idx]
edg_betw_wei = edg_betw_wei[edg_betw_wei > 0]
edg_betw_bin = brainconn.centrality.edge_betweenness_bin(adj_bin)[0]
idx = np.triu_indices(edg_betw_bin.shape[0], k=1)
edg_betw_bin = edg_betw_bin[idx]
edg_betw_bin = edg_betw_bin[edg_betw_bin > 0]
vals = [betw_wei, betw_bin, edg_betw_wei, edg_betw_bin]
names = ['Weighted Node Betweenness Centrality',
'Binary Node Betweenness Centrality',
'Weighted Edge Betweenness Centrality',
'Binary Edge Betweenness Centrality']
fig, axes = plt.subplots(nrows=4, figsize=(12, 7))
for i in range(4):
sns.distplot(vals[i], ax=axes[i])
axes[i].set_title(names[i])
fig.tight_layout()
fig.show()

Total running time of the script: ( 1 minutes 1.232 seconds)
Centrality¶
Calculate degree measures¶
Degree is another thing with stuff and things.
# sphinx_gallery_thumbnail_number = 5
Start with the necessary imports¶
import os.path as op
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from brainconn import degree, utils
Get some data¶
corr = np.loadtxt(op.join(utils.get_resource_path(), 'example_corr.txt'))
# Zero diagonal
adj_wei = corr - np.eye(corr.shape[0])
adj_wei_dir = adj_wei + (np.triu(adj_wei) / 2)
adj_bin = utils.binarize(utils.threshold_proportional(adj_wei, 0.2))
adj_bin_dir = utils.binarize(utils.threshold_proportional(adj_wei_dir, 0.2))
Look at weighted undirected adjacency matrix¶
fig, ax = plt.subplots(figsize=(7, 7))
ax.imshow(adj_wei)
fig.show()

Look at binary undirected adjacency matrix¶
fig, ax = plt.subplots(figsize=(7, 7))
ax.imshow(adj_bin)
fig.show()

Look at weighted directed adjacency matrix¶
fig, ax = plt.subplots(figsize=(7, 7))
ax.imshow(adj_wei_dir)
fig.show()

Look at binary directed adjacency matrix¶
fig, ax = plt.subplots(figsize=(7, 7))
ax.imshow(adj_bin_dir)
fig.show()

Compute stuff¶
degr_und = degree.degrees_und(adj_bin)
_, _, degr_dir = degree.degrees_dir(adj_bin_dir)
jdeg_bin, _, _, _ = degree.jdegree(adj_bin_dir)
stre_und = degree.strengths_und(adj_wei)
_, stre_und_neg, _, _ = degree.strengths_und_sign(adj_wei)
stre_dir = degree.strengths_dir(adj_wei_dir)
jdeg_wei, _, _, _ = degree.jdegree(adj_wei_dir)
jdeg_bin = jdeg_bin[jdeg_bin > 0]
jdeg_wei = jdeg_wei[jdeg_wei > 0]
vals = [degr_und, degr_dir, jdeg_bin, stre_und, stre_und_neg, stre_dir,
jdeg_wei]
names = ['Undirected Degree',
'Directed Degree',
'Joint Binary Degree',
'Undirected Unsigned Strength',
'Undirected Signed Strength',
'Directed Unsigned Strength',
'Joint Weighted Degree']
fig, axes = plt.subplots(nrows=len(names), figsize=(12, 2*len(names)))
for i in range(len(names)):
sns.distplot(vals[i], ax=axes[i])
axes[i].set_title(names[i])
fig.tight_layout()
fig.show()

Total running time of the script: ( 0 minutes 0.602 seconds)
History of changes¶
brainconn 0.0.2 (current)¶
- Change structure from single
algorithms
submodule to separated submodules:centrality
,clustering
,core
,degree
,distance
,generative
,modularity
,motifs
,physical_connectivity
,reference
, andsimilarity
.
brainconn 0.0.1¶
- Rename fork of BCT to brainconn for further independent development
BCT 0.4.1¶
- Refactor code into multiple files
- Fix bug in efficiency_bin
- Fix bugs in modularity_louvain_und
- Fix bugs in
participation_coef_b*
- Add some test cases
BCT 0.4.0¶
- Add various new functions from Jan 2015 release of BCT
- Fix various bugs documented in github issues
BCT 0.3.3¶
- Fix small bug in
latmio_und_connected
causing failure for sparse matrices - Add non-networkx dependent algorithm to get_components (but less efficient)
- Add an implementation of consensus clustering and fix bug in agreement
- Fix bug causing
clustering_coef_bu
to always return 0 - Remembered to update changelog
- Fix some bugs in
modularity_louvain_dir
and related - Fix bug in NBS and add optional paired-sample test statistic (sviter)
BCT 0.3.2¶
- Change several functions including threshold_proportional and binarize have
copy=True
as default argument - Fix bug in
threshold_proportional
where copying behavior did not work symmetric matrices. - Fix minor quirk in
threshold_proportional
wherenp.round
rounds to nearest even number (optimizes floating point) which is discrepant with BCT - Add a test suite with some functions
- Fix typo in
rich_club_bu
- Refactor
x[range(n),range(n)]
tonp.fill_diagonal
- Fix off-by-one bug in
moduality_[prob/fine]tune_und_sign
BCT 0.3.1¶
- Fix bug in NBS
- Fix series of bugs in
null_models
BCT 0.3¶
- Added NBS
- Added in all of the new functions from the Dec 2013 release of BCT
- Fixed numerous bugs having to do with indexing errors in modularity
- Fixed several odd bugs with
clustering_coef
,efficiency
,distance
- For the next release, I clearly need a real test suite.