plotPatterns {epigraHMM} | R Documentation |
'plotPatterns()' plots the posterior probabilities associated with differential patterns from a differential analysis of 'epigraHMM()'
plotPatterns( object, ranges, peaks, hdf5 = metadata(object)$output, colors = NULL )
object |
an epigraHMMDataSet |
ranges |
a GRanges object or a pair of integers with the genomic corrdinates/windows to be plotted |
peaks |
either a GRanges object or a vector of logicals (with length equal to the number of rows in 'object') specifying the genomic corrdinates/windows with peaks |
hdf5 |
a character string with the hdf5 file path from 'epigraHMM' |
colors |
an optional argument that specifies the colors for each differential combinatorial pattern |
A pheatmat
Pedro L. Baldoni, pedrobaldoni@gmail.com
https://github.com/plbaldoni/epigraHMM
# Creating dummy object countData <- cbind(rbind(matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 10, size = 5), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 10, size = 5), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1)), rbind(matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 10, size = 5), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1), matrix(rnbinom(1e2, mu = 10, size = 5), ncol = 1), matrix(rnbinom(1e2, mu = 1, size = 10), ncol = 1))) colData <- data.frame(condition = c('A','B'), replicate = c(1,1)) rowRanges <- GenomicRanges::GRanges('chrA', IRanges::IRanges(start = seq(1,by = 500, length.out = nrow(countData)),width = 500)) object <- epigraHMMDataSetFromMatrix(countData,colData,rowRanges = rowRanges) # Initializing object <- initializer(object,controlEM()) # Running epigraHMM object <- epigraHMM(object,controlEM(),type = 'differential',dist = 'nb') # Calling peaks peaks <- callPeaks(object = object, hdf5 = S4Vectors::metadata(object)$output, method = 'viterbi') # Plotting patterns plotPatterns(object, ranges = peaks[1], peaks = peaks)