al2na / methylKit

R package for DNA methylation analysis
https://bioconductor.org/packages/release/bioc/html/methylKit.html
203 stars 96 forks source link

Fix bioc R-devel build issue #309

Closed alexg9010 closed 7 months ago

alexg9010 commented 7 months ago

On 11.01.2024, 17:42 we received a mail from bioconductor that the build failed.

The build failed for all platforms and the logs show the same message:

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.19-bioc/R/bin/R CMD build --keep-empty-dirs --no-resave-data methylKit
###
##############################################################################
##############################################################################

* checking for file ‘methylKit/DESCRIPTION’ ... OK
* preparing ‘methylKit’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
* creating vignettes ... ERROR
--- re-building ‘methylKit.Rmd’ using rmarkdown

Quitting from lines 761-768 [unnamed-chunk-39] (methylKit.Rmd)
Error: processing vignette 'methylKit.Rmd' failed with diagnostics:
Stopping here.
--- failed re-building ‘methylKit.Rmd’

SUMMARY: processing the following file failed:
  ‘methylKit.Rmd’

Error: Vignette re-building failed.
Execution halted
alexg9010 commented 7 months ago

The build failed during rebuilding the vignette, failing at the following chunk:

https://github.com/al2na/methylKit/blob/388770da40bde7d563224cc5d2259c2a7a6a2e08/vignettes/methylKit.Rmd#L760-L768

The error message "Stoping here." comes from the readMethylDB function, indicating the tabix file contains no header:

https://github.com/al2na/methylKit/blob/388770da40bde7d563224cc5d2259c2a7a6a2e08/R/methylDBClasses.R#L1002-L1008

alexg9010 commented 7 months ago

Running the code chunk in R version 4.3.1 (2023-06-16) worked without any problems, but running in R Under development (unstable) (2024-01-09 r85796) failed:

> data(methylKit)
baseDB.obj <- makeMethylDB(methylBase.obj,"my/path")
> baseDB.obj <- makeMethylDB(methylBase.obj,"my/path")
mydbpath <- getDBPath(baseDB.obj)
rm(baseDB.obj)

methylKit:::checkTabixHeader(mydbpath)
readMethylDB(mydbpath)
compressing the file with bgzip...
making tabix index...
flatfile located at: my/path/methylBase_949590f63.txt.bgz
> mydbpath <- getDBPath(baseDB.obj)
> rm(baseDB.obj)
> 
> methylKit:::checkTabixHeader(mydbpath)
Could not read header of file my/path/methylBase_949590f63.txt.bgz
NULL
> readMethylDB(mydbpath)
No Tabix Header Found, 
Please provide tabix file with header created  from methylKit version >=1.13.1.
Error in readMethylDB(mydbpath) : Stopping here.
> 
alexg9010 commented 7 months ago

Further inspecting the checkTabixHeader function, we see that another function readTabixHeader is called.

https://github.com/al2na/methylKit/blob/388770da40bde7d563224cc5d2259c2a7a6a2e08/R/tabix.functions.R#L282-L292

https://github.com/al2na/methylKit/blob/388770da40bde7d563224cc5d2259c2a7a6a2e08/R/tabix.functions.R#L371-L399

Running this function directly, we see that isEmpty at line 391 is failing:

> methylKit:::readTabixHeader(mydbpath)
Error in FUN(X[[i]], ...) : 
  isEmpty() is not defined for objects of class NULL