Skip to content
Snippets Groups Projects
Commit 9b41c0b0 authored by Yuka  SUZUKI's avatar Yuka SUZUKI
Browse files

cleanup

parent 4a9ec44c
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,8 @@ library(data.table)
library(plotROC)
library(cowplot)
Berisa = fread("Y:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\berisa_region.bed")
JASS_BMI = fread("Y:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\BMIanalysis\\Evaluation_new_associations_BMI_with_allSNPs.tsv")
Berisa = fread("../inputs/berisa_region.bed")
JASS_BMI = fread("../inputs/BMIanalysis/Evaluation_new_associations_BMI_with_allSNPs.tsv")
JASS_BMI = cbind(JASS_BMI,Berisa)
JASS_BMI = JASS_BMI[!apply(is.na(JASS_BMI), 1, any),]
......@@ -41,7 +41,7 @@ p_ROC = p_ROC + annotate("text", y=rev(seq(0.45,0.6,0.05)) ,x=0.6, label=c("AUC"
png("Y:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\Fig_SUP_BMI_pred_new_loci.png",
png("../outputs/Fig_SUP_BMI_pred_new_loci.png",
width = 8, height = 8, units = "in",
res = 300,
pointsize = 4)
......
......@@ -3,20 +3,20 @@ library(ggplot2)
library(cowplot)
library("stringr")
trait_72 = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\72trait_data_2023-07-07.csv")
trait_72 = fread("../inputs/72trait_data_2023-07-07.csv")
#trait_72 = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Tables\\Supp\\Output\\72trait_data_2023-07-07.csv")
head(trait_72)
trait_72 = trait_72[!is.na(trait_72[,`log10_mes_semilogadjust`]),]
setkey(trait_72, "ID")
Rho = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\COV_H0.csv")
Rho = fread("../inputs/COV_H0.csv")
setkey(Rho, "V1")
Rho = Rho[trait_72$ID , c("V1",trait_72$ID), with=FALSE]
res_dist = as.dist(1- Rho[trait_72$ID , trait_72$ID, with=FALSE])
res_dist[is.na(res_dist)] = 1
Rho_gen = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\Correlation_matrix_genetic.csv")
Rho_gen = fread("../inputs/Correlation_matrix_genetic.csv")
setkey(Rho_gen, "V1")
Rho_gen = Rho_gen[trait_72$ID , c("V1",trait_72$ID), with=FALSE]
gen_dist = as.dist(1- abs(Rho_gen[trait_72$ID, trait_72$ID, with=FALSE]))
......@@ -50,7 +50,7 @@ for(tr1 in 1:72){
}
}
png("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\Fig_sup_residual_covariance.png",width = 20, height = 20,
png("../outputs/Fig_sup_residual_covariance.png",width = 20, height = 20,
units = "in",
res = 300,
pointsize = 4)
......
......@@ -31,6 +31,6 @@ p_distrib = p_distrib + geom_density(data=xuf, linewidth=1.1,aes(x=X)) +theme_mi
p_distrib = p_distrib + scale_color_manual(name= "", label = c("Feature", "mean of the feature (random sets)", "mean of the feature (stratified sets)"),values=c("#E94F37", "#C0A04E", "#111D4A"))
png("Y:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\Fig_SUPP_illustration_stratification.png", width=500, height=500)
png("../outputs/Fig_SUPP_illustration_stratification.png", width=500, height=500)
p_distrib
dev.off()
......@@ -102,7 +102,7 @@ for(hypothesis in names(BG_mat)){
rho_ov= cor(Y1, Y2) * overlap # cor(Y1,Y2)=rho (rho=pe+pg); overlap=NS/N (fraction of overlapping samples out of all samples)
D = data.frame(matrix(c(Y1, Y2), ncol = 2))
png(paste0("/pasteur/zeus/projets/p02/GGS_JASS/5._ARTICLE_DISCOVERABILITY/Figures/outputs/simulations/Phenotype_", hypothesis,"_ov_",overlap,".png"))
png(paste0("../outputs/simulations/Phenotype_", hypothesis,"_ov_",overlap,".png"))
p = ggplot(D, aes(x=Y1, y=Y2)) + geom_point()
print(p)
dev.off()
......@@ -112,7 +112,7 @@ for(hypothesis in names(BG_mat)){
Beta_est = data.frame(B1 = Beta_estimate1, B2=Beta_estimate2)
png(paste0("/pasteur/zeus/projets/p02/GGS_JASS/5._ARTICLE_DISCOVERABILITY/Figures/outputs/simulations/Beta_", hypothesis,"_ov_",overlap,".png"))
png(paste0("../outputs/simulations/Beta_", hypothesis,"_ov_",overlap,".png"))
print(ggplot(Beta_est, aes(x=B1, y=B2)) + geom_point())
dev.off()
Z = Beta_est
......@@ -122,7 +122,7 @@ for(hypothesis in names(BG_mat)){
Z = as.data.frame(Z)
names(Z) = c("z1", "z2")
png(paste0("/pasteur/zeus/projets/p02/GGS_JASS/5._ARTICLE_DISCOVERABILITY/Figures/outputs/simulations/Z_", hypothesis,"_ov_",overlap,".png"))
png(paste0("../outputs/simulations/Z_", hypothesis,"_ov_",overlap,".png"))
print(ggplot(Z, aes(x=z1, y = z2)) + geom_point(alpha=0.5, size=1, color="blue"))
dev.off()
#
......@@ -151,15 +151,15 @@ for(hypothesis in names(BG_mat)){
range_z <- max(abs(Z$z1),abs(Z$z2))
write.table(Z, paste0("/pasteur/zeus/projets/p02/GGS_JASS/5._ARTICLE_DISCOVERABILITY/Figures/outputs/simulations/Z_scores_", hypothesis, "_ov_", overlap,"_N_", N,"ce_",ce, ".csv"), sep="\t", row.names=TRUE)
write.table(Z, paste0("../outputs/simulations/Z_scores_", hypothesis, "_ov_", overlap,"_N_", N,"ce_",ce, ".csv"), sep="\t", row.names=TRUE)
png(paste0("/pasteur/zeus/projets/p02/GGS_JASS/5._ARTICLE_DISCOVERABILITY/Figures/outputs/simulations/", hypothesis, "_ov_", overlap,"_N_", N,"ce_",ce, ".png"), width=1500, height=1500, res=300)
png(paste0("../outputs/simulations/", hypothesis, "_ov_", overlap,"_N_", N,"ce_",ce, ".png"), width=1500, height=1500, res=300)
p = ggplot(Z , id.var=c("z1", "z2"), aes(x=z1, y=z2, color=`Significance status`)) + geom_point(size=1.5) + scale_colour_manual(values = c("#3ba3ec","grey", "#f77189","#50b131")) + xlim(-range_z,range_z) + ylim(-range_z,range_z)
print(p + theme_minimal()+ theme(legend.position = "top", panel.spacing = unit(1.5, "lines"), text=element_text(size=16)) + labs(color="Significance Status"))
dev.off()
simu = simu+1
}
}
write.table(D_pval, paste0("/pasteur/zeus/projets/p02/GGS_JASS/5._ARTICLE_DISCOVERABILITY/Figures/outputs/simulations/", hypothesis, "_ov_", overlap,".csv"), sep="\t", row.names=TRUE)
write.table(D_pval, paste0("../outputs/simulations/", hypothesis, "_ov_", overlap,".csv"), sep="\t", row.names=TRUE)
}
}
......@@ -5,8 +5,7 @@ library(psych)
library(latex2exp)
library(scales)
trait_features = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\72trait_data_2023-07-07.csv")
#trait_features = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Tables\\Supp\\Output\\72trait_data_2023-07-07.csv")
trait_features = fread("../inputs/72trait_data_2023-07-07.csv")
head(trait_features)
lm_pol_neff <- lm(log10(`polygenicity (unadjusted)`) ~ Neff,data=trait_features)
......@@ -78,7 +77,7 @@ pG = pG + theme(plot.margin = margin(0,0,0.1,0.1, "cm"))
# set level features
###################
set_features = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\JASS_5CVdata-2023-08-01\\traitset_jass_5CVcombined_without_duplicates.tsv")
set_features = fread("../inputs/JASS_5CVdata-2023-08-01/traitset_jass_5CVcombined_without_duplicates.tsv")
names(set_features)
......@@ -175,7 +174,7 @@ p_corr = p_corr + scale_x_discrete("Var1", labels=label_parse()) + scale_y_discr
p_corr = p_corr + theme(plot.margin = margin(0,0,0.1,0.1, "cm"),axis.title.x=element_blank(), axis.title.y=element_blank())
png("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\fig2_feature_description.png",width = 13.5, height = 16,
png("../outputs/fig2_feature_description.png",width = 13.5, height = 16,
units = "in",
res = 600,
pointsize = 4)
......
......@@ -6,7 +6,7 @@ library(stringr)
library(latex2exp)
library(scales)
set_features = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\JASS_5CVdata-2023-08-01\\traitset_jass_5CVcombined_without_duplicates.tsv")
set_features = fread("../inputs/JASS_5CVdata-2023-08-01/traitset_jass_5CVcombined_without_duplicates.tsv")
#../inputs/JASS_5CVdata-2023-08-01/traitset_jass_5CVcombined_without_duplicates.tsv")
set_features[, percent_increase := 100*((Both+Univariate+Joint) / (Univariate+Both))]
......@@ -100,7 +100,7 @@ p_corr = p_corr + scale_x_discrete("Var1", labels=label_parse()) + scale_y_discr
png("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\Fig_3_jass_association_gain_without_duplicates_2.png", width = 9, height = 4,
png("../outputs/Fig_3_jass_association_gain_without_duplicates_2.png", width = 9, height = 4,
units = "in",
res = 300,
pointsize = 4)
......
......@@ -17,8 +17,8 @@ library(cowplot)
#JASS_res = rbindlist(CV_fold_JASS)
#MTAG_res = rbindlist(CV_fold_MTAG)
JASS_res = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\JASS_5CVdata-2023-08-01\\traitset_jass_5CVcombined_without_duplicates.tsv")
MTAG_res = fread("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\inputs\\MTAG_5CVdata-2023-08-01\\traitset_mtag_5CVcombined_without_duplicates.tsv")
JASS_res = fread("../inputs/JASS_5CVdata-2023-08-01/traitset_jass_5CVcombined_without_duplicates.tsv")
MTAG_res = fread("../inputs/MTAG_5CVdata-2023-08-01/traitset_mtag_5CVcombined_without_duplicates.tsv")
setkey(JASS_res, "Id")
setkey(MTAG_res, "Id")
......@@ -73,11 +73,11 @@ p3 = ggplot(frac_JASS_better, aes(x= `# of traits`, y=`Fraction of set where #JA
p3 = p3 + ylab("Fraction of set where #JASS >\n uncorrected #MTAG") + coord_flip() +theme_minimal()
png("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\Figure_5_JASS_vs_MTAG_without_duplicates_HJ.png", width=10, height=5, unit="in", res=300)
png("../outputs/Figure_5_JASS_vs_MTAG_without_duplicates_HJ.png", width=10, height=5, unit="in", res=300)
plot_grid(p1,NULL,p2,labels = c('A', "",'B'), rel_widths = c(6,0.1,4), nrow=1, ncol=3)
dev.off()
png("V:\\5._ARTICLE_DISCOVERABILITY\\Figures\\outputs\\Figure_SUP_JASS_vs_uncorrected_MTAG_without_duplicates_HJ.png", width=10, height=5, unit="in", res=300)
png("../outputs/Figure_SUP_JASS_vs_uncorrected_MTAG_without_duplicates_HJ.png", width=10, height=5, unit="in", res=300)
plot_grid(p1c,p3,labels = c('A', 'B'), rel_widths = c(6,4), nrow=1, ncol=2)
dev.off()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment