hbc / bcbioRNASeq

R package for bcbio RNA-seq analysis.
https://bioinformatics.sph.harvard.edu/bcbioRNASeq
GNU Affero General Public License v3.0
58 stars 21 forks source link

Error running RMarkdown templates #140

Closed kokyriakidis closed 4 years ago

kokyriakidis commented 4 years ago

In the QC template I get an error when it tries to run

plotMeanSD(object)

Commenting this line runs the report fine.

In the DGE template I get an error when it tries to run

design(dds) <- params$design

It throws

Error in validObject(object) : invalid class "DESeqDataSet" object: all variables in design formula must be columns in colData

I used the bcb.rda file located in the data folder in this repo.

mjsteinbaugh commented 4 years ago

Hi @kokyriakidis, try running this code and see if the plot renders:

library(bcbioRNASeq)
data(bcb, package = "bcbioRNASeq")
plotMeanSD(bcb)

And to double check, which version of bcbioRNASeq are you using?

packageVersion("bcbioRNASeq")
## [1] '0.3.29'

I think you're hitting an error with the DESeq2 template because you haven't set the design in the YAML params at the top of the R Markdown correctly. Look for this part:

  ## Design formula must contain columns defined in `colData()`.
  design: !r formula("~ group")

You can specify any type of DESeq design formula there, as long as it matches the metadata in colData(dds). Refer to the DESeq2 vignette for details on how this works. Here are some examples:

mjsteinbaugh commented 4 years ago

Also for debugging the plotMeanSD() error, try setting these options before running that function and post the error message in the thread:

# requires rlang package to be installed
options(
    "error" = quote(rlang::entrace()),
    "rlang_backtrace_on_error" = "full",
    "rstudio.errors.suppressed" = FALSE
)
kokyriakidis commented 4 years ago
> packageVersion("bcbioRNASeq")
[1] '0.3.29'

Still get an error at plotMeanSD()

> options(
+     "error" = quote(rlang::entrace()),
+     "rlang_backtrace_on_error" = "full",
+     "rstudio.errors.suppressed" = FALSE
+ )
> 
> data(bcb, package = "bcbioRNASeq")
> 
> plotMeanSD(bcb)
Error in .local(object, ...) : Assert failure.
[1] requireNamespace("vsn", quietly = TRUE) is not TRUE.
<error/rlang_error>
Assert failure.
[1] requireNamespace("vsn", quietly = TRUE) is not TRUE.
Backtrace:
    █
 1. ├─bioverbs::plotMeanSD(bcb)
 2. └─bcbioRNASeq::plotMeanSD(bcb)
 3.   └─bcbioRNASeq:::.local(object, ...)
 4.     └─goalie::assert(...)
<parent: error/simpleError>
Assert failure.
[1] requireNamespace("vsn", quietly = TRUE) is not TRUE.
mjsteinbaugh commented 4 years ago

Ah okay you need to install the vsn package:

BiocManager::install("vsn")
mjsteinbaugh commented 4 years ago

@kokyriakidis I'm closing this issue due to inactivity. If the recommendation above didn't work, please comment and I'll reopen.