[BioC] combat error message

Peter Langfelder peter.langfelder at gmail.com
Thu May 15 18:49:41 CEST 2014


Your group and batch variables are dependent. All group "a" samples
are in batches 1,2,3, and all group "b" samples are in batches 4,5. It
is therefore impossible to tell whether a difference between groups
a[anything] and b[anything] are due to group differences or batch
differences, so ComBat cannot adjust for batch effect while preserving
differences between groups.

Mathematically, the linear model within ComBat does not have a unique
solution, which is manifested by the fact that the relevant matrix
cannot be inverted, and it produces the error you see ("system is
computationally singular").

Unfortunately, this is a problem of your experimental design and
there's no computational way around it (that I'm aware of). If the
groups "a" and "b" aren't truly different (i.e., a1 and b1 are
comparable etc.), you may be able to get by by combining the
corresponding a and b groups.

HTH,

Peter


On Thu, May 15, 2014 at 8:11 AM, Natasha [guest] <guest at bioconductor.org> wrote:
> Dear List,
>
> I have a microarray dataset with 30 samples which I have normalised using the vsn function.
>
> >From this data, clustering and PCA plots show that I appear to have chip and batch effects which I would like to account for using combat. However, when I try to account  for the batch effect, I get an error that I do not follow.
>
> The code I have used is below:
> =========
>> chip
> # 1 2 2 3 1 3 3 2 3 2 3 1 2 2 1 2 3 1 3 1 3 1 2 3 3 1 1 1 3 2
>> group
> # a_Cont   a_Cont   a_Cont   a_1 a_1 a_1 a_2 a_2 a_2 a_3 a_3 a_3 a_4   a_4   a_4   b_Cont b_Cont  b_Cont   b_1  b_1  b_1  b_2  b_2  b_2  b_3  b_3  b_3  b_4    b_4    b_4
> # Levels: a_Cont a_1 a_2 a_3 a_4 b_Cont b_1 b_2 b_3 b_4
>> mod = model.matrix(~as.factor(group))
>
>> combat.c = ComBat(dat=d.norm, batch=chip, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE)
> # Found 3 batches
> # Found 9  categorical covariate(s)
> # Standardizing Data across genes
> # Fitting L/S model and finding priors
> # Finding parametric adjustments
> # Adjusting the Data
>
> ### Combat to get rid of batch effect
>> day2
>  # 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5
>>mod #same as above
>
>> combat.b = ComBat(dat=combat.c, batch=day2, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE)
> # Found 5 batches
> # Found 9  categorical covariate(s)
> # Standardizing Data across genes
> ####### Error in solve.default(t(design) %*% design) :
> #######   system is computationally singular: reciprocal condition number = 7.93016e-18
> =========
>
> Any help much appreciated.
> (I do know that the R /BioC version is not the latest, but hoping that is not the case here!)
>
> Many Thanks,
> Natasha
>
>  -- output of sessionInfo():
>
> sessionInfo()
> # R version 3.0.2 (2013-09-25)
> # Platform: x86_64-apple-darwin10.8.0 (64-bit)
> #
> # locale:
> #   [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
> #
> # attached base packages:
> #   [1] parallel  stats     graphics  grDevices utils     datasets  methods   base
> #
> # other attached packages:
> #   [1] gplots_2.13.0         WriteXLS_3.5.0        limma_3.18.13         genefilter_1.44.0     sva_3.8.0             mgcv_1.7-29           nlme_3.1-117          corpcor_1.6.6
> # [9] ClassDiscovery_2.14.1 PreProcess_2.12.3     oompaBase_3.0.0       mclust_4.3            cluster_1.15.2        scatterplot3d_0.3-35  gdata_2.13.3          vsn_3.30.0
> # [17] Biobase_2.22.0        BiocGenerics_0.8.0
> #
> # loaded via a namespace (and not attached):
> #   [1] affy_1.40.0           affyio_1.30.0         annotate_1.40.1       AnnotationDbi_1.24.0  BiocInstaller_1.12.1  bitops_1.0-6          caTools_1.17          DBI_0.2-7
> # [9] grid_3.0.2            gtools_3.4.0          IRanges_1.20.7        KernSmooth_2.23-12    lattice_0.20-29       Matrix_1.1-3          preprocessCore_1.24.0 RSQLite_0.11.4
> # [17] splines_3.0.2         stats4_3.0.2          survival_2.37-7       tools_3.0.2           XML_3.95-0.2          xtable_1.7-3          zlibbioc_1.8.0
>
>
> --
> Sent via the guest posting facility at bioconductor.org.
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list