Location on server: /space/chen-syn01/1/data/cinliu/plots/before_and_after_brainmaps
Total of 16 plots. The Goal is to plot out the
8 UKB plots
8 ABCD
ABCD example
UKB exmple
You will need this spreadsheet to find 8p and 17q p values to plot brain maps.
Attached file: inversion_gclust_assoc_summary_cm_Jan1320.xlsx
File has 2 sheets
Sheet1 - UKB_disc_3244 (note; the ### in the picture is due to the fact we are in preview mode, but basically all the data are numeric values (decimal points) ranging between -1 and 1):
Sheet2 ABCD (note; the ### in the picture is due to the fact we are in preview mode, but basically all the data are numeric values (decimal points) ranging between -1 and 1):
To make the plots we need to first separate ABCD data and UKB data. (We will be altering the format so it's more friendly for ggseg to read later)
I manually opened 2 new excels sheets and copied and pasted the ACD and UKB data onto ABCD_before_and_after.xlsx and UKB_before_and_after.xlsx
I separated the data further by 4 sheets: 'area_before', "thickness_before", "area_after", and "thickness_after"
ABCD_before_and_after.xlsx and UKB_before_and_after.xlsx will be the files we will input into R to make the plots.
Quick screenshot of what ABCD_before_and_after.xlsx and UKB_before_and_after.xlsx look like:
Step 2: make the brain plots
For expalination of how to make brainplots using ggseg please see Step3 and 4 of Brainplot_p_global page as well as provide addition exampls at the bottom of that page.
This paper also provide lots of example code for things you can do with ggseg (I highly recommend): https://journals.sagepub.com/doi/full/10.1177/2515245920928009
But basically you want your region names to be exactly spelled the way ggsegChen prefers and you will be able to plot the brain plots smoothly (be extra careful about invisible spaces befroe or after words, see Step3 of Brainplot_p_global page).
In this project because we are plotting the brain plots to do a before and after comparison between each region, I also made a version where I adjust the color scale of the plots in pairs so the before and after are the same sale. This way it's easy to visually compare before and after if you need to.
(the inversion_brainmap_ABCDall.R and inversion_brainmap_UKBall.R just have the default plot settings where each plot is on is automatically adjusted to it's scale for best viewing. The pro of this is it's really good at showcasing the data in that one plot, so it's good if you want to compare the regions withing one brainplot)
I did this by manually looking up the max and min value of each pair and setting the scale_fill_gradientn(limits = c()) accordingly.