ggseg / ggsegExtra

Repository for extra atlases for the ggseg-package
https://ggseg.github.io/ggsegExtra/
Other
47 stars 17 forks source link

error opening extra atlases #20

Closed rb643 closed 4 years ago

rb643 commented 4 years ago

Despiste install of ggseg and ggsegExtra finishing fine and loading fine there seems to be an issue with loading any of the additional atlasess:

ggseg(atlas=glasser) Error in as_ggseg_atlas(geobrain) : There are missing necessary columns in the data.frame for it to be a ggseg_atlas: 'region' In addition: Warning message: In ggseg(atlas = glasser) : This is not a ggseg_atlas-class. Attempting to convert with as_ggseg_atlas()

Aside from that I was wondering where I can access the file naming list for each atlas?

drmowinckels commented 4 years ago

Hi!

Yes, thanks for this. It seems I have managed to unsync ggsegExtra from a large change we did in ggseg and ggseg3d last week (i did not push changes to master branch).

I will get this sorted today, hopefully, but for now you should be able to have a work-around untill I do get it fixed by renaming the area column in the atlas to region.

You can inspect the atlas' data by just typing the atlas name in the R console. The data is lazy-loaded, like many other datasets in R (like iris and mtcars).

library(ggseg)
#> Loading required package: ggplot2
library(ggsegExtra)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

ggseg(atlas=glasser)
#> Warning in ggseg(atlas = glasser): This is not a ggseg_atlas-class. Attempting
#> to convert with `as_ggseg_atlas()`
#> Error in as_ggseg_atlas(geobrain): There are missing necessary columns in the data.frame for it to be a ggseg_atlas: 'region'

ggseg(atlas  = rename(glasser, region=area))


glasser
#> # A tibble: 385 x 6
#>    atlas   area  hemi  side    label      ggseg            
#>    <chr>   <chr> <chr> <chr>   <chr>      <list>           
#>  1 glasser 1     left  lateral L_1_ROI    <tibble [74 × 4]>
#>  2 glasser 1     left  medial  L_1_ROI    <tibble [10 × 4]>
#>  3 glasser 1     right lateral R_1_ROI    <tibble [62 × 4]>
#>  4 glasser 10d   left  medial  L_10d_ROI  <tibble [26 × 4]>
#>  5 glasser 10d   right medial  R_10d_ROI  <tibble [26 × 4]>
#>  6 glasser 10pp  left  lateral L_10pp_ROI <tibble [41 × 4]>
#>  7 glasser 10pp  right medial  R_10pp_ROI <tibble [12 × 4]>
#>  8 glasser 10r   left  medial  L_10r_ROI  <tibble [34 × 4]>
#>  9 glasser 10r   right medial  R_10r_ROI  <tibble [33 × 4]>
#> 10 glasser 10v   left  medial  L_10v_ROI  <tibble [43 × 4]>
#> # … with 375 more rows

rename(glasser, region=area)
#> # A tibble: 385 x 6
#>    atlas   region hemi  side    label      ggseg            
#>    <chr>   <chr>  <chr> <chr>   <chr>      <list>           
#>  1 glasser 1      left  lateral L_1_ROI    <tibble [74 × 4]>
#>  2 glasser 1      left  medial  L_1_ROI    <tibble [10 × 4]>
#>  3 glasser 1      right lateral R_1_ROI    <tibble [62 × 4]>
#>  4 glasser 10d    left  medial  L_10d_ROI  <tibble [26 × 4]>
#>  5 glasser 10d    right medial  R_10d_ROI  <tibble [26 × 4]>
#>  6 glasser 10pp   left  lateral L_10pp_ROI <tibble [41 × 4]>
#>  7 glasser 10pp   right medial  R_10pp_ROI <tibble [12 × 4]>
#>  8 glasser 10r    left  medial  L_10r_ROI  <tibble [34 × 4]>
#>  9 glasser 10r    right medial  R_10r_ROI  <tibble [33 × 4]>
#> 10 glasser 10v    left  medial  L_10v_ROI  <tibble [43 × 4]>
#> # … with 375 more rows

Created on 2020-03-18 by the reprex package (v0.3.0)

drmowinckels commented 4 years ago

Hi @rb643 ! If you reinstall all the ggseg packages, you should be good to go without any weird work-arounds!

drmowinckels commented 4 years ago

Since we have not heard anything, I am assuming this is not resolved.