cwatson / brainGraph

Graph theory analysis of brain MRI data
166 stars 48 forks source link

A tutorial of how to build networks with brainGraph #37

Closed Clancy-wu closed 1 month ago

Clancy-wu commented 1 month ago

Hope this finds you well. I want to introduce my tutorial on building multiple networks and save the data table to excel csv file. Since igraph has delete the function 'as_adjacency_matrix()' and some of you may come up with this problem in your new R (for example, I used R 4.4.0), I have updated my tutorial to overcome this issue and also showed how to build networks with brainGraph (https://github.com/Clancy-wu/brainGraph_tutorial)

The steps I used: (1) use fmriprep+xcp_d to process functinal images, get MNI bold nii.gz (2) use qsiprep to process difussion iamges, get tck file (3) use pearsonr to construct functional network and use sift2_invnodevol_count to construct fiber network. (4) split the functional and fiber networks to raw network, positive network, and negative network. (5) use brainGraph to compute network properties and save results to csv file. Note that this netowrk files are .txt format.

The brainGraph is great, but not good enough. I think that most issues of it are actually from R software, not brainGraph itself.

szhorvat commented 1 month ago

Since igraph has delete the function 'as_adjacency_matrix()'

This is incorrect. This function was not removed, and will not be removed from igraph.

Clancy-wu commented 1 month ago

Yeah, you are right. I'm sorry for my unclear words. The function 'as_adjacency_matrix()' was no longer to support attributions of character in version 2.0.0 (https://r.igraph.org/news/index.html). I reports this function because when I install the brainGraph 3.0.0 in the R 4.4.0 with my ubuntu 20.04 system, the R terminal reminds me errors of using 'as_adjacency_matrix()' which can't be worked in igraph upper version 2.0.0. Therefore, I recommend the following code to run brainGraph with new version of R:

'# remotes::install_version("igraph", version = "1.6.0")' 'library(igraph) # 1.6.0' 'packageVersion("igraph") # 1.6.0'

Clancy-wu commented 1 month ago

Results comparison between GRETNA and brainGraph:

computation config

GRETNA (weighted)

image

GRETNA (binary)

image

brainGraph

image

Results Comparison

GRETNA (weighted)

image

GRETNA (binary)

image

brainGraph

image

Conclusion

(1) Density in brainGraph = Network Sparsity in GRETNA = rate threshold (contrast with fixed threshold) (2) Results of brainGraph are same to GRETNA (3) In brainGraph, the indicator with ‘wt’ represents ‘weighted’ and without ‘wt’ represents ‘binary’ (4) I recommend to use brainGraph rather than GRETNA