methylRawDB-class: An S4 class for storing raw methylation data as flat file...

Description Slots Details Subsetting Accessors Coercion Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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)

methylKit documentation built on Jan. 30, 2021, 2 a.m.