Description Usage Arguments BigBedFile objects Author(s) Examples
These functions support the import and export of the UCSC BigBed format, a compressed, binary form of BED with a spatial index and precomputed summaries. These functions do not work on Windows.
1 2 3 4 5 6 7 8 9 10 11 12 | ## S4 method for signature 'BigBedFile,ANY,ANY'
import(con, format, text,
selection = BigBedSelection(which, ...),
which = con, ...)
import.bb(con, ...)
## S4 method for signature 'ANY,BigBedFile,ANY'
export(object, con, format, ...)
## S4 method for signature 'GenomicRanges,BigBedFile,ANY'
export(object, con, format,
compress = TRUE, extraIndexes = "")
export.bb(object, con, ...)
|
con |
A path, URL or |
object |
The object to export, should be |
format |
If not missing, should be “bigBed” or “bb” (case insensitive). |
text |
Not supported. |
selection |
A |
which |
A range data structure coercible to |
compress |
If |
extraIndexes |
If set, make an index on each field in a comma separated list |
... |
Arguments to pass down to methods to other methods. For
import, the flow eventually reaches the |
BigBedFile
objectsA BigWigFile
object, an extension of
RTLFile
is a reference to a BigBed file. To cast
a path, URL or connection to a BigBedFile
, pass it to the
BigBedFile
constructor.
BigBed files are more complex than most track files, and there are a
number of methods on BigBedFile
for accessing the additional
information:
seqinfo(x)
:
Gets the Seqinfo
object
indicating the lengths of the sequences for the intervals in the
file. No circularity or genome information is available.
When accessing remote data, the UCSC library caches data in the
‘/tmp/udcCache’ directory. To clean the cache, call
cleanBigBedCache(maxDays)
, where any files older than
maxDays
days old will be deleted.
Michael Lawrence
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | if (.Platform$OS.type != "windows") {
test_path <- system.file("tests", package = "rtracklayer")
test_bb <- file.path(test_path, "test.bb")
## Returns ranges with all fields
gr <- import(test_bb)
gr
## Retuns ranges only for 'chr10'
## between 180185-180185 with all fields
which <- GRanges(c("chr10"), IRanges(c(180185, 180185)))
import(test_bb, which = which)
## Retuns ranges only for 'chr10'
## between 180185-180185 with name and peak fields
selection <- BigBedSelection(which, colnames = c("name", "peak"))
import(test_bb, selection = selection)
## Not run:
test_bb_out <- file.path(tempdir(), "test_out.bb")
export(test, test_bb_out)
## make an index for 'name'
test_bb_out <- file.path(tempdir(), "test_out.bb")
export(test, test_bb_out, extraIndexes = "name")
## End(Not run)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.