Export genome browser viewable files

Share:

Description

Export GRanges as genome browser viewable file

Usage

1
2
exportGRangesAsBedFile(gr, trackname, filename, namecol = "combination",
  scorecol = "score", 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.

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

exportUnivariates, exportMultivariate

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')

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.