BS-seq分析流程(二)

DNA甲基化:DNA甲基化为DNA化学修饰的一种形式,能在不改变DNA序列的前提下,改变遗传表现。为表观遗传编码的一部分,是一种外遗传机制。DNA甲基化过程会使甲基添加到DNA分子上,例如在胞嘧啶环的5’碳上:这种5’方向的DNA甲基化方式可见于所有脊椎动物。 在人类细胞内,大约有1%的DNA碱基受到了甲基化。

gzip -dc A.1_bismark_bt2_pe.deduplicated.CX_report.txt.gz > A.1_bismark_bt2_pe.deduplicated.CX_report.txt
perl BismarkCX2methykit.pl A.1_bismark_bt2_pe.deduplicated.CX_report.txt
#准备注释需要的bed文件(格式12)
convert2bed -i gtf < out.gtf > out6.bed
grep 'exon' out6.bed > aa && mv aa out6.bed
python3 bed6Tobed12.py out6.bed  > out12.bed#bed6Tobed12.py
#methylKit安装及使用
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("methylKit")
library(methylKit)
file.list = list("A.CG_methykit.txt","B.CG_methykit.txt","C.CG_methykit.txt","D.CG_methykit.txt","E.CG_methykit.txt","F.CG_methykit.txt","G.CG_methykit.txt","H.CG_methykit.txt","I.CG_methykit.txt")
myobjDB=methRead(file.list,
sample.id=list("Control_1","Control_2","Control_3","Single_1","Single_2","Single_3","Multiple_1","Multiple_2","Multiple_3"),
assembly="HZGC",
treatment=c(0,0,0,1,1,1,2,2,2),
context="CpG",
mincov = 10,
dbtype = "tabix",
dbdir = "methylDB",
)
filtered.myobj=filterByCoverage(myobjDB,lo.count=10,lo.perc=NULL, hi.count=NULL,hi.perc=99.9)
meth=unite(filtered.myobj, destrand=FALSE)

pdf("Correlation.pdf")
getCorrelation(meth,plot=TRUE)
dev.off()
pdf("clusterSamples.pdf")
clusterSamples(meth, dist="correlation", method="ward", plot=TRUE)
dev.off()
pdf("PCAscreeplot.pdf")
PCASamples(meth, screeplot=TRUE)
dev.off()
pdf("PCAcluster.pdf")
PCASamples(meth)
dev.off()

tiles=tileMethylCounts(filtered.myobj,win.size=1000,step.size=1000)
meth=unite(tiles, destrand=FALSE)
myDiff=calculateDiffMeth(meth,num.cores=10)
diffMethPerChr(myDiff,plot=FALSE,qvalue.cutoff=0.01, meth.cutoff=25)
myDiff25p.hyper=getMethylDiff(myDiff,difference=25,qvalue=0.01,type="hyper")
myDiff25p.hypo=getMethylDiff(myDiff,difference=25,qvalue=0.01,type="hypo")
myDiff25p=getMethylDiff(myDiff,difference=25,qvalue=0.01)
diffMethPerChr(myDiff,plot=FALSE,qvalue.cutoff=0.01, meth.cutoff=25)
save.image("MS_M_S.RData")
Diffdataframe=getData(myDiff25p)
write.table(Diffdataframe, file="Diffdataframe.xls", sep="\t", quote=F, row.names=T, col.names=T)

Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *