Errors and warnings in variancePartition are mostly designed to let the user know that there is an isssue with the model. Note that some of these warnings and errors can be overridden by specifying suppressWarnings=TRUE for dream() and showWarnings=FALSE for fitExtractVarPartModel() and fitVarPartModel().

Here is a guide to interperting interpreting warnings and errors from variancePartition and dream. Note that some of the document can be found in “1) Tutorial on using variancePartition”.

Current GitHub issues

See GitHub page for up-to-date responses to users’ questions.



Errors: Problems removing samples with NA/NaN/Inf values

variancePartition fits a regression model for each gene and drops samples that have NA/NaN/Inf values in each model fit. This is generally seamless but can cause an issue when a variable specified in the formula no longer varies within the subset of samples that are retained. Consider an example with variables for sex and age where age is NA for all males samples. Dropping samples with invalid values for variables included in the formula will retain only female samples. This will cause variancePartition to throw an error because there is now no variation in sex in the retained subset of the data. This can be resolved by removing either age or sex from the formula.

This situtation is indicated by the following errors:

  • Error: grouping factors must have > 1 sampled level

  • Error: Invalid grouping factor specification, Individual

  • Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]): contrasts can be applied only to factors with 2 or more levels

  • Error in checkNlevels(reTrms\$flist, n = n, control): grouping factors must have > 1 sampled level

Errors with BiocParallel multithreading backend

  • Error: 'bpiterate' receive data failed: error reading from connection

  • Error in serialize(data, node$con, xdr = FALSE) : ignoring SIGPIPE signal

    variancePartition uses the BiocParallel package to run analysis in parallel across multiple cores. If there is an issue with the parallel backend you might see these errors. This often occurs in long interactive sessions, or if you manually kill a function running in parallel. There are two ways to address this issue.

    • Global: set the number of threads to be a smaller number. I have found that reducing the number of threads reduces the chance of random failures like this.

      # globally specify that all multithreading using bpiterate from BiocParallel
      # should use 8 cores
    • Local: set the number of theads at each function call. This re-initializes the parallel backend and should address the error

      fitExtractVarPartModel(..., BPPARAM=SnowParam(8))
      fitVarPartModel(..., BPPARAM=SnowParam(8))
      dream(..., BPPARAM=SnowParam(8))