Description Usage Arguments Value Note Author(s) References See Also Examples
A wrapper function of export
with additional support for exporting tab-delimted format with no re-arrangement of the original GRanges output.
1 | exportGRanges(gRanges, outfile, exportFormat)
|
gRanges |
|
outfile |
File path for output. |
exportFormat |
Desirable format including "txt" and other formats specified in |
Output the text to the file stream defined in outfile
.
The function is used in ripSeek to export desired format and can be used as general purpose function.
Yue Li
Michael Lawrence, Vince Carey and Robert Gentleman. rtracklayer: R interface to genome browsers and their annotation tracks. R package version 1.16.3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if(interactive()) { # need permission to write to the current dir
gr <-
GRanges(seqnames =
Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
ranges =
IRanges(1:10, width = 10:1, names = head(letters,10)),
strand =
Rle(strand(c("-", "+", "*", "+", "-")),
c(1, 2, 2, 3, 2)),
score = 1:10,
GC = seq(1, 0, length=10))
outfile <- paste(getwd(), "/gr.txt", sep="/")
exportGRanges(gr, outfile=outfile, exportFormat="txt")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.