write_bed: Save a GRanges object to a bed file.

Description Usage Arguments Value Examples

View source: R/export_functions.R

Description

Save a GRanges object to a bed file.

Usage

1
write_bed(gr, path = "", ucsc_name = F)

Arguments

gr

A GenomicRanges object.

path

Path to write to.

ucsc_name

A header track name. Required for visualisation by UCSC genome browser.

Value

writes an object to a specific path.

Examples

1
2
3
4
5
6
gr <- GRanges(Rle(c("chr2", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
IRanges(1:10, width=10:1, names=head(letters, 10)),
Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),
score=1:10, GC=seq(1, 0, length=10))

write_bed(gr, path = "output/file.ucsc.bed", ucsc = "Example track")

rmwthorne/rangr documentation built on May 7, 2019, 11:15 a.m.