exportGRangesAsBedFile: Export genome browser viewable files

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/export.R

Description

Export GRanges as genome browser viewable file

Usage

1
2
3
exportGRangesAsBedFile(gr, trackname, filename, namecol = "combination",
  scorecol = "score", colorcol = NULL, colors = NULL, header = TRUE,
  append = FALSE)

Arguments

gr

A GRanges object.

trackname

The name that will be used as track name and description in the header.

filename

The name of the file that will be written. The ending ".bed.gz". Any existing file will be overwritten.

namecol

A character specifying the column that is used as name-column.

scorecol

A character specifying the column that is used as score-column. The score should contain integers in the interval [0,1000] for compatibility with the UCSC genome browser convention.

colorcol

A character specifying the column that is used for coloring the track. There will be one color for each unique element in colorcol.

colors

A character vector with the colors that are used for the unique elements in colorcol.

header

A logical indicating whether the output file will have a heading track line (TRUE) or not (FALSE).

append

Whether or not to append to an existing file.

Details

Export regions from GRanges as a file which can be uploaded into a genome browser. Regions are exported in BED format (.bed.gz).

Value

NULL

Author(s)

Aaron Taudt

See Also

exportPeaks, exportCounts, exportCombinations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
### Export regions with read counts above 20 ###
# Get an example BAM file with ChIP-seq reads
file <- system.file("extdata", "euratrans",
                      "lv-H3K27me3-BN-male-bio2-tech1.bam",
                       package="chromstaRData")
# Bin the file into bin size 1000bp
data(rn4_chrominfo)
binned <- binReads(file, assembly=rn4_chrominfo, binsizes=1000,
                  chromosomes='chr12')
plotHistogram(binned)
# Export regions with read count above 20
exportGRangesAsBedFile(binned[binned$counts > 20], filename=tempfile(),
             trackname='read counts above 20')

chromstaR documentation built on May 20, 2017, 9:40 p.m.

Search within the chromstaR package
Search all R packages, documentation and source code