loadHmmsFromFiles {chromstaR} | R Documentation

## Load chromstaR objects from file

### Description

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

### Usage

    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

    ## 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)

[Package chromstaR version 1.6.2 Index]