importBed: Read bed-file into GRanges

Description Usage Arguments Value Author(s) Examples

View source: R/bedimport.R

Description

This is a simple convenience function to read a bed(.gz)-file into a GRanges-class object. The bed-file is expected to have the following fields: chromosome, start, end, name, score, strand.

Usage

1
importBed(bedfile, skip = 0, chromosome.format = "NCBI")

Arguments

bedfile

Filename of the bed or bed.gz file.

skip

Number of lines to skip at the beginning.

chromosome.format

Desired format of the chromosomes. Either 'NCBI' for (1,2,3 ...) or 'UCSC' for (chr1,chr2,chr3 ...).

Value

A GRanges-class object with the contents of the bed-file.

Author(s)

Aaron Taudt

Examples

1
2
3
4
## Get an example BED file with single-cell-sequencing reads
bedfile <- system.file("extdata", "KK150311_VI_07.bam.bed.gz", package="AneuFinderData")
## Import the file and skip the first 10 lines
data <- importBed(bedfile, skip=10)

AneuFinder documentation built on Nov. 8, 2020, 7:44 p.m.