loadHmmsFromFiles: Load 'chromstaR' objects from file

Description Usage Arguments Value Examples

View source: R/loadHmmsFromFiles.R

Description

Wrapper to load chromstaR objects from file and check the class of the loaded objects.

Usage

1
2
3
4
loadHmmsFromFiles(
  files,
  check.class = c("GRanges", "uniHMM", "multiHMM", "combinedMultiHMM")
)

Arguments

files

A list of chromstaR-objects or a vector of files that contain such objects.

check.class

Any combination of c('GRanges', 'uniHMM', 'multiHMM', 'combinedMultiHMM'). If any of the loaded objects does not belong to the specified class, an error is thrown.

Value

A list of chromstaR-object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Get an example BAM file
file <- system.file("extdata", "euratrans",
                      "lv-H3K27me3-BN-male-bio2-tech1.bam",
                       package="chromstaRData")
## Bin the file into bin size 1000bp
data(rn4_chrominfo)
binned <- binReads(file, assembly=rn4_chrominfo, binsizes=1000,
                  stepsizes=500, chromosomes='chr12')
## Fit the univariate Hidden Markov Model
hmm <- callPeaksUnivariate(binned, max.time=60, eps=1)
temp.file <- tempfile()
save(hmm, file=temp.file)
loaded.hmm <- loadHmmsFromFiles(temp.file)[[1]]
class(loaded.hmm)

ataudt/chromstaR documentation built on Dec. 26, 2021, 12:07 a.m.