exportGRangesAsBedFile {chromstaR} | R Documentation |
Export GRanges as genome browser viewable file
exportGRangesAsBedFile(gr, trackname, filename, namecol = "combination", scorecol = "score", colorcol = NULL, colors = NULL, header = TRUE, append = FALSE)
gr |
A |
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 |
colors |
A character vector with the colors that are used for the unique elements in |
header |
A logical indicating whether the output file will have a heading track line ( |
append |
Whether or not to append to an existing file. |
Export regions from GRanges-class
as a file which can be uploaded into a genome browser. Regions are exported in BED format (.bed.gz).
NULL
Aaron Taudt
exportPeaks
, exportCounts
, exportCombinations
### 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, stepsizes=500, chromosomes='chr12') plotHistogram(binned) # Export regions with read count above 20 exportGRangesAsBedFile(binned[binned$counts[,1] > 20], filename=tempfile(), trackname='read counts above 20')