bedgraph-methods: Get bedgraph from methylRaw, methylRawList and methylDiff...

Description Usage Arguments Value Examples

Description

The function converts methylRaw, methylRawList or methylDiff object into a bedgraph format. It either writes as a file or returns a data.frame

Usage

1
  bedgraph(methylObj,file.name=NULL,col.name,unmeth=FALSE,log.transform=FALSE,negative=FALSE,add.on="")

Arguments

methylObj

a methylRaw or methlRawList object

file.name

Default: NULL. if a string is given a bedgraph file will be written, if NULL a data.frame or a list of data frames will be returned

col.name

name of the column in methylRaw, methylRawList or methylDiff objects to be used as a score for the bedgraph. For methylDiff, col.name must be one of the following 'pvalue','qvalue', 'meth.diff'. For methylRaw and methylRawList it must be one of the following 'coverage', 'numCs','numTs', 'perc.meth'

unmeth

when working with methylRaw or methylRawList objects should you output unmethylated C percentage this makes it easier to see the unmethylated bases because their will be zero. Only invoked when file.name is not NULL.

log.transform

Default FALSE, If TRUE the score column of the bedgraph wil be in log10 scale. Ignored when col.name='perc.meth'

negative

Default FALSE, If TRUE, the score column of the bedgraph will be multiplied by -1. Ignored when col.name='perc.meth'

add.on

additional string to be add on the track line of bedgraph. can be viewlimits,priority etc. Check bedgraph track line options at UCSC browser

Value

Returns a data.frame or list of data.frames if file.name=NULL, if a file.name given appropriate bed file will be written to that file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(methylKit)

# getting a bedgraph file from a methylDiff object containing differential methylation percentages
bedgraph(methylDiff.obj,file.name="test.bed",col.name="meth.diff",unmeth=FALSE,log.transform=FALSE,negative=FALSE,add.on="")

# remove the file
unlink("test.bed")

# getting a bedgraph file from a methylBase object containing percent methylation values
bedgraph(methylRawList.obj[[1]],file.name="test2.bed",col.name="perc.meth",unmeth=FALSE,log.transform=FALSE,negative=FALSE,add.on="")

unlink("test2.bed") # remove the file

fortunatobianconi/methylkit documentation built on May 16, 2019, 1:51 p.m.