Differential Methylation Analysis using continuous outcome
2
1
Entering edit mode
6.0 years ago
daniellemo ▴ 10

Hi there,

I am trying to do a differential methylation analysis of probes in R using "days to death" as my clinical factor. I have values ranging from 9 to 3258 days and need to make contrasts between these values, but there are too many values to do this manually. Is there a automatic way to contrast a wide range of continuous values? If not, can I specify ranges (i.e. 0-500, 501-1000 days, etc.) and input this into the "makecontrasts" function (not sure how to go about doing this). Below is the code I am using.

outcome <- factor(targets$days_to_death)
design <- model.matrix(~0+outcome, data=targets)
colnames(design) <- c(levels(outcome))
fit <- lmFit(MVals_d2d, design)
contMatrix <- makeContrasts(**?????**,
                       levels=design)
fit2 <- contrasts.fit(fit, contMatrix)
fit2 <- eBayes(fit2)
summary(decideTests(fit2))
ann450kSub <- ann450k[match(rownames(mVals),ann450k$Name),
                  c(1:4,12:19,24:ncol(ann450k))]
DMPs <- topTable(fit2, coef=NULL, adjust.method="fdr", p.value=0.05, genelist=ann450kSub)

Thank you in advance.

differential methylation makecontrasts continuous • 1.9k views
ADD COMMENT
2
Entering edit mode
5.9 years ago

You could encode targets$days_to_death as a categorical variable with 500 (0-500), 1000 (501-1000), 1500 (1001-1500), et cetera, and then your contrasts would be, for example:

makeContrasts(1000-500, levels=design)
makeContrasts(1500-500, levels=design)
*et cetera*

If you need help to categorise your targets$days_to_death, then use symnum() (stats):

input <- c(0,1,2,3,4,5,6,7,8,9,10)
cuts <- c(0, 2.5, 5, 7.5, 10)
encoding <- c('<=2.5', '<=5', '<=7.5', '<=10')

c(stats::symnum(input,
  corr = FALSE,
  na = FALSE,
  cutpoints = cuts,
  symbols = encoding))

 [1] <=2.5 <=2.5 <=2.5 <=5   <=5   <=5   <=7.5 <=7.5 <=10  <=10  <=10

Kevin

ADD COMMENT
1
Entering edit mode
5.9 years ago

It looks like you are fairly familiar with R, which is great!

If you already have a solution, I wouldn't worry too much about this answer.

If not, here are a couple pointers:

1) You can do continuous variable analysis in COHCAP (with the COHCAP.site() and COHCAP.avg.by.island() functions) by setting ref="continuous"

The delta-beta (or delta percent methylation) threshold is a little tricker to define in this situation, but you can play around with the lower.cont.quantile and upper.cont.quantile values.

I think I've only tested it with one or two projects, but setting alt.pvalue = "RcppArmadillo.fastLmPure" should noticeably speed up the analysis.

2) Even if you don't use COHCAP directly, you can use the COHCAP code to see how this analysis is performed.

For example, the code is fairly long for the COHCAP.site() function, but the smaller functions used various analyses are towards the top: https://github.com/cwarden45/COHCAP/blob/master/R/COHCAP.site.R

ADD COMMENT

Login before adding your answer.

Traffic: 1480 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6