awk '{print $1,$2,$2,$6}' OFS="\t" fdr.file >fdr.bed
Ghir_A11 48563862 48571977 Ghir_A11G021610
Ghir_A11 48086239 48087160 Ghir_A11G021550
Ghir_A11 48315032 48323201 Ghir_A11G021570
~/software/bedtools2-2.29.0/bin/intersectBed -loj -a ../TM-1_gene.bed -b CpG_context_TM1_qs_rep1_count.txt_binom.txt_fdr.bed >3
awk '$8=="."{print $4"\t0"}$8!="."&&$8<=0.05{a[$4][0]+=1}$8!="."&&$8>0.05{a[$4][1]+=1}END{for(i in a){print i"\t"a[i][0]/(a[i][0]+a[i][1])}}' 1 >2
data1 <- read.table("CHG_context_TM1_qs_rep1_count.txt_binom.txt_fdr.bed_end_sorted")
data2 <- read.table("CHG_context_TM1_qs_rep2_count.txt_binom.txt_fdr.bed_end_sorted")
cor.test(data1$V2,data2$V2,method = c("pearson"))