BRAPH: A graph theory software for the analysis of brain connectivity

The brain is a large-scale complex network whose workings rely on the interaction between its various regions. In the past few years, the organization of the human brain network has been studied extensively using concepts from graph theory, where the brain is represented as a set of nodes connected by edges. This representation of the brain as a connectome can be used to assess important measures that reflect its topological architecture. We have developed a freeware MatLab-based software (BRAPH–BRain Analysis using graPH theory) for connectivity analysis of brain networks derived from structural magnetic resonance imaging (MRI), functional MRI (fMRI), positron emission tomography (PET) and electroencephalogram (EEG) data. BRAPH allows building connectivity matrices, calculating global and local network measures, performing non-parametric permutations for group comparisons, assessing the modules in the network, and comparing the results to random networks. By contrast to other toolboxes, it allows performing longitudinal comparisons of the same patients across different points in time. Furthermore, even though a user-friendly interface is provided, the architecture of the program is modular (object-oriented) so that it can be easily expanded and customized. To demonstrate the abilities of BRAPH, we performed structural and functional graph theory analyses in two separate studies. In the first study, using MRI data, we assessed the differences in global and nodal network topology in healthy controls, patients with amnestic mild cognitive impairment, and patients with Alzheimer’s disease. In the second study, using resting-state fMRI data, we compared healthy controls and Parkinson’s patients with mild cognitive impairment.


Introduction
Graph theory studies the properties and behavior of networks, which are systems consisting of a set of elements (nodes) linked by connections or interactions (edges). Many systems found in Nature, ranging from social interactions to metabolic networks and transportation systems, can be modeled within this framework, pointing to a set of underlying similarities among these very diverse systems. The human brain can also be modeled as a network (the human connectome) [1], where brain regions are the nodes and the connections between them are the PLOS ONE | https://doi.org/10.1371/journal.pone.0178798 August 1, 2017 1 / 23 a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 single file. Importantly, this is not only practical but also increases the reliability and reproducibility of the results, which is an increasingly important issue within the research community. In addition, BRAPH offers a comprehensive manual, continuous release of new utilities, and a support forum, all of which can be accessed at http://www.braph.org/. Finally, BRAPH offers online videos that provide a step-by-step guide on how to perform graph theory analyses, allowing the users a simple and quick start for their brain connectivity studies. Below we describe in detail the different options that BRAPH offers for graph theory analyses when it comes to building connectivity matrices, applying threshold strategies, performing weighted or binary network analyses and computing random networks. Our software has already been successfully applied in previous graph theory studies [27,28] but to further demonstrate its abilities, in this article we assess network topology on structural MRI data from patients with amnestic mild cognitive impairment (MCI) and AD, and on fMRI data from PD patients with MCI.

Overview of BRAPH
BRAPH is a complete software package that allows carrying out all the steps of a graph theoretical analysis, visualize the results and generate high-quality publication-ready images. It can obtain undirected binary and weighted brain connectivity graphs starting from data acquired using various neuroimaging modalities, including MRI, fMRI, EEG, and positron emission tomography (PET). BRAPH can also assess the modular structure of the brain graph, employing various algorithms and extracting modules for further analysis. To test for significant differences between groups, BRAPH carries out non-parametric permutation tests and allows correcting the results for multiple comparisons using false discovery rate (FDR) [29]. It also provides options to normalize the network measures by random graphs as well as to carry out longitudinal graph theory analyses, the statistical significance of which is reported by nonparametric permutation tests.
As shown in Fig 1, the software consists of three independent layers connected by software interfaces: Graph, Data Structures and Graphical User Interfaces (GUIs). The Graph package includes the fundamental functions to perform a graph theory analysis and calculating the global and nodal measures. The Data Structures package provides the core functionalities of the software and allows defining the brain atlas, the cohort of subjects, and the type of graph analysis; importantly, all these functionalities can be accessed by command-line and can therefore be scripted by advanced users. Finally, the GUIs package provides a streamlined way to carry out graph theory analyses based on a series of GUIs for users without a computational background: (a) the GUI Brain Atlas allows selecting and editing the brain atlas; (b) the GUI Cohort allows defining the cohort of subjects by uploading the relevant data; (c) the GUI Graph Analysis allows building the connectivity matrices by selecting the type of graph (weighted, binary, see also Fig 2) and thresholding method (threshold, density) as well as calculating topological measures and visualizing the results. For the GUI Cohort and GUI Graph Analysis, four options can be selected (MRI, fMRI, PET, EEG) depending on the nature of the analysis. Fig 3 shows an overview of these different steps. Thanks to this three-layered structure, BRAPH can be easily expanded and customized to address any needs, e.g., by implementing new graph measures or new approaches for building brain graphs.

Defining the nodes
The first step of a graph theory analysis consists of defining the nodes, which generally correspond to the regions included in a brain atlas. This atlas should contain the names and labels of the brain regions as well as their spatial coordinates (x, y, z) in order to project them onto a 3D surface and create a visual representation of the brain graph. In the case of the analysis of structural networks (e.g. obtained from structural MRI data or T 1 -weighted images), the nodes are usually defined using an anatomical parcellation scheme that divides the brain into regions using the brain sulci and gyri as anatomical landmarks. Examples of anatomical atlases are the automated anatomical labeling (AAL) [30], Desikan [31] or Destrieux [32] atlases. BRAPH already provides these atlases ready for upload on the GUI Brain Atlas interface. In the case of the analysis of functional networks (e.g. obtained from fMRI data), the atlas may be defined using an anatomical parcellation scheme, a meta-analysis, or a clustering-based method of spatially coherent and homogenous regions. Examples of functional atlases are the Dosenbach Interfaces (GUIs). These layers are connected by unidirectional software interfaces (arrows). Graph contains the functions to perform graph analyses. In Data Structures, Brain Atlas allows defining the nodes of the network, Cohort allows defining the subjects to be studied and dividing them into groups, and Graph Analysis permits building the connectivity matrices and calculating network measures; each of these is implemented in an object, whose functionalities can be called by command line. For each of these objects, a GUI is provided (i.e. GUI Brain Atlas, GUI Cohort and GUI Graph Analysis). Thanks to this architecture BRAPH can be very easily maintained, expanded and customized.
https://doi.org/10.1371/journal.pone.0178798.g001 [33], the Power [34] and the Craddock [35] atlases, all of which are also provided by BRAPH. The user may also upload a different atlas from an external file (in.xml,.txt or.xls format) or create an entirely new one in the GUI. The resulting atlas can be saved as a.atlas file (see manual and website for an example of a.atlas file).
After the atlas has been created or uploaded into the software, the user should then upload the subject data into the GUI Cohort interface. This data may consist, for example, of cortical thickness, surface area or volume measures in structural MRI; regional time-series in restingstate fMRI; glucose metabolism or blood flow in PET and ASL; and electrophysiological signals in EEG or MEG. These regional values can be obtained using the Statistical Parametric Mapping (SPM; http://www.fil.ion.ucl.ac.uk/spm/), FMRI Software Library (FSL; https://fsl.fmrib. ox.ac.uk/fsl/fslwiki), FreeSurfer (https://surfer.nmr.mgh.harvard.edu/) or any other image preprocessing software. In addition, they may be corrected for the effects of nuisance variables such as age, gender or scanner site by means, for example, of linear regression (in this case the residual values should substitute the raw values in the network analysis) [36].

Defining the edges
Once the nodes of the network have been defined, the edges representing the relationship between them need to be computed. In BRAPH, the edges are calculated in GUI Graph Types of graphs. Graphs can be classified based on their edge weights (weighted or binary) and directionality (directed or undirected). It is possible to transform a directed graph into an undirected one by symmetrization (i.e. by removing the information about the edge directions), and a weighted graph into a binary one by thresholding (i.e. by assigning a value of 1 to the edges above a given threshold and 0 to those below threshold). Analysis as the statistical correlation between the values of all pairs of brain regions for an individual or for a group of subjects, depending on the neuroimaging technique. Different types of parametric and non-parametric correlations may be selected for this purpose: Pearson, Spearman, Kendall rank correlation coefficients, or (Pearson or Spearman) partial correlation coefficients. Note that all self-connections are eliminated from the analysis by setting the diagonal entries in the connectivity matrix to zero. In addition, the user can also choose whether to retain the negative correlation coefficients, substitute them with their absolute value, replace them by zero, or transform the values using an s-transform. Workflow for a graph theory analysis in BRAPH and relative graphical user interfaces (GUIs). A) The brain regions are defined in the GUI Brain Atlas. B) The data of the subjects are imported in the GUI Cohort and the user can define groups and edit their age, gender and other relevant data. C) The connectivity matrix is calculated in the GUI Graph Analysis after selecting the parameters defining the type of correlation, how to deal with negative correlation coefficients, and which type of graph to analyze: D) binary undirected graphs at a fixed density (GUI Graph Analysis BUD); E) binary undirected graphs at a fixed threshold (GUI Graph Analysis BUT); F) weighted undirected graphs (GUI Graph Analysis WU). https://doi.org/10.1371/journal.pone.0178798.g003

Network construction
To minimize the computation time, the graph measures can be calculated using optimized algorithms based on linear algebra. Therefore, a graph is more conveniently represented as a connectivity matrix, where the rows/columns denote the nodes and the matrix elements represent the edges between the nodes. Each row of the connectivity matrix represents the edges that are going out from a node; for example, row j represents the edges that are going out from node j. Each column of the matrix represents the nodes that arrive to a node; for example, column k represents the edges that are arriving to node k. Thus, the element (j, k) represents the edge that goes from node j to node k. The specific order of the nodes in the matrix does not affect the calculation of the graph theory measures, but only the graphical representation of the connectivity matrix. As illustrated in Fig 2, based on the nature of the edges' weight and directionality, four types of graphs can be defined. Weighted directed (WD) graphs have edges associated with a real number, indicating the strength of the connection, and are directed (i.e., node j can be connected to node k without node k being connected to node j). The edges in the weighted undirected (WU) graphs are associated with a real number indicating the strength of the connection and are undirected (i.e., if node j is connected to node k, then node k is also connected to node j), resulting in a symmetric connectivity matrix. Binary directed (BD) graphs have directed edges, which can either be 0 or 1, indicating the absence or presence of a connection. The edges in a binary undirected (BU) network can also be either 0 or 1 and they have no directionality. In order to transform a directed graph into an undirected graph, the connectivity matrix needs to be symmetrized. In BRAPH, the connectivity matrix can be symmetrized via command line by: (a) taking the sum between the matrix itself and its transpose; (b) taking the difference between the previous two; (c) comparing the matrix to its transpose and selecting either the smaller or the larger value for each entry. We remark that, even though the directed measures are not currently used in the analyses performed by BRAPH, they are already available in the Graph package and ready to be used in future versions of the software.
To transform a weighted graph into a binary one, BRAPH assigns a value of 1 to the edges above a given threshold and 0 to those below it. There are two ways of applying a threshold: (a) by selecting a correlation coefficient as the cut-off value below which all connections are excluded from the analysis (binary undirected threshold (BUT) interfaces); or (b) by fixing the fraction of edges (i.e., a specific density) that will be connected (binary undirected density (BUD) interfaces). The choice between these two options becomes significant when comparing different groups of subjects, as it may lead to different results; currently the density approach is more often employed in the literature, because it permits analyzing differences in network architecture while controlling for the different number of edges across individuals or groups. Additionally, BRAPH can be straightforwardly extended to include any alternative approach to determine the threshold, such as using a threshold-dependent cost function [37], maintaining the degree for each graph [38], keeping the ratio of strongest edges fixed [39], or using a heuristic approach based on the Dijkstra's algorithm [40]; all these approaches can be implemented by creating new objects analogous to MRIGraphAnalysisBUT or MRIGraphAnalysis-BUD, and adapting the already existing methods in BRAPH.
For MRI or static PET data, a single connectivity matrix is calculated for each group of subjects; therefore, the graph theory measures reflect the group's properties. For fMRI data and other neuroimaging sequences that provide a measure of brain function over time, an individual connectivity matrix is calculated for each subject; therefore, the graph theory measures reflect the characteristics of each subject, which can then be averaged within a particular group.

Network analysis
BRAPH allows calculating both global and nodal network measures, on weighted or binary networks, using different thresholds or densities. To test for significant differences between groups (cross-sectional analysis) or two different points across time (longitudinal analysis), BRAPH performs non-parametric permutation tests, reporting one-tailed and two-tailed pvalues based on 95% confidence intervals. The tests are performed by first randomly permuting the subjects from both groups and then calculating the differences in the graph measures between the new randomized groups. By repeating this procedure multiple (typically 1000 or 10000) times, a distribution of between-group differences is obtained. The p-values are then calculated as the fraction of the difference distribution values that exceeded the difference value between the actual groups. The same procedure is employed for the analysis of the longitudinal data with the difference that only the data corresponding to the same subject at different time points are permuted in order to prevent a group from containing the subject's data from two data points.
The network measures can also be compared with the corresponding measures calculated on random graphs with the same degree or weight distribution. These can be used, for example, to normalize weighted network measures. The needed random graphs are generated using the algorithms provided in the Brain Connectivity Toolbox [16].
Regarding nodal network measures, the permutation tests are carried out for each brain region, assessing simultaneously multiple null hypotheses, which consequently increases the risk of finding false positives. BRAPH deals with this issue by providing the adjusted p-values that should be considered to correct the results for multiple comparisons with false discovery rate (FDR) using the Benjamini-Hochberg procedure [29].

Graph theory measures
BRAPH can calculate several graph theory measures that assess the topology of the whole brain network as well as of its regions. Here, we explain briefly some of the most relevant ones; for a complete list with formulas and details, please refer to the BRAPH manual and website. The code we used to calculate the graph measures was adapted from the Brain Connectivity Toolbox (http://www.brain-connectivity-toolbox.net/) [16], which is regarded as the most important reference in the field since it provided the seminal groundwork for the use of graph theory by neuroimaging researchers.
The simplest, yet most fundamental, measure that can be assessed in a graph is the degree, which is the number of connections a node has with the rest of the network. The degree distribution in the brain follows an exponentially bound power law [41] meaning that similarly connected areas tend to communicate with each other [42]. In weighted graphs, BRAPH allows the user to calculate the nodal strength as well as nodal degree: the nodal strength is given by the sum of the weights of all connections linked to the node; and the nodal degree is the total number of the node's connections (thus assuming each edge has weight 1, making it analogous to the case of binary graphs).
Another important measure is the shortest path length, which is the shortest distance between two nodes. In a binary graph, distance is measured as the minimum number of edges that need to be crossed to go from one node to the other. In a weighted graph, the length of an edge is a function of its weight; typically, the edge length is inversely proportional to the edge weight because a high weight implies a stronger connection. The average of the shortest path lengths between one node and all other nodes is the characteristic path length [2]. One can also define two related measures of centrality: the closeness centrality, which is the inverse of the shortest path length, and the betweenness centrality, which is the fraction of all shortest paths in the network that pass through a given node [16]. These and other measures can be used to assess whether a node is a brain hub [43], regulating most of the information flow within the network.
The closer the nodes are to each other, the shorter is the path length and the more efficient is the transfer of information between them. Therefore, one can define the global efficiency of a node as the inverse of the shortest path from that node to any other node in the network [44]. To assess the communication efficiency between a node and its immediate neighbors, the local efficiency can be calculated. Both global and local efficiency measures can be averaged over all nodes to describe global properties of the brain network [44].
The clustering coefficient is a measure that assesses the presence of cliques or clusters in a graph [2]. For each node, this can be calculated as the fraction of the node's neighbors that are also neighbors of each other. For the whole network, the nodal clustering coefficients of all nodes can be averaged into the mean clustering coefficient. A closely related measure to the clustering is the transitivity, which is defined as the ratio of paths that transverse two edges to the number of triangles. If a node is connected to another node, which in turn is connected to a third one, the transitivity reflects the probability that the first node is connected to the third.
The small-worldness is given by the ratio between the characteristic path length and mean clustering coefficient (normalized by the corresponding values calculated on random graphs) [2]; this is an important organizational property that describes an optimal network architecture. Compared to a random graph, a small-world network is characterized by similarly short paths but a significantly higher clustering coefficient.
A network can also be divided into separate communities corresponding to anatomical proximity or to a specific function shared by a group of nodes. The extent to which a network can be divided into these communities or modules can be calculated using the modularity, which maximizes the number of edges within communities and minimizes the number of edges between different communities [45]. The within-module z-score quantifies how well a node is connected with other nodes from the same module, while the participation coefficient assesses if a node has many connections with nodes from different modules. If a node has a high within-module degree, it is considered a provincial hub; if it has a high participation coefficient, it is considered a connector hub.

Subjects
(PD-MCI) if they scored 1.5 standard deviations below the scaled mean scores on any two cognitive tests, following previously published procedures for PD-MCI diagnosis in the PPMI cohort [47]. Patients that did not fulfill criteria for MCI were classified as cognitively normal (PD-CN). All PD patients and controls were scanned on a 3 Tesla Siemens scanner (Erlangen, Germany). Resting-state functional images were acquired using an echo-planar imaging sequence (repetition time = 2400 ms; echo time = 25 ms; flip angle = 80˚; matrix = 68×68; voxel size = 3.25×3.25×3.25 mm 3 ). The scan lasted 8 minutes and 29 seconds and included 210 volumes.
Each participating site in ADNI and PPMI received approval from an ethical standards committee before study initiation and obtained written informed consent from all participants.

Network construction and analysis
To assess structural network topology in controls, amnestic MCI patients, and AD patients from ADNI, the T 1 -weighted images of these subjects were preprocessed using FreeSurfer (version 5.3), as published elsewhere [28]. The cortical thickness and subcortical volumes of 82 regions were extracted and included as nodes in the network analysis. The edges between these regions were computed as Pearson correlations, setting the negative correlations to zero, and the network analyses were carried out on the binary undirected graphs, while controlling for the number of connections, across a range of densities from 5% to 25%, in steps of 0.5%.
To assess functional network topology in PD-CN patients, PD-MCI patients and a group of elderly controls from PPMI, fMRI images were preprocessed using SPM8 (http://www.fil.ion.

CTR (n = 15) PD-CN (n = 69) PD-MCI (n = 15) CTR vs PD-CN (p value) CTR vs PD-MCI (p value) PD-CN vs PD-MCI (p value)
Age ( ucl.ac.uk/spm) using the following steps: removal of first five volumes, slice-timing correction, realignment, normalization to the Montreal Neurological Institute (MNI) template (voxel size 3×3×3 mm 3 ), temporal filtering (0.01-0.08 Hz), regression of white matter, cerebrospinal fluid signals and six head motion parameters. The regional time-series of the 200 brain regions included in the Craddock atlas [35] were extracted from each subject. To compute the relationship between these regions, we used Pearson correlations and performed the network analyses on the weighted undirected graphs.
In both studies, non-parametric permutation tests with 10000 permutations were carried out to assess differences between groups, which were considered significant for a two-tailed test of the null hypothesis at p<0.05. In addition, to adjust the nodal network results for multiple comparisons, an FDR procedure was applied to control for the number of regions that were tested at q<0.05.

Structural network topology in amnestic MCI and AD
The structural correlation matrices and brain graphs of patients and controls can be found in Regarding global network topology (Fig 5), we found increases in the characteristic path length and local efficiency in MCI and AD patients compared to controls at several network densities. The transitivity and modularity showed the most widespread topological changes: the transitivity was decreased and the modularity was increased in MCI and AD patients across almost all network densities compared to controls. Compared to MCI, AD patients showed increases in the characteristic path length at a few network densities and widespread changes in the transitivity and modularity.
Regarding regional network topology (Fig 6), the nodal degree showed significant increases in the left medial orbitofrontal, right insula, bilateral rostral anterior cingulate and posterior cingulate gyri in addition to decreases in the left middle temporal, right precentral and right inferior parietal gyri in AD patients compared to controls. When compared to MCI, AD patients also presented a higher nodal degree in the left rostral anterior cingulate and isthmus cingulate gyri.
We also compared the nodal local efficiency between groups. This measure showed significant increases in the left transverse temporal gyrus in MCI patients compared to controls. AD patients showed increases in the local efficiency in the bilateral temporal pole and left entorhinal cortex as well as decreases in several regions from the frontal (bilateral superior frontal, left pars triangularis, bilateral pars opercularis, right postcentral gyri), temporal (bilateral inferior temporal gyri, amygdala, hippocampus) and parietal (left inferior parietal, right precuneus) lobes. When the two patient groups were compared to each other, AD patients showed efficiency increases in the right rostral anterior cingulate compared to the MCI group.

Functional network topology in PD-MCI
The functional connectivity matrices of controls, PD-CN and PD-MCI patients can be found in Fig 7. The comparison of the weighted average degree showed that both PD-CN and PD-MCI patients presented a lower number of connections compared to controls (PD-MCI = 172.6; PD-CN = 175.2; controls = 183.7), which showed a trend towards significance in the comparison with PD-CN (p-value = 0.081) and was statistically significant in the comparison with PD-MCI (p-value = 0.027). Then, we performed a modularity analysis on the weighted graphs of each group to assess the presence of smaller communities of regions (modules). This analysis showed there were five modules in controls, PD-CN and PD-MCI patients, which were quite similar in the three groups. Module I included medial frontal areas, the posterior cingulate and bilateral angular gyri, resembling the default-mode network. Module II comprised temporal and cerebellar areas. Module III included several middle, inferior frontal and parietal regions, similarly to the fronto-parietal network usually found in resting-state studies [5,6]. Module IV consisted of most of the visual cortex similarly to the previously reported visual network. Finally, Module V included mainly temporal and inferior frontal areas as well as the insula.
When we assessed the average degree of each module, we observed that PD-CN patients had a lower number of connections compared to controls in Module II, which included temporal and cerebellar areas (PD-CN = 49.02; controls = 51.89; p-value = 0.020), and Module V consisting of insular, temporal and inferior frontal regions (PD-CN = 28.39; controls = 28.93; p-value = 0.040). The regions within each of these modules did not show significant differences between controls and PD-CN patients after applying FDR corrections.  We also found that, with respect to controls, PD-MCI patients had a lower number of connections in Module III comprising fronto-parietal areas (PD-MCI = 54.87; controls = 57.95; p-value = 0.002) and Module V involving insular, temporal and inferior frontal areas (PD-MCI = 28.37; controls = 28.93; p-value = 0.040). Within Module III, the regions showing a significantly lower degree in PD-MCI patients after FDR corrections were the bilateral superior frontal, bilateral superior parietal gyri, precuneus, left middle frontal gyrus, inferior frontal gyrus and left anterior cingulate (Fig 8A). Within Module V, the regions showing a significantly lower degree in PD-MCI patients after FDR corrections were the left insula, right frontal orbital gyrus and bilateral transverse temporal gyri (Fig 8B).
To assess whether the presence of different MCI subtypes influenced the results in the PD-MCI group, we compared the average degree and the nodal degree of Modules III and V between each subtype and controls. In this study, the PD-MCI group consisted of 9 patients with multiple-domain MCI and 6 patients with single-domain MCI (5 amnestic, 1 patient non-amnestic). These two subtypes showed lower average degree in Module III (multipledomain MCI = 54.6; single-domain MCI = 55.3; controls = 58.0) and Module V (multipledomain MCI = 28.4; single-domain MCI = 28.3; controls = 28.9) compared to the control group. All the regions within these modules showed a lower nodal degree in the two MCI subtypes compared to controls, except the right transverse temporal gyrus, which had a similar degree in controls and single-domain MCI patients (S1 Table).

Discussion
Graph theory has introduced new opportunities for understanding the brain as a complex system of interacting elements. Thanks to this framework, we have come to appreciate that the human brain relies on fundamental aspects of network organization such as a small-world architecture, modular structure and vulnerable hubs. These properties allow our brains to evolve, grow and adapt within an environment presenting increasing cognitive demands, and their disruption accounts for some of the key aspects underlying pathology in neurological diseases. In this report, we present BRAPH, the first object-oriented software for graph theory analysis intended for all researchers, regardless of their scientific background. As modern network science continues to develop at an increasing pace, it is important to have a software that allows modifying existent code in a structured manner so that past knowledge can be easily integrated with new topological analyses and graph theory measures. We are currently working on some of these developments with a particular focus on multimodal analyses and effective connectivity measures. Amongst BRAPH's strengths is the fact that it deals with all the aspects of graph theory analysis, by providing the user with extensive assistance, from the first basic steps such as defining the nodes and edges to producing the final publication-ready figures of the results as well as to archiving the results and relative analysis procedure in a dedicated file. To get an impression on BRAPH's abilities, below we discuss some of the results we obtained in two different studies in patients with amnestic MCI, AD and PD-MCI.

Large-scale structural networks in amnestic MCI and AD
AD is currently one of the most prevalent neurodegenerative disorders, with a significant impact on society and caregiver burden [48]. Although the devastating impact of this condition has pushed forward a large research effort towards a more accurate diagnosis, the underlying effects of AD on network topology remain poorly understood. There is increasing evidence suggesting that the pathological hallmarks of AD, consisting of amyloid plaques neurofibrillary tangles, could spread in the brain through synapses and neural connections. Hence, the application of graph theory to the study of brain connectivity could shed light on the mechanisms of disease propagation in AD.
In the current study, we found that AD patients presented an abnormal global network topology as reflected by increases in the path length, local efficiency and modularity, and by decreases of transitivity. These changes indicate that the regions of their networks communicated less efficiently with other brain regions and between different brain modules. In particular, the most widespread changes in network organization were observed for the transitivity and modularity. The decreases in transitivity found in AD suggest that the regions of their network were poorly connected to neighboring areas, whereas the increases in modularity indicate that their modules had higher within-module connectivity and worse inter-module connectivity. Patients with amnestic MCI, who are potentially on the path to develop AD, also showed similar, albeit less extensive, network changes suggesting that amnesic MCI might be indeed an intermediate stage between healthy aging and dementia. These findings agree with the results obtained in previous studies [7,28].
The assessment of the nodal degree in AD showed widespread changes in the number of connections of regions that belong to the default-mode network, including the medial orbitofrontal, the anterior cingulate and posterior cingulate gyri, compared to controls or patients with MCI. This network has been strongly associated with AD as its regions coincide with the areas showing amyloid deposition, gray matter atrophy and glucose hypometabolism in these patients [49]. Hence, the changes we found in this study may partially reflect pathological and metabolic abnormalities that usually occur in AD patients.
In contrast to the nodal degree, the nodal local efficiency showed alterations both in MCI and AD patients. Whereas in MCI patients, these changes were confined to a single region in the left temporal lobe, in AD patients the local efficiency was altered across several frontal, temporal and parietal areas, including the hippocampus and amygdala, which are involved in AD pathology [50]. The local efficiency reflects how efficient is the communication between a region and its neighboring areas. Decreases in this measure might indicate a loss of local connections, whereas increases could reflect a compensatory mechanism by which the number of connections between close brain areas increases to compensate for the loss of connections between distant brain areas.
Hence, altogether our findings indicate that graph theory is a useful method to assess abnormalities in brain connectivity and topology in the prodromal and clinical stages of AD.

Large-scale functional networks in PD
Cognitive impairment is one of the most important non-motor symptoms in PD that greatly affect quality of life. During the course of the disease, most PD patients develop impairment in one or more cognitive domains, for which they receive a diagnosis of MCI. The presence of MCI in PD is associated with an increased risk to progress to dementia [51]. Hence, there is a pressing need to identify the underlying mechanisms of MCI to prevent cognitive decline in PD patients. Using a weighted network approach in BRAPH, we found that PD-MCI patients presented a lower number of connections in the whole brain network compared to controls. This indicates that in general their regions were more disconnected. However, after identifying the modular structure and performing the same analysis within each module, we observed that these effects were mostly driven by a lower degree in the fronto-parietal network and in a network involving temporal and inferior frontal regions in the PD-MCI group. The regions that were most affected in these networks were the superior frontal gyri, superior parietal gyri, precuneus, transverse temporal gyri and insula. All of these regions have been previously shown to display reduced connectivity in PD [8]. In addition, they have also been identified as important brain hubs in previous graph theory studies [43]. Within the graph theory framework, the brain hubs are the most important and central regions of a network as they mediate numerous long-distance connections. This characteristic also suggests they might have higher metabolic costs and a greater vulnerability to oxidative stress [43]. In a previous study [52], it was shown that the pathological brain lesions are concentrated in hub regions of the connectome in several neurodegenerative disorders, including PD, in line with our findings. The analyses that were carried out in the separate single-domain and multiple-domain MCI groups showed that the previous regions had reduced connectivity in both subtypes, suggesting that our results in PD-MCI patients were not driven by a particular subgroup.
In addition to the results found in the PD-MCI group, we also found a reduced number of connections in PD-CN patients in two networks that consisted of temporo-cerebellar areas and temporo-frontal regions. Previous studies using fMRI have found abnormalities in these brain areas in patients with PD [8]. Moreover, the inferior temporal gyri and inferior frontal cortex are amongst the first cortical areas becoming affected by Lewy body pathology in autopsy cases with PD [53] suggesting that they might play a relevant role in the progression of the disease from brainstem structures to cortical brain areas. The fact that both PD-CN and PD-MCI patients showed abnormalities in the same network of inferior temporal and frontal areas provides support to this assumption and suggests that these regions are important to understand disconnectivity in PD regardless of cognitive status.

BRAPH features
The application of graph theory to the field of imaging connectomics is still in its early beginnings. There are several important challenges that need to be addressed such as whether the nodes and edges are an accurate description of the true underlying brain connectome in all its complexity of billions of neurons and synapses. Although we have limited knowledge on how to address this particular issue, there are several other challenges that can be addressed through the use of BRAPH. For instance, given that the true connectome is a sparse network, it is important to threshold the structural or functional edges, which typically consist of continuous association indices [54]. This thresholding can be carried out using different methods. On the one hand, a threshold can be applied so that only the connections that are below some significance level are included in the analysis. In this way, the weaker connections of the graph are eliminated and considered spurious. This approach will yield different numbers of connections across different individuals or groups. On the other hand, a threshold can be applied such that all networks have the same number of connections through a fixed value of density. In this way, only a percentage of edges are included in the analyses and the graph theory measures are independent of the number of edges [54]. In BRAPH, both thresholding options are available so that the user can easily compare them.
Another important challenge is the choice of a given value of threshold since there is currently no way to establish which is the best value. To solve this issue, BRAPH allows testing a hypothesis across different levels of significance or densities to determine the robustness of the results. Some authors consider choosing a range of thresholds an arbitrary process that produces values that are strongly dependent on this choice. For this reason, we also provide an option for weighted network analysis, which allows assessing both strong and weak connections present in a graph and is not dependent on a particular thresholding scheme.
Another challenge that is beginning to emerge in the scientific community is the realization that different node definitions can lead to different network findings. Currently BRAPH provides six anatomical and functional brain atlases that the user can apply within the same study to assess the consistency of the results against different parcellation schemes. In addition, a new brain atlas can be easily created or uploaded in BRAPH that adjusts to the user needs.
Finally, the last challenge that can be addressed through BRAPH is the normalization of graph theory measures by reference to random networks that have a random organization (with the same degree and/or weight distribution). BRAPH provides various options to perform this normalization.
Several aspects of BRAPH will be expanded in future releases. In particular, while currently BRAPH allows analyzing the complete fMRI time-series (static functional connectivity) by calculating statistical correlations or partial correlations between them since this is the most used method to analyze fMRI data, we are planning to include dynamic functional connectivity analyses [23][24][25][26]55] in future versions of the software. Furthermore, we are also planning to allow the user to define the nodes using various data-driven methods, such as independent component analysis [55,56].
In conclusion, the study of the brain connectome is a growing field that will provide important insights into brain organization in health and disease. Amongst its numerous applications, there is the possibility it might help predicting the pathological spread of disease proteins in neurodegenerative disorders, which are becoming increasingly prevalent in the world's aging population. To address the increasing demands in this growing field we provide BRAPH, the first object-oriented software that will integrate new topological analyses and measures in a structured manner, allowing the users to be updated with the latest developments in graph theory. BRAPH can be found at https://www.braph.org with online videos, a comprehensive manual, a support forum and relevant links. It is free for all researchers and can be used in all operating systems.