read.bed {BayesPeak} | R Documentation

## BayesPeak - Bayesian analysis of ChIP-seq data

### Description

Read a .bed file into a data frame, but only the chr, start, end and strand columns.

### Usage

    read.bed(filename, chr)

### Arguments

`filename` | Character - The path to the .bed file in question.
`chr` | Character vector, specifying which chromosomes to read in. Chromosome names must be specified exactly as they appear in the .bed files. If `chr` is missing, then `read.bed` will read in the entire data set.

### Details

The purpose of this function is to extract 4 columns from a bed file: chromosome, start, end and strand. These are assumed to be in columns 1, 2, 3 and 6 respectively.

If the first line begins with "track" then it will be skipped.

The strand sense is expected to be given as "+"/"-".

### Value

A RangedData object, split into spaces by chromosome. This object has a "strand" data track.

See the IRanges package vignette for more information.

### Author(s)

Jonathan Cairns

### References

UCSC BED format FAQ - http://genome.ucsc.edu/FAQ/FAQformat.html#format1

### See Also

`bayespeak`.

### Examples

    dir <- system.file("extdata", package="BayesPeak")
    file <- file.path(dir, "H3K4me3reduced.bed")

    treatment <- read.bed(file)
    treatment

[Package BayesPeak version 1.34.0 Index]