Supplementary plot 8
# Make plots
png(paste0("Simul_morphometricity_allModa.png"), width = 18,
height = 10, units = "cm", res = 400)
= c(viridis_pal(option = "C")(8)[6:8])
cols
par(mar = c(9, 5, 1, 1), mfrow = c(1, 3))
= read.table(paste0("07_BWAS_MOA_allModa_clusterFWER/BWAS_morphometricity_allModa_N",
res10 10, ".txt"))
= read.table(paste0("10_BWAS_MOA_multiORM_QC_allModa_clusterFWER/BWAS_morphometricity_allModa_N",
res102 10, ".txt"))
= read.table(paste0("15_BWAS_MOA_allModa_FE_clusterFWER/BWAS_morphometricity_allModa_N",
res103 10, ".txt"))
= cbind(res10$V2, res103$V2, res102$V2)
resAll boxplot(resAll, xaxt = "n", col = cols, ylim = c(0, 0.7), ylab = "Estimated morphometricity")
abline(h = c(0.2), col = "grey", lty = 2, lwd = 2)
text(cex = 1, x = c(1:3) + 0.25, y = -0.05, pos = 2, c("LMM (global BRM)",
"LMM with covariates", "LMM (multi. BRM)"), xpd = TRUE, srt = 65)
= read.table(paste0("07_BWAS_MOA_allModa_clusterFWER/BWAS_morphometricity_allModa_N",
res10 100, ".txt"))
= read.table(paste0("10_BWAS_MOA_multiORM_QC_allModa_clusterFWER/BWAS_morphometricity_allModa_N",
res102 100, ".txt"))
= read.table(paste0("15_BWAS_MOA_allModa_FE_clusterFWER/BWAS_morphometricity_allModa_N",
res103 100, ".txt"))
= cbind(res10$V2, res103$V2, res102$V2)
resAll boxplot(resAll, xaxt = "n", col = cols, ylim = c(0, 0.7))
abline(h = c(0.5), col = "grey", lty = 2, lwd = 2)
text(cex = 1, x = c(1:3) + 0.25, y = -0.05, pos = 2, c("LMM (global BRM)",
"LMM with covariates", "LMM (multi. BRM)"), xpd = TRUE, srt = 65)
= read.table(paste0("07_BWAS_MOA_allModa_clusterFWER/BWAS_morphometricity_allModa_N",
res10 1000, ".txt"))
= read.table(paste0("10_BWAS_MOA_multiORM_QC_allModa_clusterFWER/BWAS_morphometricity_allModa_N",
res102 1000, ".txt"))
= read.table(paste0("15_BWAS_MOA_allModa_FE_clusterFWER/BWAS_morphometricity_allModa_N",
res103 1000, ".txt"))
= cbind(res10$V2, res103$V2, res102$V2)
resAll boxplot(resAll, xaxt = "n", col = cols, ylim = c(0, 0.7))
abline(h = c(0.4), col = "grey", lty = 2, lwd = 2)
text(cex = 1, x = c(1:3) + 0.25, y = -0.05, pos = 2, c("LMM (global BRM)",
"LMM with covariates", "LMM (multi. BRM)"), xpd = TRUE, srt = 65)
dev.off()
Appendix 2
library(viridis)
= c(viridis_pal(option = "C")(8))
cols
png("ClusterFWER_allSignifT.png", width = 18, height = 8, units = "cm",
res = 400)
= "03_BWAS_uncorrected_allModa"
scenario par(mfrow = c(1, 3))
for (NNN in c(10, 100, 1000)) {
if (NNN == 10) {
par(mar = c(4, 4, 1, 1))
else {
} par(mar = c(4, 2, 1, 1))
}= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res "03_BWAS_uncorrected_allModa", "_NVertices", NNN, ".txt"),
header = T)
if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"03_BWAS_uncorrected_allModa", "_NVertices", NNN, "_extra.txt"))) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "03_BWAS_uncorrected_allModa", "_NVertices", NNN,
"_extra.txt"), header = T)
= rbind(res, res2[-1, ])
res
}if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"03_BWAS_uncorrected_allModa", "_NVertices", NNN, "_extra2.txt"))) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "03_BWAS_uncorrected_allModa", "_NVertices", NNN,
"_extra2.txt"), header = T)
= rbind(res, res2[-1, ])
res
}# initialise plot
= 1
iii plot(-log(res$signifT, base = 10), res$clusterFWER, ylim = c(0,
1), ylab = ifelse(NNN == 10, "Cluster FWER", ""), xlab = "Significance threshold",
col = "white")
for (scenario in c("03_BWAS_uncorrected_allModa", "09_BWAS_ICVagesex_allModa",
"04_BWAS_5globalPCs_allModa", "05_BWAS_10globalPCs_allModa",
"06_BWAS_10specificPCs_allModa", "07_BWAS_MOA_allModa",
"15_BWAS_MOA_allModa_FE", "10_BWAS_MOA_multiORM_QC_allModa")) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res "_NVertices", NNN, ".txt"), header = T)
scenario, if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"_NVertices", NNN, "_extra.txt"))) {
scenario, = read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "_NVertices", NNN, "_extra.txt"), header = T)
scenario, = rbind(res, res2[-1, ])
res
}if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"_NVertices", NNN, "_extra2.txt"))) {
scenario, = read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "_NVertices", NNN, "_extra2.txt"),
scenario, header = T)
= rbind(res, res2[-1, ])
res
}lines(-log(res$signifT, base = 10), res$clusterFWER,
ylim = c(0, 1), col = cols[iii], pch = 20)
= iii + 1
iii
}abline(h = 0.05, col = "lightgrey", lty = 2, lwd = 1)
abline(h = 0.2, col = "grey", lty = 2, lwd = 2)
}
legend(x = 18, y = 1, c("No covariates", "Age, Sex, ICV reg.",
"5 global PCs", "10 global PCs", "10 modality spe. PCs",
"LMM (global BRM)", "LMM with covariates", "LMM (multi. BRM)"),
lwd = 2, horiz = F, bty = "n", col = cols, cex = 0.8)
dev.off()
png("TPR_allSignifT.png", width = 18, height = 8, units = "cm",
res = 400)
= "03_BWAS_uncorrected_allModa"
scenario par(mfrow = c(1, 3))
for (NNN in c(10, 100, 1000)) {
if (NNN == 10) {
par(mar = c(4, 4, 1, 1))
else {
} par(mar = c(4, 2, 1, 1))
}= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res "03_BWAS_uncorrected_allModa", "_NVertices", NNN, ".txt"),
header = T)
if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"03_BWAS_uncorrected_allModa", "_NVertices", NNN, "_extra.txt"))) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "03_BWAS_uncorrected_allModa", "_NVertices", NNN,
"_extra.txt"), header = T)
= rbind(res, res2[-1, ])
res
}if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"03_BWAS_uncorrected_allModa", "_NVertices", NNN, "_extra2.txt"))) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "03_BWAS_uncorrected_allModa", "_NVertices", NNN,
"_extra2.txt"), header = T)
= rbind(res, res2[-1, ])
res
}# initialise plot
= 1
iii plot(-log(res$signifT, base = 10), res$Power, ylim = c(0,
1), ylab = ifelse(NNN == 10, "True Positive Rate", ""),
xlab = "Significance threshold", col = "white")
for (scenario in c("03_BWAS_uncorrected_allModa", "09_BWAS_ICVagesex_allModa",
"04_BWAS_5globalPCs_allModa", "05_BWAS_10globalPCs_allModa",
"06_BWAS_10specificPCs_allModa", "07_BWAS_MOA_allModa",
"15_BWAS_MOA_allModa_FE", "10_BWAS_MOA_multiORM_QC_allModa")) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res "_NVertices", NNN, ".txt"), header = T)
scenario, if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"_NVertices", NNN, "_extra.txt"))) {
scenario, = read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "_NVertices", NNN, "_extra.txt"), header = T)
scenario, = rbind(res, res2[-1, ])
res
}if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"_NVertices", NNN, "_extra2.txt"))) {
scenario, = read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "_NVertices", NNN, "_extra2.txt"),
scenario, header = T)
= rbind(res, res2[-1, ])
res
}lines(-log(res$signifT, base = 10), res$Power, ylim = c(0,
1), col = cols[iii], pch = 20)
= iii + 1
iii
}abline(h = 0.05, col = "grey", lty = 2, lwd = 3)
}
legend(x = 18, y = 1, c("No covariates", "Age, Sex, ICV reg.",
"5 global PCs", "10 global PCs", "10 modality spe. PCs",
"LMM (global BRM)", "LMM with covariates", "LMM (multi. BRM)"),
lwd = 2, horiz = F, bty = "n", col = cols, cex = 0.8)
dev.off()
library(viridis)
= c(viridis_pal(option = "C")(8))
cols = c(viridis_pal(option = "C", alpha = 0.2)(8))
cols2
png("ROC_clusterFWER.png", width = 18, height = 8, units = "cm",
res = 400)
par(mfrow = c(1, 3))
for (NNN in c(10, 100, 1000)) {
if (NNN == 10) {
par(mar = c(4, 4, 1, 1))
else {
} par(mar = c(4, 2, 1, 1))
}= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res "03_BWAS_uncorrected_allModa", "_NVertices", NNN, ".txt"),
header = T)
if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"03_BWAS_uncorrected_allModa", "_NVertices", NNN, "_extra.txt"))) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "03_BWAS_uncorrected_allModa", "_NVertices", NNN,
"_extra.txt"), header = T)
= rbind(res, res2[-1, ])
res
}if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"03_BWAS_uncorrected_allModa", "_NVertices", NNN, "_extra2.txt"))) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "03_BWAS_uncorrected_allModa", "_NVertices", NNN,
"_extra2.txt"), header = T)
= rbind(res, res2[-1, ])
res
}# initialise plot
= 1
iii plot(res$clusterFWER, res$Power, ylim = c(0, 1), ylab = ifelse(NNN ==
10, "Statistical Power", ""), xlab = "Cluster FWER",
col = "white")
for (scenario in c("03_BWAS_uncorrected_allModa", "09_BWAS_ICVagesex_allModa",
"04_BWAS_5globalPCs_allModa", "05_BWAS_10globalPCs_allModa",
"06_BWAS_10specificPCs_allModa", "07_BWAS_MOA_allModa",
"15_BWAS_MOA_allModa_FE", "10_BWAS_MOA_multiORM_QC_allModa")) {
= read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res "_NVertices", NNN, ".txt"), header = T)
scenario, if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"_NVertices", NNN, "_extra.txt"))) {
scenario, = read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "_NVertices", NNN, "_extra.txt"), header = T)
scenario, = rbind(res, res2[-1, ])
res
}if (file.exists(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
"_NVertices", NNN, "_extra2.txt"))) {
scenario, = read.table(paste0("BWAS_summary_fwer/power_FWER_allSignifT_",
res2 "_NVertices", NNN, "_extra2.txt"),
scenario, header = T)
= rbind(res, res2[-1, ])
res
}lines(res$clusterFWER, res$Power, ylim = c(0, 1), col = cols[iii],
pch = 20)
polygon(c(rev(res$clusterFWER), res$clusterFWER), c(rev(res$Power +
$SE_power), res$Power - res$SE_power), col = cols2[iii],
resborder = NA)
= iii + 1
iii
}abline(v = 0.2, col = "grey", lty = 2, lwd = 1)
}
legend(x = 0.4, y = 1, c("No covariates", "Age, Sex, ICV reg.",
"5 global PCs", "10 global PCs", "10 modality spe. PCs",
"LMM (global BRM)", "LMM with covariates", "LMM (multi. BRM)"),
lwd = 2, horiz = F, bty = "n", col = cols, cex = 0.8)
dev.off()
A work by by [Baptiste Couvy-Duchesne] - 13 June 2022