Skip to content

inconsistent calculateDiffMeth results when re-ordering methylBase columns and swapping treatment 0/1 annotations #370

Description

@hd2326

Greetings!

Differences between code chunks were highlighted.

Case 1, new methylBase object, re-order columns:

dat1 <- getData(methylBase.obj)
dat1 <- dat1[, c(1:4, methylBase.obj@coverage.index, methylBase.obj@numCs.index, methylBase.obj@numTs.index)]
dat1 <- new("methylBase", as.data.frame(dat1),
sample.ids=c(paste("C", 1:2, sep=""), paste("N", 1:2, sep="")),
treatment=c(rep(1, 2), rep(0, 2)),
coverage.index=5:8,
numCs.index=9:12,
numTs.index=13:16,
assembly="simulation", context="simulation", destranded=F, resolution="base")
dat1 <- calculateDiffMeth(dat1, adjust="fdr")

Case 2, new methylBase object, without re-ordering:

dat2 <- getData(methylBase.obj)
dat2 <- new("methylBase", as.data.frame(dat2),
sample.ids=c(paste("C", 1:2, sep=""), paste("N", 1:2, sep="")),
treatment=c(rep(1, 2), rep(0, 2)),
coverage.index=methylBase.obj@coverage.index,
numCs.index=methylBase.obj@numCs.index,
numTs.index=methylBase.obj@numTs.index,
assembly="simulation", context="simulation", destranded=F, resolution="base")
dat2 <- calculateDiffMeth(dat2, adjust="fdr")

Case 3, new methylBase object, swap "treatment" 0/1 annotations:

dat3 <- getData(methylBase.obj)
dat3 <- new("methylBase", as.data.frame(dat3),
sample.ids=c(paste("C", 1:2, sep=""), paste("N", 1:2, sep="")),
treatment=c(rep(0, 2), rep(1, 2)),
coverage.index=methylBase.obj@coverage.index,
numCs.index=methylBase.obj@numCs.index,
numTs.index=methylBase.obj@numTs.index,
assembly="simulation", context="simulation", destranded=F, resolution="base")
dat3 <- calculateDiffMeth(dat3, adjust="fdr")

Case 4, control:

dat4 <- calculateDiffMeth(methylBase.obj, adjust="fdr")

Results:

Case 1 != Case 4

sum(dat1$pvalue != dat4$pvalue)
[1] 963
sum(dat1$qvalue != dat4$qvalue)
[1] 963

Case 2 == Case 4

sum(dat2$pvalue != dat4$pvalue)
[1] 0
sum(dat2$qvalue != dat4$qvalue)
[1] 0

Case 3 != Case 4

sum(dat3$pvalue != dat4$pvalue)
[1] 505
sum(dat3$qvalue != dat4$qvalue)
[1] 462

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions