Learn R Programming

CNEr (version 1.8.3)

readBed: readBed

Description

Read the coordiantes information from a bed file.

Usage

readBed(bedFile)

Arguments

bedFile
The character(1) file name of the 'bed' file to read.

Value

A GRanges is returned. When no strand information is availabe in bed file, all the ranges are assumed to be on the positive strand.

Details

This function is designed to read the bed file for the first three columns, i.e., "chrom", "chromStart", "chromEnd". The strand information is also stored when available. In bed file, the "chromStart" is on 0-based coordinate while "chromEnd" is on 1-based coordinate. For example, the first 100 bases of a chromosome are defined as "chromStart"=0, "chromEnd"=100, and span the bases numbered 0-99. When it is read into GRanges, both the chromStart and chromEnd are on 1-based coordinate, i.e., "chromStart"=1 and "chromEnd"=100.

References

https://genome.ucsc.edu/FAQ/FAQformat.html#format1

See Also

import.bed

Examples

Run this code
  bedHg19Fn <- file.path(system.file("extdata", package="CNEr"), 
                         "filter_regions.hg19.bed")
  bedHg19 <- readBed(bedHg19Fn)

Run the code above in your browser using DataLab