Epigenome-wide DNA Methylation Association Study of CHIP Provides Insight into Perturbed Gene Regulation
Creators: name: Huan, Tianxiao
Publisher: name: Zenodo
Year: 2025

description: Source data for Figure 2, Suppl. Figures 1-3, and Reponse to reviewer figure 1

Codes for Figure 2

library(ggplot2)library(ggsci)library(dplyr)

load("meta_anyCHIP_all_adjLam_annot.Rdata")

data<- file_all_annot # add your results_file heredata<- mutate(data, Association = ifelse(all.pval.fixed < 1e-7 & all.TE.fixed > 0, "Positive",                                         ifelse(all.pval.fixed < 1e-7 & all.TE.fixed < 0, "Negative", "NS")))data$Association<- factor(data$Association, levels = c("Positive", "Negative", "NS"))table(data$Association)data$significance_fdr=0data$significance_fdr[data$all.pval.fixed<1e-7]="Significant"table(data$significance_fdr)

png("volcano_meta_anyCHIP_all_adjLam_annot.png")ggplot(data, aes(x = all.TE.fixed, y = -log(all.pval.fixed, 10),                  color = Association))+geom_point(alpha = 0.5)+  ggrepel::geom_label_repel(data=filter(data,                                         significance_fdr == "Significant"),                             aes(label=UCSC_RefGene_Name), show.legend = F,                            max.overlaps = getOption("ggrepel.max.overlaps", default = 18), size=4)+  labs(title = "Volcano plot", x = "Beta Estimate")+  ylab(bquote(-log[10](P-Value)))+  guides(color = guide_legend(title = "", override.aes = list(size=5, alpha = 1)))+  scale_color_lancet(labels = c('1209 Positively assoc.', '8406 Negatively assoc.', "NS"), drop = F)+  theme_classic()+  theme(text = element_text(size=15), legend.position = "bottom")

dev.off()

##load("ASXL1_FHS_annot")data<- file_all_annot # add your results_file heredata<- mutate(data, Association = ifelse(P < 1e-7 & Estimate > 0, "Positive",                                         ifelse(P < 1e-7 & Estimate < 0, "Negative", "NS")))data$Association<- factor(data$Association, levels = c("Positive", "Negative", "NS"))table(data$Association)data$significance_fdr=0data$significance_fdr[data$P<1e-7]="Significant"table(data$significance_fdr)

png("volcano_ASXL1_adjSVp01_annot.png")ggplot(data, aes(x = Estimate, y = -log(P, 10),                  color = Association))+geom_point(alpha = 0.5)+  ggrepel::geom_label_repel(data=filter(data,                                         significance_fdr == "Significant"),                             aes(label=UCSC_RefGene_Name), show.legend = F,                            max.overlaps = getOption("ggrepel.max.overlaps", default = 18), size=4)+  labs(title = "Volcano plot", x = "Beta Estimate")+  ylab(bquote(-log[10](P-Value)))+  guides(color = guide_legend(title = "", override.aes = list(size=5, alpha = 1)))+  scale_color_lancet(labels = c('1471 Positively assoc.', '4607 Negatively assoc.', "NS"), drop = F)+  theme_classic()+  theme(text = element_text(size=15), legend.position = "bottom")

dev.off()

 

 

Codes for Suppl. Figure 1-3

load("meta_anyCHIP_all_adjLam_annot.Rdata")ls()

lambda <- function(p) median(qchisq(p, df=1, lower.tail=FALSE), na.rm=TRUE) / qchisq(0.5, df=1);

(ll_fixed_all<- lambda(file_all_annot[,"all.pval.fixed"]));## suppl. Figure 1-A(ll_fixed_AA<- lambda(file_all_annot[,"AA.pval.fixed"])); ##suppl. Figure 2-A(ll_fixed_EA<- lambda(file_all_annot[,"EA.pval.fixed"])); ##suppl. Figure 3-A

load("meta_dnmt3a_all_adjLam_annot.Rdata")ls()

(ll_fixed_all<- lambda(file_all_annot[,"all.pval.fixed"]));## suppl. Figure 1-B(ll_fixed_AA<- lambda(file_all_annot[,"AA.pval.fixed"])); ##suppl. Figure 2-B(ll_fixed_EA<- lambda(file_all_annot[,"EA.pval.fixed"])); ##suppl. Figure 3-B

load("meta_tet2_all_adjLam_annot.Rdata")ls()

(ll_fixed_all<- lambda(file_all_annot[,"all.pval.fixed"]));## suppl. Figure 1-B(ll_fixed_AA<- lambda(file_all_annot[,"AA.pval.fixed"])); ##suppl. Figure 2-B(ll_fixed_EA<- lambda(file_all_annot[,"EA.pval.fixed"])); ##suppl. Figure 3-B

load("ASXL1_FHS_annot.Rdata")ls()

(ll_fixed_all<- lambda(file_all_annot[,"P"]));## suppl. Figure 1-D

 

Codes for response to reviewers figure 1

 

load("meta_tet2_all_adjLam_annot.Rdata")ls()

tet2_down=file_all_annot[file_all_annot$all.TE.fixed<0,]

 

load("meta_dnmt3a_all_adjLam_annot.Rdata")ls()

dnmt3a_sig=file_all_annot

overlapped_cpgs=dnmt3a_sig$CpG[dnmt3a_sig$CpG%in%tet2_down$CpG]

 

tet2_down_1=tet2_down[,c("CpG", "all.TE.fixed", "all.pval.fixed")]

dnmt3a_sig_1=dnmt3a_sig[,c("CpG", "all.TE.fixed", "all.pval.fixed")]

 

tet2_down_dnmt3a=merge(tet2_down_1,dnmt3a_sig_1,by="CpG")

 

png("Tet2_down_dnmt3a_pval.png")

plot(-log10(tet2_down_dnmt3a$all.pval.fixed.x), -log10(tet2_down_dnmt3a$all.pval.fixed.y),

     main = "Plot Comparing Two Sets of P-values",

     xlab = "TET2 -log10(p-values)", 

     ylab = "DNMT3A -log10(p-values)",

     pch = 19, col = "red")

 

dev.off()