Original git repo for GABA vs Glu paper.
Now also hosting general GAM adjusted MRSI for the PFC slice (adjust_all.R
).
Located on rhea:/Volumes/Hera/Projects/7TBrainMech/scripts/mri/MRSI_roi/gam_adjust
.
Depends on 13MP20200207_LCMv2fixidx.csv
created upstream.
Used by /Volumes/Hera/Projects/7TBrainMech/scripts/Makefile
to build merge7T.csv
ls -tlrc out
- thresholding value( abs(z)<3 ) and grouping (bilateral per metabolite) may not be ideal
- general bugs from integrating (but see `test_*R` files)
Makefile
tries to list what scripts make what files and annotate their dependenciesmrsi_funcs.R
has functions to clean, add columns (invage, age2, dateNumeric), and reshape from wide to long (useful for plotting and summarise over metabolite and region) – though the output files should have the output of those, so hopefully only useful for posterityadjust_all.R
runs per bilateral region+metabolite gam residual adjustment, but only for a few metabolites. But it’s hopefully easy to extend
mets_keep <- c("GABA","Glu","Gln","Cho","Glc", "MM20")
Makefile
attempts to record provenance of outputs.
run make
to update only the outputs that are out of date.
mrsi_funcs.R
defines longer_met_CrSD()
which reshape
the wide (many columns) per-metabolite .Cr and .SD columns into
a longer (more rows) dataframe with repeating samples: a row for each metabolite.
New columns are 'met'
, 'Cr'
, and 'SD'
replace the original columns GABA.Cr, GABA.SD, Glu.Cr, ....
Long format data is easier to plot and group_by/summarize (or in non-tidyverse speak map + reduce
)
Per region per metabolite abs(zscore) threshold of 3 yields. (20230531 – TODO: confirm best strategy)
see adjust_all.R
and visualize.R
./test_mrsi_funcs.R
and ./test_res_with_age.R
exercises some functions
invisible(lapply(Sys.glob("test_*R"),testthat::test_file) )
out/gamadj_wide.csv
is added to merge7T.csv many directories up from here (20230531).
External measures (e.g. rest framewise displacement) are not included in this output
because they are expected to be merged from the original source there.