compgenomr / book

http://compgenomr.github.io/book
325 stars 282 forks source link

Error in validObject(.Object) : invalid class "ScoreMatrix" object: superclass "mMatrix" not defined in the environment of the object's class #71

Open danli349 opened 6 months ago

danli349 commented 6 months ago

Hello

The code of line 530-558 in the 06-genomicIntervals.Rmd can't run successfully:

# get transcription start sites on chr20
library(genomation)
transcriptFile=system.file("extdata",
                      "refseq.hg19.chr20.bed",
                      package="compGenomRData")
feat=readTranscriptFeatures(transcriptFile,
                            remove.unusual = TRUE,
                            up.flank = 500, down.flank = 500)
prom=feat$promoters # get promoters from the features

# get for H3K4me3 values around TSSes
# we use strand.aware=TRUE so - strands will
# be reversed
H3K4me3File=system.file("extdata",
                      "H1.ESC.H3K4me3.chr20.bw",
                      package="compGenomRData")
sm=ScoreMatrix(H3K4me3File, prom,
               type="bigWig", strand.aware = TRUE)
Error in validObject(.Object) : 
  invalid class "ScoreMatrix" object: superclass "mMatrix" not defined in the environment of the object's class

How should I solve this? Thanks

wmorgan485 commented 4 months ago

Installation of developmental version was recommended here: https://github.com/BIMSBbioinfo/genomation/issues/209

Bioconductor says that to install the developmental package, start R (version "4.4") and enter:

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

# The following initializes usage of Bioc devel
BiocManager::install(version='devel')

BiocManager::install("genomation")