writeBED {BiSeq} | R Documentation

## Writes `BSraw` and `BSrel` data to a bed file suitable for the IGV

### Description

The created bed files contains an entry for each CpG site. Strand information, relative methylation and absolute number of reads covering the CpG sites are stored. The relative methylation is indicated by colors: green via black to red for unmethylated to methylated.

### Usage

    writeBED(object, name, file)

### Arguments

`object` | A `BSraw` or `BSrel` object.
`name` | Track names (sample names) written to the bed file's header.
`file` | Character vector with names of the bed file.

### Details

The written bed file contains the following extra information:

1. score: the relative methylation of the CpG site

2. name: the coverage of the CpG site

3. itemRgb: a color value visualizing the methylation score

A separate bed file is created for each sample in the given object. The lengths of the arguments `name` and `file` should equal the number of samples.

### Value

Nothing. Bed files are written.

### Author(s)

Hans-Ulrich Klein

### See Also

`readBismark`

### Examples

    data(rrbs)
    s1 <- rrbs[,1]
    out <- tempfile(, fileext = ".bed")
    writeBED(s1, name = colnames(s1), file = out)

[Package BiSeq version 1.34.0 Index]