Hello,
I'm using brainGraph version 3.0.
I am doing analysis on fMRI data. The data has been fisher z-transformed, and then converted to a matrix using create_mats.
I run into an issue when trying to create make_brainGraphList on the subject level array. The error states: "Average nearest neighbor degree Works only with simple graphs, Invalid value."
I'm a little confused. The only way for a non-simple graph to exist is to have multiple edges connecting two nodes or for there to be a self-edge. I don't think the first issue of multiple edges is possible, so there must be a self-edge. A possible concern is that the fisher transform causes the diagonal values in each matrix to be Inf. However, I have zeroed out all the diagonals and run into the same issue.
Do you have any ideas what may be causing these issue? I know this isn't a strict brainGraph issue as it overlaps with igraph, however, the matrix that I am passing in has been created via brainGraph's create_mats function.
Here is an abbreviated code snippet:
'''
my.all.mats <- create_mats(matfiles$A, modality=modality,
threshold.by='density', mat.thres=thresholds, inds = inds)
A.all.norm.sub <- my.all.mats$A.norm.sub
A.all.norm.mean <- my.all.mats$A.norm.mean
for (j in seq_along(thresholds)) {
g[[j]] <- make_brainGraphList(A.all.norm.sub[[j]], atlas, modality=modality,
gnames=covars.fmri$SUBJID)
g.group[[j]] <- make_brainGraphList(A.all.norm.mean[[j]], atlas, modality=modality,
gnames=groups)
}
'''