unis2pseudomulti {chromstaR} | R Documentation

## Combine univariate HMMs to a multivariate HMM

### Description

Combine multiple `uniHMM`s to a `multiHMM` without running `callPeaksMultivariate`. This should only be done for comparison purposes.

### Usage

    unis2pseudomulti(hmms)

### Arguments

`hmms` | A named list of `uniHMM` objects. Names will be used to generate the combinations.

### Details

Use this function if you want to combine ChIP-seq samples without actually running a multivariate Hidden Markov Model. The resulting object will be of class `multiHMM` but will not be truly multivariate.

### Value

A `multiHMM` object.

### Author(s)

Aaron Taudt

### Examples

    # Get example BAM files for 2 different marks in hypertensive rat (SHR)
    file.path <- system.file("extdata","euratrans", package='chromstaRData')
    files <- list.files(file.path, full.names=TRUE, pattern='SHR.*bam$')[c(1,4)]
    # Bin the data
    data(rn4_chrominfo)
    binned.data <- list()
    for (file in files) {
     binned.data[[basename(file)]] <- binReads(file, binsizes=1000, stepsizes=500,
                                               assembly=rn4_chrominfo, chromosomes='chr12')
    }
    # Obtain the univariate fits
    models <- list()
    for (i1 in 1:length(binned.data)) {
     models[[i1]] <- callPeaksUnivariate(binned.data[[i1]], max.time=60, eps=1)
    }
    ## Combine the univariate HMMs without fitting a multivariate HMM
    names(models) <- c('H3K27me3','H3K4me3')
    pseudo.multi.HMM <- unis2pseudomulti(models)
    ## Compare frequencies with real multivariate HMM
    exp <- data.frame(file=files, mark=c("H3K27me3","H3K4me3"),
                     condition=rep("SHR",2), replicate=c(1,1), pairedEndReads=FALSE,
                     controlFiles=NA)
    states <- stateBrewer(exp, mode='combinatorial')
    real.multi.HMM <- callPeaksMultivariate(models, use.states=states, eps=1, max.time=60)
    genomicFrequencies(real.multi.HMM)
    genomicFrequencies(pseudo.multi.HMM)

[Package chromstaR version 1.20.2 Index]