|
| 1 | +\name{MethylCounts-class} |
| 2 | +\Rdversion{1.1} |
| 3 | +\docType{class} |
| 4 | +\alias{MethylCounts-class} |
| 5 | +\alias{show,MethylCounts-method} |
| 6 | +\alias{getMethylCounts} |
| 7 | +\alias{MethylCounts} |
| 8 | +\title{Class MethylCounts} |
| 9 | +\description{ |
| 10 | + A class for representing whole-genome or capture sequencing |
| 11 | + methylation data. |
| 12 | +} |
| 13 | +\section{Objects from the Class}{ |
| 14 | + An object from the class links together several pieces of information. |
| 15 | + (1) genomic locations stored as a \code{GRanges} object, a location by |
| 16 | + samples matrix of M values, a location by samples matrix of Cov |
| 17 | + (coverage) values, a location by samples matrix of Filtered (ambiguous |
| 18 | + modification status) values, and phenodata information.In addition, |
| 19 | + there are slots for representing smoothed data. This class is an |
| 20 | + extension of \link[SummarizedExperiment]{RangedSummarizedExperiment} |
| 21 | + from the \pkg{SummarizedExperiment} package. |
| 22 | +} |
| 23 | +\section{Slots}{ |
| 24 | + In addition to the slots from \code{RangedSummarizedExperiment} we have |
| 25 | + \describe{ |
| 26 | + \item{\code{parameters}:}{Object of class \code{list}. A list of |
| 27 | + parameters representing for example how the data was smoothed.} |
| 28 | + } |
| 29 | +} |
| 30 | +\section{Methods}{ |
| 31 | + \describe{ |
| 32 | + \item{show}{The show method.} |
| 33 | + } |
| 34 | +} |
| 35 | +\usage{ |
| 36 | + MethylCounts(M = NULL, U = NULL, H = NULL, D = NULL, |
| 37 | + gr = NULL, pos = NULL, chr = NULL, |
| 38 | + colData = NULL, sampleNames = NULL, |
| 39 | + parameters = NULL, rmZeroCov = FALSE) |
| 40 | + |
| 41 | + getMethylCounts(MethylCounts, |
| 42 | + type = c("M", "U", "H", "D", "Cov", "gr", "parameters"), |
| 43 | + withDimnames = TRUE) |
| 44 | +} |
| 45 | +\arguments{ |
| 46 | + \item{M}{A matrix-like object of M values (see 'Details' below).} |
| 47 | + \item{U}{A matrix-like object of U values (see 'Details' below).} |
| 48 | + \item{H}{An optional matrix-like object of H values (see 'Details' |
| 49 | + below).} |
| 50 | + \item{D}{An optional matrix-like object of D values (see 'Details' below).} |
| 51 | + \item{gr}{An object of type \code{\link[GenomicRanges]{GRanges}}.} |
| 52 | + \item{pos}{A vector of locations.} |
| 53 | + \item{chr}{A vector of chromosomes.} |
| 54 | + \item{colData}{Typically a \code{DataFrame} with sample |
| 55 | + coveriates. See the documentation for \code{SummarizedExperiment}.} |
| 56 | + \item{sampleNames}{A character vector of sample names.} |
| 57 | + \item{parameters}{A list of parameters, for record-keeping.} |
| 58 | + \item{rmZeroCov}{\code{logical(1)}. Remove loci with zero coverage} |
| 59 | + \item{MethylCounts}{An object of class \code{MethylCounts}.} |
| 60 | + \item{type}{What should be extracted from the object?} |
| 61 | + \item{withDimnames}{\code{logical(1)}. Should dimnames be added to the |
| 62 | + output when relevent?} |
| 63 | +} |
| 64 | +\section{Details}{ |
| 65 | + The \code{M}, \code{U}, \code{H}, and \code{D} matrix-like objects will be |
| 66 | + coerced to \code{\link[DelayedArray]{DelayedMatrix}} objects; see |
| 67 | + \code{\link[DelayedArray]{DelayedMatrix}} in the \pkg{DelayedArray} |
| 68 | + package for the full list of supported matrix-like objects. We |
| 69 | + recommend using \link[base]{matrix} objects for in-memory storage of |
| 70 | + data and \code{\link[HDF5Array]{HDF5Matrix}} for on-disk storage of |
| 71 | + data. These objects should have the same dimension and be integer-values. |
| 72 | + |
| 73 | + \code{M}, \code{U} are required methylation and 'unmethylation' |
| 74 | + values. \code{H} is optional hydroxymethylation values. \code{D} |
| 75 | + represents addition coverage for a loci, but where the data supports |
| 76 | + neither M, U nor H. |
| 77 | + |
| 78 | + The argument \code{rmZeroCov} may be useful in order to reduce the |
| 79 | + size of the return object be removing methylation loci with zero |
| 80 | + coverage. |
| 81 | + |
| 82 | + \code{pos} and \code{chr} can be supplied instead of \code{gr}. |
| 83 | +} |
| 84 | +\section{Utilities}{ |
| 85 | + This class extends |
| 86 | + \link[SummarizedExperiment]{RangedSummarizedExperiment} |
| 87 | + from the \pkg{SummarizedExperiment} package and therefore |
| 88 | + inherits a number of useful \code{GRanges} methods that operate on the |
| 89 | + \code{rowRanges} slot, used for accessing and setting the genomic locations |
| 90 | + and also do \code{subsetByOverlaps}. |
| 91 | + |
| 92 | + There are a number of almost methods-like functions for operating on |
| 93 | + objects of class \code{MethylCounts}, including |
| 94 | + \code{getMethylCounts}. They are detailed below. |
| 95 | + |
| 96 | + \describe{ |
| 97 | + \item{\code{getMethylCounts(MethylCounts, type, withDimnames)}}{ |
| 98 | + A general accessor: is used to obtain a specific slot of an object of |
| 99 | + class \code{MethylCounts}.} |
| 100 | + } |
| 101 | +} |
| 102 | +\author{ |
| 103 | + Kasper Daniel Hansen \email{khansen@jhsph.edu} |
| 104 | +} |
| 105 | +\seealso{ |
| 106 | + The package vignette. |
| 107 | + \code{\link[SummarizedExperiment]{RangedSummarizedExperiment}} |
| 108 | + (in the \pkg{SummarizedExperiment} package) for the underlying class. |
| 109 | +} |
| 110 | +\examples{ |
| 111 | +M <- matrix(1:9, 3,3) |
| 112 | +colnames(M) <- c("A1", "A2", "A3") |
| 113 | +MCtest <- MethylCounts(pos = 1:3, |
| 114 | + chr = c("chr1", "chr2", "chr1"), |
| 115 | + M = M, U = M + 2) |
| 116 | + |
| 117 | +#------------------------------------------------------------------------------- |
| 118 | +# An example using a HDF5-backed MethylCounts object |
| 119 | +# |
| 120 | +hdf5_NCtest <- realize(MCtest, "HDF5Array") |
| 121 | +} |
| 122 | +\keyword{classes} |
0 commit comments