Description Slots Details Subsetting Accessors Coercion Examples
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.
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
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.
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
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
methylRawDB
object can be coerced to:
GRanges
object via as
function.
methylRaw
object via as
function.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.