methylRawDB-class {methylKit} | R Documentation

## An S4 class for storing raw methylation data as flat file database.

### Description

This object stores the raw mehylation data that is read in through read function as flat file database.The raw methylation data is basically percent methylation values and read coverage values per genomic base/region.

### Slots

`dbpath`:

  path to flat file database

`num.records`:

  number of records (lines) in the object

`sample.id`:

  string for an identifier of the sample

`assembly`:

  string for genome assembly, ex: hg18,hg19,mm9

`context`:

  methylation context string, ex: CpG,CpH,CHH, etc.

`resolution`:

  resolution of methylation information, 'base' or 'region'

`dbtype`:

  string for type of the flat file database, ex: tabix

### Details

`methylRawDB` is created via `read` function and has the same functionality as `methylRaw` class, but the data is saved in a flat database file and therefore allocates less space in memory.

### Subsetting

In the following code snippets, `x` is a `methylRawDB`. Subsetting by `x[i,]` will produce a new `methylRaw` object if subsetting is done on rows. Column subsetting is not directly allowed to prevent errors in the downstream analysis. see ?methylKit[ . `x[]` will return the `methylRawDB` object as new `methylRaw` object

### Accessors

The following functions provides access to data slots of methylDiffDB: - `getData`: get the data slot from the methylKit objects, - `getAssembly`: get assembly of the genome, - `getContext`: get the context of methylation

### Coercion

`methylRawDB` object can be coerced to: `GRanges` object via `as` function. `methylRaw` object via `as` function.

### Examples

    # example of a raw methylation data contained as a text file
    read.table(system.file("extdata", "control1.myCpG.txt", package = "methylKit"),
    header=TRUE,nrows=5)

    methylRawDB.obj <- methRead(
    system.file("extdata", "control1.myCpG.txt", package = "methylKit"),
                            sample.id = "ctrl1", assembly = "hg18",
                            dbtype = "tabix", dbdir = "methylDB")

    # example of a methylRawDB object
    methylRawDB.obj
    str(methylRawDB.obj)

    library(GenomicRanges)

    #coercing methylRawDB object to GRanges object
    my.gr=as(methylRawDB.obj,"GRanges")

    #coercing methylRawDB object to methylRaw object
    myRaw=as(methylRawDB.obj,"methylRaw")

    # remove Database again
    rm(methylRawDB.obj)
    unlink("methylDB",recursive=TRUE)

[Package methylKit version 1.18.0 Index]