bug in graph creation in R version 4.0.2

35 views
Skip to first unread message

Jonatan Ottino González

unread,
Jul 13, 2020, 4:31:07 PM7/13/20
to brainGraph-help
Hi Chris and everybody,

I've been re-running some SC analysis on my new laptop where I have installed the latest R version (4.0.2) and run into what it seems to be a bug. The brainGraph version always was 2.7.3. 

In this step (below) I was getting an error in where the names of the dk ROIs where not recognized. The error said something like 'please check the spelling of: lBTST, ...' and listed all 68 ROIs.

g <- Map(function(x, y) 
  plyr::llply(x, 
              set_brainGraph_attr, 
              atlas = 'dk',
              modality = 'thickness',
              group = y, 
              .progress = 'text'), 
  g, as.list(groups))

I went back to R version 3.6.3 and everything is working perfectly fine again. Other libraries (tibble, dplyr) were also throwing some very weird warnings with this latest R version.

Hope this helps in case anybody was running into the same problem.

Best,
J

Jonatan Ottino González

unread,
Jul 13, 2020, 4:58:39 PM7/13/20
to brainGraph-help
I may have cried victory too soon... the error is back again

Screen Shot 2020-07-13 at 4.49.09 PM.png

Chris Watson

unread,
Jul 13, 2020, 5:03:41 PM7/13/20
to brainGr...@googlegroups.com
It looks like it names all the regions of the DK atlas. What are the graphs' vertex names? The error suggests they don't match the "name" column of the "dk" data.table.

--
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/2238869b-7250-4b2f-8f83-42794f5d5328o%40googlegroups.com.

Jonatan Ottino González

unread,
Jul 13, 2020, 5:44:21 PM7/13/20
to brainGraph-help
Hi Chris,

I'm running the same script on the same files in a MB Pro 2020 and in a MB Air 2014. I'm not getting the error in the MB Air.

Vertices are called after the DK atlas from the package (atlas <- brainGraph::dk$name)

To unsubscribe from this group and stop receiving emails from it, send an email to brainGr...@googlegroups.com.

Chris Watson

unread,
Jul 13, 2020, 10:46:39 PM7/13/20
to brainGr...@googlegroups.com
It is strange that it is running OK on some systems but not others, and stranger that you explicitly assign the vertex names and there is still an error. I am not sure what to suggest beyond continuing to use the system in which it works.

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/04354b46-6dcc-4a3a-bfbe-3d1bd3cdd299o%40googlegroups.com.

Gershon Spitz

unread,
Jul 21, 2020, 8:59:29 PM7/21/20
to brainGr...@googlegroups.com
Dear all,

I have found that this error can be circumvented by ‘relabelling’ the atlas names. Ie., at some point brainGraph adds.an ‘l’ or ‘r’ to each parcel. Therefore, add an ‘l’ or ‘r’ in the atlas data.table to match accordingly.

Best,
Gershon.

Jonatan Ottino González

unread,
Aug 11, 2020, 12:19:33 AM8/11/20
to brainGraph-help
Hi,

already checked that the vertices within the 'corrs' object are named the way brainGraph expects them to be ('dk' atlas). I tried uninstalling R and Rstudio and all of their packages and this worked for a while, but at some point it started throwing me the same error again. Maybe this is due to some conflict with another package that I have installed but still couldn't track which one it is.

Best,
J
Gershon.


--
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 brainGr...@googlegroups.com.

Chris Watson

unread,
Aug 11, 2020, 7:07:47 PM8/11/20
to brainGr...@googlegroups.com
Since I can't reproduce on my end, you will have to:

1. Report the full output of "traceback()"
2. Set "options(error=recover)" and run the function; this will open "browser" mode so you can inspect the workspace when the error occurs. This is more involved; for example, you would have to look at the code in the function and see what variables may be involved in the error. Then you can inspect the variables in the workspace.
3. It might be fixed in the next update of brainGraph. I had hoped to get it out already, maybe in the next 2 weeks it will be ready for release.

Chris

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/41192e91-190e-4fc3-b0c5-81dd835cf807o%40googlegroups.com.

jonata...@gmail.com

unread,
Sep 15, 2020, 7:21:03 PM9/15/20
to brainGraph-help
Hi Chris,

sorry for taking so long in sending you the traceback(). Can't figure out yet what's happening, though. Maybe the next update fixes it.

 Error in make_brainGraph(g, atlas, ...) : 
  Check the following vertex names:  lBSTS lcACC lcMFG lCUN lENT lFUS lIPL lITG liCC lLOG lLOF lLING lMOF lMTG lPARH lparaC lpOPER lpORB lpTRI lperiCAL lpostC lPCC lpreC lPCUN lrACC lrMFG lSFG lSPL lSTG lSMAR lFP lTP lTT lINS rBSTS rcACC rcMFG rCUN rENT rFUS rIPL rITG riCC rLOG rLOF rLING rMOF rMTG rPARH rparaC rpOPER rpORB rpTRI rperiCAL rpostC rPCC rpreC rPCUN rrACC rrMFG rSFG rSPL rSTG rSMAR rFP rTP rTT rINS 

9.stop(paste("Check the following vertex names: ", paste(V(g)$name[nonmatches], 
    collapse = " "))) 

8.make_brainGraph(g, atlas, ...) 

7..fun(piece, ...) 

6.(function (i) {
    piece <- pieces[[i]]
    if (.inform) { ... 
5.loop_apply(n, do.ply) 

4.plyr::llply(x, set_brainGraph_attr, atlas = "dk", modality = "thickness", 
    group = y, .progress = "text") 

3.(function (x, y) plyr::llply(x, set_brainGraph_attr, atlas = "dk", modality = "thickness", 
    group = y, .progress = "text"))(dots[[1L]][[1L]], dots[[2L]][[1L]]) 

2.mapply(FUN = f, ..., SIMPLIFY = FALSE) 

1.Map(function(x, y) plyr::llply(x, set_brainGraph_attr, atlas = "dk", 
    modality = "thickness", group = y, .progress = "text"), g, 
    as.list(groups)) 

Best,
Jonatan

Reply all
Reply to author
Forward
0 new messages