read.bed: 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.
Value
A RangedData object, split into spaces by chromosome. This object has a "strand" data track.See the IRanges package vignette for more information.
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 "+"/"-".
References
UCSC BED format FAQ - http://genome.ucsc.edu/FAQ/FAQformat.html#format1