Skip to content

Visualizing MAGeT Brain results on Mouse Average

tulste edited this page Aug 20, 2019 · 13 revisions

There are two ways to get MAGeT-Brain results for mouse data

  1. using an hanatLM

  2. using an anatLM

  3. using an hanatLM `abijson <- "/opt/quarantine/resources/Allen_Brain/Allen_hierarchy_definitions.json" defs <- "/opt/quarantine/resources/Dorr_2008_Steadman_2013_Ullmann_2013_Richards_2011_Qiu_2016_Egan_2015_40micron/mappings/DSURQE_40micron_R_mapping.csv" hdefs <- makeMICeDefsHierachical(defs, abijson) vols <- addVolumesToHierarchy(hdefs, data$vols)

testing the interaction

model <- hanatLm(~group*sex, data, vols) FDR <- hanatFDR(model) thresholds(FDR)

F-statistic tvalue-(Intercept) tvalue-groupPFF tvalue-sexM tvalue-groupPFF:sexM

0.01 NA 13.13678 NA NA NA

0.05 NA 13.13678 NA NA NA

0.1 NA 13.13678 NA NA NA

0.15 NA 13.13678 7.024384 NA NA

0.2 NA 13.13678 7.024384 NA NA

##plotting

#hanatView(model, "tvalue.groupPFF", low=3.8, high=4.32, symmetric=T) #shows hierarchy

stats <- hanatToVolume(model, labelVol, "tvalue.groupPFF") t20 = 7.024384

#FDR20% sliceSeries(nrow = 6, ncol=6, begin=100, end=350) %>% anatomy(anatVol, low=700, high=1400) %>% overlay(stats, low=t20, high=8, symmetric = T) %>% legend("t-statistics") %>% draw() `

  1. using an anatLM `LMmodel<-anatLm(~ group * sex, data = data, anat = data$vols) FDR <- anatFDR(LMmodel) write.csv(FDR,"/data/chamal/projects/stephanie/cross-sect-asyn-PFF-project/analysis/FDR-sexbygroup.csv") # q values, which are corrected p values write.csv(LMmodel,"/data/chamal/projects/stephanie/cross-sect-asyn-PFF-project/analysis/anatLM-sexbygroup.csv")

FDR Thresholds:

F-statistic tvalue-(Intercept) tvalue-groupPFF tvalue-sexM tvalue-groupPFF:sexM

0.01 NA 13.13678 NA NA NA

0.05 11.094758 13.13678 3.473814 NA NA

0.1 5.455335 13.13678 2.388158 4.614023 4.539498

0.15 4.419606 13.13678 1.920934 3.948895 3.969978

0.2 3.192684 13.13678 1.631435 3.277182 2.206647

attr(LMmodel,"definitions") <- "/opt/quarantine/resources/Dorr_2008_Steadman_2013_Ullmann_2013_Richards_2011_Qiu_2016_Egan_2015_40micron/mappings/DSURQE_40micron_R_mapping.csv" attr(LMmodel,"atlas") <- "/opt/quarantine/resources/Dorr_2008_Steadman_2013_Ullmann_2013_Richards_2011_Qiu_2016_Egan_2015_40micron/ex-vivo/DSURQE_40micron_labels.mnc"

#create new function that assigns a tscore of a region from the anatLM to its corresponding label anatCreateVolume2 <- function (anat, column = 1) { labels <- read.csv(attr(anat, "definitions")) volume <- mincGetVolume(attr(anat, "atlas")) newvolume <- volume for (i in 1:nrow(labels)) { if (labels$right.label[i] == labels$left.label[i] ) { newvolume[volume < labels$right.label[i] + 0.5 & volume > labels$right.label[i] - 0.5] <- anat[labels$Structure[i], column] } else { newvolume[volume < labels$right.label[i] + 0.5 & volume > labels$right.label[i] - 0.5] <- anat[paste0("right ",labels$Structure[i]), column] newvolume[volume < labels$left.label[i] + 0.5 & volume > labels$left.label[i] - 0.5] <- anat[paste0("left ",labels$Structure[i]), column] } } return(invisible(mincArray(newvolume))) }

stats2 <- anatCreateVolume2(LMmodel, '/data/chamal/projects/stephanie/cross-sect-asyn-PFF-project/analysis/DSURQE_labels_tscores_interaction.mnc', column='tvalue-groupPFF:sexM') #need to create 3D volume to view stats on anatVol for mincPlotSliceSeries

hist(LMmodel[,"tvalue-groupPFF:sexM"]) t20 = 2.2 tmax = 6 sliceSeries(nrow = 5, ncol=5, begin=50, end=350) %>% anatomy(anatVol, low=700, high=1400) %>% overlay(stats2, low=t10, high=tmax, symmetric = T) %>% legend("t-statistics") %>% draw()`

Clone this wiki locally