Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 95 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
2 of 5 committers (40.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.7%) to scientific vocabulary
Keywords
Repository
Graph theory analysis of brain MRI data
Basic Info
- Host: GitHub
- Owner: cwatson
- Language: R
- Default Branch: master
- Size: 5.65 MB
Statistics
- Stars: 159
- Watchers: 17
- Forks: 46
- Open Issues: 11
- Releases: 0
Topics
Metadata Files
README.md
brainGraph
brainGraph (RRID: SCR_017260) is an
R package for performing graph theory
analyses of brain MRI data. It is most useful in atlas-based analyses (e.g., using an atlas such as
AAL,
or one from Freesurfer); however, many of
the computations (e.g., the GLM-based
functions and the network-based statistic) will work with any graph that
is compatible with igraph. The package will
perform analyses for structural covariance networks (SCN), DTI tractography
(I use probtrackx2 from FSL), and
resting-state fMRI covariance (I have used the Matlab-based DPABI
toolbox).
- Requirements
- Compatibility
- Installation
- Usage - the User Guide
- Major changes in v3.0.0
- Graph measures
- Visualization
- Getting Help
- Future versions
Requirements
Operating Systems
The package should work "out-of-the-box" on Linux systems (at least on Red Hat-based systems; i.e., CentOS, RHEL, Scientific Linux, etc.) since almost all development (and use, by me) has been on computers running CentOS 6 and (currently) CentOS 7. I have also had success running it (and did some development) on Windows 7, and have heard from users that it works on some versions of Mac OS and on Ubuntu. Please see the User Guide (mentioned below) for more details.
Multi-core processing
Many brainGraph functions utilize multiple CPU cores. This is primarily done
via the foreach
package. Depending on your OS, you will need to install
doMC (macOS and Linux)
or doSNOW
(Windows).
Compatibility
Neuroimaging software
I mostly use Freesurfer and FSL, but the following software packages should be suitable. Note that this is an incomplete list; any software that can output a connectivity matrix will work. * Freesurfer * FSL * DPARSF * PANDA * TrackVis
Brain atlases
There are several brain atlases for which the data are present in brainGraph.
Atlases containing .scgm in the name contain both cortical and SubCortical Gray Matter (SCGM) regions.
1. dk and dk.scgm: Desikan-Killiany
2. dkt and dkt.scgm: Desikan-Killiany-Tourville
3. destrieux and destrieux.scgm: Destrieux
4. aal90 and aal116: Automated Anatomical Labeling atlas
5. aal2.94 and aal2.120: AAL-2
6. brainsuite: Brainsuite
7. craddock200: Craddock-200
8. dosenbach160: Dosenbach-160
9. hoa112: Harvard-Oxford atlas
10. lpba40: LONI Probabilistic Brain Atlas
11. hcp_mmp1.0: HCP-1mm
12. power264: Power-264
13. gordon333: Gordon-333
14. brainnetome: Brainnetome
Other atlases
Some functions accept a custom.atlas argument, so that you can analyze data that is from an atlas not present in brainGraph.
Other atlases to be added in the future include the following (I would need specific coordinate, region name, and lobe and hemisphere information):
* Shen-268
* Von Economo-Koskinas
* Willard-499 (see Richiardi et al., 2015)
* Schaefer-400
(see Schaefer et al., 2018)
Installation
There are (primarily) two ways to install this package:
Directly from CRAN: (use one of the following commands)
r install.packages('brainGraph') install.packages('brainGraph', dependencies=TRUE)From the GitHub repo (for development versions). This requires that the devtools package be installed:
r devtools::install_github('cwatson/brainGraph')This should install all of the dependencies needed along with the package itself. For more details, see the User Guide (PDF link).
Multi-core processing
To set up your R session for parallel processing, you can use the following code. Note that it is different for Windows.
This code should be run before any data processing. If you will always use a single OS, you can remove the unnecessary lines.
r
OS <- .Platform$OS.type
if (OS == 'windows') {
library(snow)
library(doSNOW)
num.cores <- as.numeric(Sys.getenv('NUMBER_OF_PROCESSORS'))
cl <- makeCluster(num.cores, type='SOCK')
clusterExport(cl, 'sim.rand.graph.par') # Or whatever functions you will use
registerDoSNOW(cl)
} else {
library(doMC)
registerDoMC(detectCores() - 1L) # Keep 1 core free
}
For example, I source the following simple script before I do any parallel processing with brainGraph:
r
pacman::p_load(brainGraph, doMC)
registerDoMC(detectCores())
GUI
On some systems (e.g., macOS and Windows) it might be difficult to
install the necessary packages/dependencies for the GUI functions. Since v2.2.0 (released 2018-05-28),
the R packages RGtk2
and cairoDevice
have been changed to Suggests (i.e., they are no longer required),
so it can be installed on a "headless" server.
If you are on macOS or Windows and would like GUI functionality, please see
this GitHub Gist. The comments
contain more recent information.
You may also need to install a few additional packages, shown here:
r
install.packages('gWidgets', dependencies=TRUE)
install.packages('gWidgetsRGtk2', dependencies=TRUE)
install.packages('RGtk2Extras', dependencies=TRUE)
Suggested packages
There are a few suggested packages that may be required for certain functions:
RGtk2andcairoDevice: as mentioned above, these are required to use the GUIboot: required forbrainGraph_bootHmisc: required forcorr.matrixade4: required forlooandaopexpm: required forcommunicabilityandcentr_betw_comm
Usage - the User Guide
I have a User Guide that contains extensive code examples for analyses common to brain MRI studies. I also include some code for getting your data into R from Freesurfer, FSL, and DPABI, and some suggestions for workflow organization.
The User Guide is the most complete documentation of this package. If you are a beginner using R, I encourage you to read it thoroughly. You may start with the Preface or at whichever chapter is suitable for your analyses.
Major changes in v3.0.0
There are several major changes in v3.0.0. See the User Guide for more extensive details.
- There are several fewer package dependencies, allowing for a quicker install process
- There are a few new built-in atlases (see below for the full list)
- Graph creation is simpler (in terms of code) with the new
brainGraphListobject - The GLM-based functions are significantly faster and easily handle large models. The most significant speed improvements are seen in
NBSandmtpc - There are more methods to calculate GLM-based statistics (including residuals, coefficient of determination, ANOVA, etc.)
- There are global options that give the user some more control
- There are other methods that make manipulating data objects easier/more flexible
To access the User Guide, a PDF is available at this link.
Graph measures
In addition to the extensive list of measures available in igraph, I have functions for calculating/performing:
Group analyses
There are several analyses based on the General Linear Model (GLM), and others that have different purposes.
GLM-based
- Between-group differences in vertex- or graph-level measures (e.g., degree, betweenness centrality, global efficiency, etc.) using the GLM's. See Chapter 8 of the User Guide, which was partly modeled after the GLM page on the FSL wiki
- The multi-threshold permutation correction (MTPC) method for statistical inference (see Drakesmith et al., 2015 and Chapter 9 of the User Guide)
- The network-based statistic (NBS) (see Zalesky et al., 2010 and Chapter 10 of the User Guide)
- Graph- and vertex-level mediation analysis (see Chapter 11 of the User Guide, and the mediation package in R)
Non-GLM based
- Bootstrapping of graph-level metrics (e.g., modularity)
- Permutation analysis of between-group differences in vertex- or graph-level measures
- "Individual contributions" (leave-one-out [LOO] and add-one-patient [AOP]; see Saggar et al., 2015)
Null graph-related measures
- Null/random graph generation (both the "standard" method, and also a method controlling for clustering; see Bansal et al., 2009)
- Small-worldness: the "original" of Watts & Strogatz, 1998 and Humphries et al., 2008, and "omega" introduced in Telesford et al., 2011
- Rich-club coefficients and normalization (see Zhou & Mondragon, 2004; and Colizza et al., 2006)
Other measures
- Efficiency (global, nodal, and local; see Latora & Marchiori, 2001)
- The rich-core (see Ma & Mondragon, 2015)
- Leverage centrality (see Joyce et al., 2010)
- Asymmetry index
- Robustness ("targeted attack" and "random failure") and vulnerability
- Euclidean distances of edges
- Participation coefficient and within-module degree z-score (see Guimera & Amaral, 2005a and 2005b)
- Gateway coefficient (see Vargas & Wahl, 2014)
- Communicability and communicability betweenness (see Estrada & Hatano, 2008; Estrada et al., 2009; Crofts & Higham, 2009)
- Vertex s-core membership (see Eidsaa & Almaas, 2013)
Visualization
There is a plotting GUI for fast and easy data exploration that will not work without data from a standard atlas (ideally to be extended some time in the future). You may use a custom atlas if you follow the same format as the other atlases in the package (see Chapter 4 of the User Guide for instructions).

Getting Help
For bug reports, feature requests, help with usage/code/etc., please join the Google Group brainGraph-help. You may also consult the User Guide, and you can open an issue here on GitHub.
Future versions
An incomplete list of features/functionality I plan on adding to future versions:
- Longitudinal modeling (with linear mixed effects (LME) models)
- Thresholding and graph creation using the minimum spanning tree as a base
- Thresholding and graph creation for resting-state fMRI using a technique such as the graphical lasso
- Write functions to print group analysis results in xtable format for LaTeX documents
Owner
- Name: Chris Watson
- Login: cwatson
- Kind: user
- Company: University of Texas Health Science Center at Houston
- Website: http://profiles.bu.edu/Christopher.Watson
- Repositories: 6
- Profile: https://github.com/cwatson
Postdoctoral Research Fellow
GitHub Events
Total
- Issues event: 1
- Watch event: 14
- Issue comment event: 1
- Fork event: 2
Last Year
- Issues event: 1
- Watch event: 14
- Issue comment event: 1
- Fork event: 2
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Chris Watson | c****n@b****u | 218 |
| Chris Watson | C****n@c****u | 123 |
| Chris Watson | c****n@c****t | 29 |
| Chris Watson | c****n@c****t | 5 |
| Michael Hallquist | m****t@g****m | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 34
- Total pull requests: 3
- Average time to close issues: 3 months
- Average time to close pull requests: 10 months
- Total issue authors: 28
- Total pull request authors: 3
- Average comments per issue: 4.35
- Average comments per pull request: 4.67
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 0
- Average time to close issues: 11 days
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 0
- Average comments per issue: 2.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Clancy-wu (3)
- seantma (3)
- giova1588 (2)
- AndrewLawrence (2)
- bgunasekera (1)
- GerardYu (1)
- RGTake (1)
- agucova (1)
- proteuslinzk (1)
- sdrakulich (1)
- mdeserisy (1)
- NedaRR (1)
- drmowinckels (1)
- soffiafdz (1)
- edmondson-lab (1)
Pull Request Authors
- michaelhallquist (1)
- jmarshallnz (1)
- richardbeare (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- cran 500 last-month
-
Total dependent packages: 1
(may contain duplicates) -
Total dependent repositories: 2
(may contain duplicates) - Total versions: 32
- Total maintainers: 1
proxy.golang.org: github.com/cwatson/braingraph
- Documentation: https://pkg.go.dev/github.com/cwatson/braingraph#section-documentation
-
Latest release: v3.0.0+incompatible
published over 5 years ago
Rankings
proxy.golang.org: github.com/cwatson/brainGraph
- Documentation: https://pkg.go.dev/github.com/cwatson/brainGraph#section-documentation
-
Latest release: v3.0.0+incompatible
published over 5 years ago
Rankings
cran.r-project.org: brainGraph
Graph Theory Analysis of Brain MRI Data
- Homepage: https://github.com/cwatson/brainGraph
- Documentation: http://cran.r-project.org/web/packages/brainGraph/brainGraph.pdf
- License: GPL-3
-
Latest release: 3.1.0
published almost 2 years ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.5.0 depends
- igraph >= 1.2.4 depends
- MASS * imports
- Matrix * imports
- abind * imports
- data.table >= 1.12.4 imports
- doParallel * imports
- foreach * imports
- grid * imports
- lattice * imports
- methods * imports
- parallel * imports
- permute * imports
- Hmisc * suggests
- RGtk2 * suggests
- ade4 * suggests
- boot * suggests
- cairoDevice * suggests
- car * suggests
- expm * suggests
- ggplot2 * suggests
- ggrepel * suggests
- gridExtra * suggests
- mediation * suggests
- oro.nifti * suggests
- scales * suggests