Learn R Programming

brainGraph (version 3.1.1)

Graph Theory Analysis of Brain MRI Data

Description

A set of tools for performing graph theory analysis of brain MRI data. It works with data from a Freesurfer analysis (cortical thickness, volumes, local gyrification index, surface area), diffusion tensor tractography data (e.g., from FSL) and resting-state fMRI data (e.g., from DPABI). It contains a graphical user interface for graph visualization and data exploration, along with several functions for generating useful figures.

Copy Link

Version

Install

install.packages('brainGraph')

Monthly Downloads

1,667

Version

3.1.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Christopher G Watson

Last Published

October 16th, 2025

Functions in brainGraph (3.1.1)

contract_brainGraph

Contract graph vertices based on brain lobe and hemisphere
cor.diff.test

Calculate the p-value for differences in correlation coefficients
communicability

Calculate communicability
corr.matrix

Calculate correlation matrix and threshold
Brain Atlases

Coordinates for data from brain atlases
centr_betw_comm

Calculate communicability betweenness centrality
coeff_var

Calculate coefficient of variation
choose.edges

Select edges for re-wiring
check_weights

Check for vertex or edge attributes
centr_lev

Calculate a vertex's leverage centrality
Creating_Graphs_GLM

Create a graph list with GLM-specific attributes
Graph Data Tables

Create a data table with graph global and vertex measures
GLM

Fit General Linear Models at each vertex of a graph
Count Edges

Count number of edges of a brain graph
edge_asymmetry

Calculate an asymmetry index based on edge counts
create_mats

Create connection matrices for tractography or fMRI data
delete_all_attr

Delete all attributes of a graph
efficiency

Calculate graph global, local, or nodal efficiency
get_rand_attrs

Convenience function to get attributes for lists of random graphs
dir2files

Return a vector of filenames based on a directory name or options list
GLM design

Create a design matrix for linear model analysis
hubness

Calculate vertex hubness
import_scn

Import data for structural connectivity analysis
GLM influence measures

Influence measures for a bg_GLM object
GLM basic info

Extract basic information from a bg_GLM object
GLM fits

Fit design matrices to one or multiple outcomes
GLM statistics

Extract model fit statistics from a bg_GLM object
GLM model selection

Model selection for bg_GLM objects
IndividualContributions

Approaches to estimate individual network contribution
GLM helpers

Helper functions to set-up for GLM analyses
Plotting GLM graphs

Plot a graph with results from GLM-based analyses
make_auc_brainGraph

Calculate the AUC across densities of given attributes
Mediation

Mediation analysis with brain graph measures as mediator variables
mtpc

Multi-threshold permutation correction
Creating_Graphs

Create a brainGraph object
Inverse

Calculate the inverse of the cross product of a design matrix
mean_distance_wt

Calculate weighted shortest path lengths
Matrix utilities

Matrix/array utility functions
Random Graphs

Perform an analysis with random graphs for brain MRI data
randomise

GLM non-parametric permutation testing
make_intersection_brainGraph

Create the intersection of graphs based on a logical condition
check_sID

Test if an object is a character vector of numbers
plot.brainGraph

Plot a brain graph with a specific spatial layout
make_ego_brainGraph

Create a graph of the union of multiple vertex neighborhoods
plot_vertex_measures

Plot vertex-level graph measures at a single density or threshold
plot_volumetric

Plot group distributions of volumetric measures for a given brain region
plot_rich_norm

Plot normalized rich club coefficients against degree threshold
plot_global

Plot global graph measures across densities
rename_levels

Rename the levels of global metrics in a data.table
Residuals

Linear model residuals in structural covariance networks
robustness

Analysis of network robustness
s_core

Calculate the s-core of a network
vif.bg_GLM

Variance inflation factors for bg_GLM objects
Vertex Roles

Gateway coefficient, participation coefficient, and within-mod degree z-score
small.world

Calculate graph small-worldness
set_graph_colors

Color graph vertices and edges
subset_graph

Subset graphs based on a given logical condition
update_fs_names

Update column names in a Freesurfer table
Graph Distances

Calculate Euclidean distance of edges and vertices
vulnerability

Calculate graph vulnerability
write_brainnet

Write files to be used for visualization with BrainNet Viewer
Utility functions

Utility functions
plot_brainGraph_multi

Save PNG of one or three views for all graphs in a brainGraphList
rich_club_attrs

Assign graph attributes based on rich-club analysis
plot.brainGraphList

Plot a brainGraphList and write to PDF
Rich Club

Rich club calculations
brainGraph_permute

Permutation test for group difference of graph measures
Bootstrapping

Bootstrapping for global graph measures
brainGraphList

Create a list of brainGraph graphs
Attributes

Set graph, vertex, and edge attributes common in MRI analyses
Atlas Helpers

Atlas helper functions
brainGraph-methods

brainGraph generic methods
apply_thresholds

Threshold additional set of matrices
brainGraph

Default options for brainGraph
auc_diff

Difference in the area-under-the-curve of two vectors
NBS

Network-based statistic for brain MRI data