I am working with 450K methylation data and have a genomic ratio set object (GRset)
I have a design matrix as such using
design <- model.matrix(~0+Mutation+cov1+cov2+cov3, data = pData(GRset))
head(design)
Absent Present cov1 cov2.1 cov2.2 cov2.3 cov3
sample1 1 0 0 0 1 0 0.5276
sample2 1 0 0 0 1 0 0.4623
sample3 1 0 1 0 0 0 0.6853
sample4 1 0 0 0 0 0 0.7665
sample5 1 0 0 0 0 1 0.4931
sample6 1 0 1 0 0 0 0.7258
and a contrasts matrix as such
Contrasts
Levels Present - Absent
Absent -1
Present 1
cov1 0
cov2.1 0
cov2.2 0
cov2.3 0
cov3 0
The covariate/comparison of interest is samples with an mutation of interest (present) and those without said mutation (Absent) but I want to factor in some other covariates that affect variation in methylation (one with 2 levels, one with 4 levels, and one continuous)
I have used limma to identify DMPs using these matrices successfully (I think)
I want to use the bumhunter method in minfi to look for DMRs but there is no contrast matrix specified in the function as in can see in the minfi user guide
the closest I can find is the coef argument, which is an 'An integer denoting the column of the design matrix containing the covariate of interest. The hunt for bumps will be only be done for the estimate of this coefficient.'
But my design matrix contains two columns describing my covariate of interest (Absent and Present) so which coef should I specify (1 or 2?). I tried specifcying coef = c(1,2) but this threw up an error
[bumphunterEngine] Using a single core (backend: doSEQ, version: 1.5.2).
[bumphunterEngine] Computing coefficients.
Error in S %*% vv : non-conformable arguments
should I do a new design matrix with an intercept column (design2 <- model.matrix(~Mutation+cov1...)) so that absent/present is a single column (coef = 2, presumably)
If I specify e.g. coef=1 or coef=2 how should I interpret the output of bumphunter
0 answers
No answers yet.
Log in to answer this question.
Hi,
I am wondering did you figure it out? I have the same problem.
Thanks!
Hey,
Apologies, it's been a while since I was working on this and it didn't yield many results so I haven't got a clear memory. looking back at my scripts it seems I did do this
like this:
This did seem to produce a result
this is from the user guide if it's helpful:
Note that the function permits the matrix X to have more than two columns. This can be useful for those wanting to fit models that try to adjust for confounders, such as age and sex. However, when X has columns other than those representing an intercept term and the covariate of interest, the permutation test approach is not recommended. The function will run but give a warning. A method based on the bootstrap for linear models of Efron and Tibshirani [1] may be more appropriate but this is not currently implemented.