make_brainGraphList error when thrs.by = 'consensus'

64 views
Skip to first unread message

jonata...@gmail.com

unread,
May 21, 2021, 2:03:59 PM5/21/21
to brainGraph-help
Dear Chris and experts,

I'm having the following error every time I run make_brainGraphList with a consensus-based thresholding (0.5).

After running for a while, the command exits with the following message:

Warning messages: 1: In mclapply(argsList, FUN, mc.preschedule = preschedule, mc.set.seed = set.seed,  :   scheduled cores 1, 2, 3, 4, 5, 6, 7, 8 did not deliver results, all values of the jobs will be affected

Has anyone experienced this?

I'm using brainGraph version 3.0.0 in R version 4.0.2 on a MacBook Pro (Quad-core Intel i5).

Best,
Jonatan

jonata...@gmail.com

unread,
May 25, 2021, 8:15:01 PM5/25/21
to brainGraph-help
Hi all,

To follow up on this, I have the same error using brainGraph v.2.7.3.

Best,
Jonatan

Chris Watson

unread,
Jun 14, 2021, 8:07:18 AM6/14/21
to brainGr...@googlegroups.com
I apologize for such a long delay. I started a new position and a few new projects, and have been working on proposals/submissions.

Is there any other information you can provide? Any more in the output of "traceback()"?
Ideally I would suggest you try the code on a Linux machine but if you do not have access I can try to look into it further.

Chris

--
You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-he...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/ec87af1b-c00d-4d77-aa13-05fda2f358dan%40googlegroups.com.

Chris Watson

unread,
Jun 14, 2021, 8:41:06 AM6/14/21
to brainGr...@googlegroups.com
I suppose a clue may be in the use of consensus-based thresholding. Do the outputs (i.e., the connectivity matrices themselves) contain NA or NaN (or Inf) values anywhere?

jonata...@gmail.com

unread,
Jun 14, 2021, 7:29:03 PM6/14/21
to brainGraph-help
Hi Chris,

thank you for follow back. No, the outputs do not contain NAs nor infinite values. 

Because of conflicts with another package I'm using (neuroCombat) I recently had to downgrade to v 2.7.0, but the error is still popping in this previous version too. 

I've also noticed that while writing the .rds files in 'savedir' there are some subjects missed. For instance, my first group has 594 individuals and the saved files go from sub-001 to sub-004, misses sub-005, and then continue from sub-006. This happens at each threshold (5) with various subjects at it ends up generating graphs for only 142 participants.

Warnings:

Warning messages:
1: In mclapply(argsList, FUN, mc.preschedule = preschedule, mc.set.seed = set.seed,  :
  scheduled cores 1, 2, 3, 4, 5, 6, 7, 8 did not deliver results, all values of the jobs will be affected

Traceback:

4: selectChildren(ac[!fin], -1)
3: mclapply(argsList, FUN, mc.preschedule = preschedule, mc.set.seed = set.seed, 
       mc.silent = silent, mc.cores = cores)
2: e$fun(obj, substitute(ex), parent.frame(), e$data)
1: foreach(k = seq_along(inds[[i]])) %dopar% {
       g.tmp <- graph_from_adjacency_matrix(A.norm.sub[[j]][, , 
           inds[[i]][k]], mode = "undirected", diag = F, weighted = T)
       g.tmp <- set_brainGraph_attr(g.tmp, atlas, modality = "fmri", 
           weighting = "pearson", threshold = thresholds[j], subject = covars[groups[i], 
               Subject[k]], group = groups[i], use.parallel = F, 
           A = A.norm.sub[[j]][, , inds[[i]][k]])
       saveRDS(g.tmp, file = paste0(savedir, sprintf("g%i_thr%02i_subj%03i%s", 
           i, j, k, ".rds")))
   }

All the best,
Jonatan

kcampbell

unread,
Jun 21, 2021, 7:34:29 PM6/21/21
to brainGraph-help
Hi Chris, 

I might be experiencing a similar issue at the equivalent of the 'make_brainGraphList' stage, but in version 2.7.3 (also have not updated to the current package version due to conflicts). I get an error *only* when threshold.by = 'consensus' is supplied 'create_mats' (no issue when supplying threshold.by = 'density').

I tried it on a single subject and the issue appears to be with 'set_brainGraph_attr'. Traceback on a single subject gave the following output: 
Error in vertex_spatial_dist(g) : 
  "dist" %in% edge_attr_names(g) is not TRUE
In addition: Warning messages:
1: In length(vattrs[[name]]) <- vc : length of NULL cannot be changed
2: In mean.default(E(g)$dist) :
  argument is not numeric or logical: returning NA

A bit of a deeper dive, it looks like the issue is coming from 'vertex_spatial_dist', but I'm unsure why or how to fix this. 
Also, there are no NAs/NaN/Inf's in my matrices. 

Any help is greatly appreciated!

Thanks, 
Kayleigh

Chris Watson

unread,
Jun 21, 2021, 9:44:36 PM6/21/21
to brainGr...@googlegroups.com
If you can post the data and code (off list if you prefer), I can take a look.

kcampbell

unread,
Jun 22, 2021, 7:53:41 PM6/22/21
to brainGraph-help
Hi Chirs, 

My apologies, it turns out I made an error in one of the thresholds I specified, which resulted in matrices of zero. Everything is working great now!

Thanks so much for your time, 
Kayleigh
Reply all
Reply to author
Forward
0 new messages