ComBat --- Got it working for some variables but not others?!
1
0
Entering edit mode
@celine-bourdon-6621
Last seen 9.1 years ago
Canada
Hi all (especially (maybe) to Evan or Evan-LAB-People.. haha) ... I am trying to run ComBat to correct my methylation data for batch (which are 11 Slides) and other covariates. But to illustrate the problem i reduced the model to it's simplest and picked 2 variables, one that works and one that does not. ComBat WORKs for logBF (Body Fat) variable model <-model.matrix(~logBF, data=phenoData) cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide, mod= model, numCovs=NULL, par.prior =TRUE) ComBat does NOT WORK for logVF (Visceral Fat) variable model <-model.matrix(~logBF, data=phenoData) cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide, mod= model, numCovs=NULL, par.prior =TRUE) I get the following error: Found 11 batches Found 1 categorical covariate(s) Standardizing Data across genes Error in solve.default(t(design) %*% design) : system is computationally singular: reciprocal condition number = 2.2124e-18 I run the exact same script for both variables, on the exact same Mvalue dataset. Both variables are quite similar,... and to me seem similarly distributed between batches but ... maybe someone has more experience looking at this... and will tell me other wise? I include here a correlation matrix between the 2 variables and Batch... Is my visceral fat (VF) to be considered more "confounded" with batch then my Body FAt variable (BF) or my BMI? Please see attached image. These are 2 example variables, I actually have in total 3 variables that work, and 4 that don't. Any other input, ideas, would be very very welcome as i have been on this issue for a longtime now. I tried to illustrate things as best i could, any help will be very appreciated, thanks a lot! c -------------- next part -------------- A non-text attachment was scrubbed... Name: Correlation_MAtrix_Batch-Variables.png Type: image/png Size: 715277 bytes Desc: not available URL: <https: stat.ethz.ch="" pipermail="" bioconductor="" attachments="" 20140619="" 909f31a2="" attachment-0001.png="">
• 1.1k views
ADD COMMENT
0
Entering edit mode
@peter-langfelder-4469
Last seen 19 days ago
United States
On Thu, Jun 19, 2014 at 12:36 PM, Celine Bourdon <cbourdon at="" gmail.com=""> wrote: > Hi all > (especially (maybe) to Evan or Evan-LAB-People.. haha) ... I am trying to > run ComBat to correct my methylation data for batch (which are 11 Slides) > and other covariates. > > But to illustrate the problem i reduced the model to it's simplest and > picked 2 variables, one that works and one that does not. > > ComBat WORKs for logBF (Body Fat) variable > model <-model.matrix(~logBF, data=phenoData) > cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide, mod= > model, numCovs=NULL, par.prior =TRUE) > > ComBat does NOT WORK for logVF (Visceral Fat) variable > model <-model.matrix(~logBF, data=phenoData) You seem to have a type here - did you mean ~logVF above? > cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide, mod= > model, numCovs=NULL, par.prior =TRUE) > > I get the following error: > Found 11 batches > Found 1 categorical covariate(s) > Standardizing Data across genes > Error in solve.default(t(design) %*% design) : > system is computationally singular: reciprocal condition number = > 2.2124e-18 In both cases, unless your fat variables are categorical (and they seem to be coninuous), you need to specify numCovs = 1 in the call to ComBat. Here's what the help file says: numCovs: The column numbers of the variables in mod to be treated as continuous variables (otherwise all covariates are treated as factors) ComBat may have succeeded in the first case because your logBF may have repeated values whereas logVF does not... not sure. Either way, treating the covariate as a factor makes no sense. HTH, Peter
ADD COMMENT
0
Entering edit mode
HI Peter!!! I very very very much appreciated the reply!! I had not realised that the variable of "interest" was to be included in numCovs, I had assumed this only to relate to "other" covariates... The code now works! and this saved me from making a huge mistake in assuming it was working when it was not. Again thanks! and that SDH (Sure Did Help) cheers, celine 2014-06-20 2:04 GMT-04:00 Peter Langfelder <peter.langfelder@gmail.com>: > On Thu, Jun 19, 2014 at 12:36 PM, Celine Bourdon <cbourdon@gmail.com> > wrote: > > Hi all > > (especially (maybe) to Evan or Evan-LAB-People.. haha) ... I am trying > to > > run ComBat to correct my methylation data for batch (which are 11 Slides) > > and other covariates. > > > > But to illustrate the problem i reduced the model to it's simplest and > > picked 2 variables, one that works and one that does not. > > > > ComBat WORKs for logBF (Body Fat) variable > > model <-model.matrix(~logBF, data=phenoData) > > cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide, > mod= > > model, numCovs=NULL, par.prior =TRUE) > > > > ComBat does NOT WORK for logVF (Visceral Fat) variable > > model <-model.matrix(~logBF, data=phenoData) > > You seem to have a type here - did you mean ~logVF above? > > > cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide, > mod= > > model, numCovs=NULL, par.prior =TRUE) > > > > I get the following error: > > Found 11 batches > > Found 1 categorical covariate(s) > > Standardizing Data across genes > > Error in solve.default(t(design) %*% design) : > > system is computationally singular: reciprocal condition number = > > 2.2124e-18 > > In both cases, unless your fat variables are categorical (and they > seem to be coninuous), you need to specify > > numCovs = 1 > > in the call to ComBat. Here's what the help file says: > > numCovs: The column numbers of the variables in mod to be treated as > continuous variables (otherwise all covariates are treated as > factors) > > ComBat may have succeeded in the first case because your logBF may > have repeated values whereas logVF does not... not sure. Either way, > treating the covariate as a factor makes no sense. > > HTH, > > Peter > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 768 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