selectByOverlap-methods: selects records of methylDB objects lying inside a GRanges...

Description Usage Arguments Value Author(s) Examples

Description

The function selects records from any methylKit object that lie inside the regions given by ranges of class GRanges and returns an in-memory equivalent of this object

Usage

 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
selectByOverlap(object,ranges)

## S4 method for signature 'methylRaw,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylRawList,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylBase,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylDiff,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylRawDB,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylRawListDB,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylBaseDB,GRanges'
selectByOverlap(object, ranges)

## S4 method for signature 'methylDiffDB,GRanges'
selectByOverlap(object, ranges)

Arguments

object

an methylRaw,methylRawDB, methylRawList, methylRawListDB, methylBase, methylBaseDB, methylDiff or methylDiffDB object

ranges

a GRanges object specifying the regions of interest

Value

a methylBase,methylRaw, methylRawList or methylDiff object depending on the input object.

Author(s)

Alexander Gosdschan

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
data(methylKit)

file.list=list( system.file("extdata", "test1.myCpG.txt", package = "methylKit"),
                system.file("extdata", "test2.myCpG.txt", package = "methylKit"),
                system.file("extdata", "control1.myCpG.txt", package = "methylKit"),
                system.file("extdata", "control2.myCpG.txt", package = "methylKit") )

methylRawListDB.obj=methRead(file.list,
                         sample.id=list("test1","test2","ctrl1","ctrl2"),
                         assembly="hg18",treatment=c(1,1,0,0),
                         dbtype = "tabix",dbdir = "methylDB")

methylBaseDB.obj=unite(methylRawListDB.obj)

methylDiffDB.obj = calculateDiffMeth(methylBaseDB.obj)

# define the windows of interest as a GRanges object, this can be any set 
# of genomic locations
library(GenomicRanges)
my.win=GRanges(seqnames="chr21",
ranges=IRanges(start=seq(from=9764513,by=10000,length.out=20),width=5000) )

# selects the records that lie inside the regions
myRaw <- selectByOverlap(methylRawListDB.obj[[1]],my.win)

# selects the records that lie inside the regions
myBase <- selectByOverlap(methylBaseDB.obj,my.win)

# selects the records that lie inside the regions
myDiff <- selectByOverlap(methylDiffDB.obj,my.win)

# selects the records that lie inside the regions
myRaw2 <- selectByOverlap(methylRawList.obj[[1]],my.win)

# selects the records that lie inside the regions
myRawList2 <- selectByOverlap(methylRawList.obj,my.win)

# selects the records that lie inside the regions
myBase2 <- selectByOverlap(methylBase.obj,my.win)

# selects the records that lie inside the regions
myDiff2 <- selectByOverlap(methylDiff.obj,my.win)


rm(methylRawListDB.obj)
rm(methylBaseDB.obj)
rm(methylDiffDB.obj)
unlink("methylDB",recursive=TRUE)

qizhengyang2017/methylKit_1.8.1 documentation built on May 5, 2019, 7:58 p.m.