参考 DNA-methylation effect on cotranscriptional splicing is dependent on GC architecture of the exon–intron structure
统计某一个位置出现CG的次数,以及CG被甲基化的比例
##统一保留内含子第一个和最后一个坐标grepRI~/work/Alternative/result/Gh_result/CO31_32_result/evolution2/A2_AS.txt|grepPB|cut-f3,4>1python~/github/zpliuCode/Isoseq3/04ASconserved/extractAScoordinate.py112##RI坐标awk'{OFS="\t";print $1,$2+1,$3,$4,$6}'2>RI.bed##SE坐标awk'{OFS="\t";print $1,$2,$3+1,$4,$6}'2>SE.bed##对于组成型的exon和intron,根据基因的链,赋予对于的链,对于超出原有注释范围的不管~/software/bedtools2-2.29.0/bin/intersectBed -a constitutive_intron.bed -loj -b ../TM1_gene.bed |awk'$4!="."{OFS="\t";print $1,$2,$3,$7,$9}'>1mv1constitutive_intron.bed##分割文件##提取每个坐标处的是否甲基化python~/github/zpliuCode/Isoseq3/07methylation/methylationByLocation.py~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta/data/cotton/zhenpingliu/QingxinSong_GB_DNAmethlation/A2/Rep1/02deduplicate_methylation/CpG_fdr_sorted.bam13##合并所有的任务的结果python~/github/zpliuCode/Isoseq3/07methylation/gatherAlleventLocal.pyconExon_methylation.txt##由于基数太大可能会造成差异,只对AS基因进行比较
比较AS基因和非AS基因的甲基化差异程度
方法参考: Asymmetric epigenome maps of subgenomes reveal imbalanced transcription and distinct evolutionary trends in Brassica napus
基因区域被分为了40个bin,以及基因上下游2kb分同样各分为40个bin
每个bin的甲基化程度用(甲基化的read/测到的总的read) 进行衡量
##提取上游的2kb坐标~/software/bedtools2-2.29.0/bin/flankBed-b2000-iTM1_gene.bed-gTM1_chromsome.bed|awk'$NF=="+"&&NR%2==1{print $0}$NF=="-"&&NR%2==0{print $0}'>Upstream2K_gene.bed##做成40个bin的窗口##统一用远离基因的一端做起始bin,区分正负链awk'$NF=="-"{print $0}'Upstream2K_gene.bed|~/software/bedtools2-2.29.0/bin/windowMaker-b--n40-isrcwinnum-reverse>Upstream2k_40bin.bed#正链则不需要反向awk'$NF=="+"{print $0}'Upstream2K_gene.bed|~/software/bedtools2-2.29.0/bin/windowMaker-b--n40-isrcwinnum>>Upstream2k_40bin.bed##提取基因某一个区域的甲基化程度python~/github/zpliuCode/Isoseq3/07methylation/extractMethylationRegion.pygene_40bin.bed/data/cotton/zhenpingliu/QingxinSong_GB_DNAmethlation/TM1/Rep1/02deduplicate_methylation/CpG_fdr_sorted.bamgene_40bin_CpG.txt##合并所有的bin,求平均的甲基化水平catDownstream/*|sed's/_/\t/g'|awk'{a[$2][1]+=$3;a[$2][2]+=1;}END{for(i in a){print i "\t"a[i][1]/a[i][2]}}'|sort-k1,1n|less##区分AS基因和非AS基因的甲基化程度