差异甲基化分析

作者: jjjscuedu | 来源:发表于2021-03-27 18:50 被阅读0次

    DSS的下载与安装:

    source(http://bioconductor.org/biocLite.R)

    biocLite("DSS")

    =============先用包里自带的测试数据====================

    library(DSS)

    require(bsseq)

    path <- file.path(system.file(package="DSS"), "extdata")

    dat1.1 <- read.table(file.path(path, "cond1_1.txt"), header=TRUE)

    dat1.2 <- read.table(file.path(path, "cond1_2.txt"), header=TRUE)

    dat2.1 <- read.table(file.path(path, "cond2_1.txt"), header=TRUE)

    dat2.2 <- read.table(file.path(path, "cond2_2.txt"), header=TRUE)

    BSobj <- makeBSseqData( list(dat1.1, dat1.2, dat2.1, dat2.2), c("C1","C2", "N1", "N2") )[1:1000,]

    dmlTest <- DMLtest(BSobj, group1=c("C1", "C2"), group2=c("N1", "N2"))

    dmls <- callDML(dmlTest, p.threshold=0.001)       //差异单位点计算

    dmls2 <- callDML(dmlTest, delta=0.1, p.threshold=0.001)  //差异区域计算

    write.csv(dmls,"test.csv")     ///结果的输出可利用读写到个人命名的文件中

    dmlTest.sm <- DMLtest(BSobj, group1=c("C1", "C2"), group2=c("N1", "N2"), smoothing=TRUE)

    //注意,这里也可以使用smoothing进行操作,事实上使用的示例数据我也不清楚是RRBS还是WGBS,但是使用dmlTest call DML会有更多的结果。

    ===============自己的数据=======================

    dat1.1 <- read.table("SRR10401139.1_DSS_input.txt", header=TRUE)

    dat1.2 <- read.table("SRR10401140.1_DSS_input.txt", header=TRUE)

    dat1.3 <- read.table("SRR10401141.1_DSS_input.txt", header=TRUE)

    dat2.1 <- read.table("SRR10401142.1_DSS_input.txt", header=TRUE)

    dat2.2 <- read.table("SRR10401143.1_DSS_input.txt", header=TRUE)

    dat2.3 <- read.table("SRR10401144.1_DSS_input.txt", header=TRUE)

    BSobj <- makeBSseqData( list(dat1.1, dat1.2, dat1.3,dat2.1, dat2.2,dat2.3),c("C1","C2","C3", "M1", "M2","M3") )

    dmlTest <- DMLtest(BSobj, group1=c("C1", "C2","C3"), group2=c("M1", "M2","M3"))

    dmls <- callDML(dmlTest, p.threshold=0.05)

    dmrs <- callDMR(dmlTest, p.threshold=0.05)

    相关文章

      网友评论

        本文标题:差异甲基化分析

        本文链接:https://www.haomeiwen.com/subject/ojjyhltx.html