[BioC] ComBat --- Got it working for some variables but not others?!

Peter Langfelder peter.langfelder at gmail.com
Fri Jun 20 08:04:22 CEST 2014


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



More information about the Bioconductor mailing list