How to use graynet results

For each combination of the parameters chosen, such as edge metric, atlas etc, graynet produces one network for each subject. The output format is in GraphML format, which can be easily read with networkx:

import networkx as nx
graph = nx.read_graphml(path_to_graphml_file)

More info can be found here.

The graph inside the graphML file is essentially a pair-wise distance matrix (measured by the metric chosen). There are many ways you can use it - easiest among them is to extract the upper triangular part of the connectivity matrix (as it is symmetric) and treat it a single-subject feature vector for that subject.

These subject-wise feature vectors can be used in many applications, including in the study of brain-behaviour relationships and as a biomarker candidate (e.g. see this study on ADNI and ABIDE). If you are interested in evaluating their predictive utility (out of sample prediction via cross-validation), it’s quite simple via neuropredict.

We encourage you to adopt graphML format to store and analyze the networks extracted from graynet, however, there maybe simple use cases you prefer simpler CSVs. To convert GraphML files to CSV format (containing just weight values, and nothing else), use the script https://github.com/raamana/graynet/blob/master/scripts/convert_graphml_to_csv.py

We plan to include additional scripts and convenience methods into graynet to gather the results into readily usable data structures such as pyradigm for further analysis. Stay tuned!