| Title: | A BEDbase client |
|---|---|
| Description: | A client for BEDbase. bedbaser provides access to the API at api.bedbase.org. It also includes convenience functions to import BED files into GRanges objects and BEDsets into GRangesLists. |
| Authors: | Andres Wokaty [aut, cre] (ORCID: <https://orcid.org/0009-0008-0900-8793>), Levi Waldron [aut] (ORCID: <https://orcid.org/0000-0003-2725-0694>), NCI [fnd] (GrantNo.: U24CA289073) |
| Maintainer: | Andres Wokaty <[email protected]> |
| License: | Artistic License 2.0 |
| Version: | 1.5.0 |
| Built: | 2026-05-29 08:04:38 UTC |
| Source: | https://github.com/waldronlab/bedbaser |
Return all available BED files ranked by relevance to the keywords. Uses the bedhost API default of 10 records and an initial offset of 0.
bb_bed_text_search( bedbase, query, genome = NULL, assay = NULL, limit = 10, offset = 0 )bb_bed_text_search( bedbase, query, genome = NULL, assay = NULL, limit = 10, offset = 0 )
bedbase |
BEDbase() object |
query |
character() keywords to search |
genome |
character() (default NULL) genome to search |
assay |
character() (default NULL) assay to search |
limit |
integer(1) (default |
offset |
integer(1) (default |
tibble of results
bedbase <- BEDbase() bb_bed_text_search(bedbase, "hg38")bedbase <- BEDbase() bb_bed_text_search(bedbase, "hg38")
Return a tibble of BED files in BEDset given its id.
bb_beds_in_bedset(bedbase, bedset_id)bb_beds_in_bedset(bedbase, bedset_id)
bedbase |
BEDbase() object |
bedset_id |
integer(1) BEDset record identifier |
tibble of BED files in BEDset
bedbase <- BEDbase() ex_bedset <- bb_example(bedbase, "bedset") bb_beds_in_bedset(bedbase, ex_bedset$id)bedbase <- BEDbase() ex_bedset <- bb_example(bedbase, "bedset") bb_beds_in_bedset(bedbase, ex_bedset$id)
Get the example BED file or BEDset available through bedhost. Useful for an initial exploration of bedbaser with an example BED file and BEDset in BEDbase.
bb_example(bedbase, rec_type = c("bed", "bedset"))bb_example(bedbase, rec_type = c("bed", "bedset"))
bedbase |
BEDbase() object |
rec_type |
character(1) bed or bedset |
list() bed files or bedsets
bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") str(ex_bed) ex_bedset <- bb_example(bedbase, "bedset") str(ex_bedset)bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") str(ex_bed) ex_bedset <- bb_example(bedbase, "bedset") str(ex_bedset)
List BED files available through bedhost. By default uses the bedhost default of 1000 records and an initial offset of 0.
bb_list_beds( bedbase, genome = NULL, bed_compliance = NULL, limit = 1000, offset = 0 )bb_list_beds( bedbase, genome = NULL, bed_compliance = NULL, limit = 1000, offset = 0 )
bedbase |
BEDbase() object |
genome |
character(1) (default |
bed_compliance |
character(1) (default |
limit |
integer(1) (default |
offset |
integer(1) (default |
tibble of BED records
bedbase <- BEDbase() bb_list_beds(bedbase)bedbase <- BEDbase() bb_list_beds(bedbase)
List BEDsets available through bedhost. By default uses the bedhost default of 1000 records and an initial offset of 0.
bb_list_bedsets(bedbase, query = "", limit = 1000, offset = 0)bb_list_bedsets(bedbase, query = "", limit = 1000, offset = 0)
bedbase |
BEDbase() object |
query |
character() (default |
limit |
integer(1) (default |
offset |
integer(1) (default |
tibble of BEDset records
bedbase <- BEDbase() bb_list_bedsets(bedbase)bedbase <- BEDbase() bb_list_bedsets(bedbase)
Get metadata for a BED file or BEDset given its id. Abort if not found or id is not not 32 characters.
bb_metadata(bedbase, id, full = FALSE)bb_metadata(bedbase, id, full = FALSE)
bedbase |
BEDbase() object |
id |
integer(1) record or object identifier |
full |
logical(1) (default |
list() metadata
bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") bb_metadata(bedbase, ex_bed$id) ex_bedset <- bb_example(bedbase, "bedset") bb_metadata(bedbase, ex_bedset$id)bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") bb_metadata(bedbase, ex_bed$id) ex_bedset <- bb_example(bedbase, "bedset") bb_metadata(bedbase, ex_bedset$id)
Save a BED file or a BEDset to a local path. If the path does
not exist, bb_save() will abort.
bb_save(bedbase, bed_or_bedset_id, path, quietly = TRUE)bb_save(bedbase, bed_or_bedset_id, path, quietly = TRUE)
bedbase |
BEDbase() object |
bed_or_bedset_id |
integer(1) BED or BEDset record identifier |
path |
character(1) directory to save file |
quietly |
logical(1) (default |
An invisible NULL
bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") bb_save(bedbase, ex_bed$id, tempdir())bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") bb_save(bedbase, ex_bed$id, tempdir())
Get statistics on available BED files, BEDsets, and genomoes.
bb_stats(bedbase, detailed = FALSE)bb_stats(bedbase, detailed = FALSE)
bedbase |
BEDbase() object |
detailed |
logical(1) if TRUE display detailed information |
An invisible NULL
bedbase <- BEDbase() bb_stats(bedbase)bedbase <- BEDbase() bb_stats(bedbase)
Create a GRanges object given a BED id. Columns and types
are generated for broad and narrow peak files. Known columns and types can
be passed as a named vector through extra_cols. Otherwise,
bb_to_granges() attempts to determine the column type and substitute dummy
column names.
bb_to_granges(bedbase, bed_id, extra_cols = NULL, quietly = TRUE)bb_to_granges(bedbase, bed_id, extra_cols = NULL, quietly = TRUE)
bedbase |
BEDbase() object |
bed_id |
integer(1) BED record identifier |
extra_cols |
character() (default |
quietly |
logical(1) (default |
bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") bb_to_granges(bedbase, ex_bed$id)bedbase <- BEDbase() ex_bed <- bb_example(bedbase, "bed") bb_to_granges(bedbase, ex_bed$id)
Create a GRangesList object given a BEDset id
bb_to_grangeslist(bedbase, bedset_id, quietly = TRUE)bb_to_grangeslist(bedbase, bedset_id, quietly = TRUE)
bedbase |
BEDbase() object |
bedset_id |
integer(1) BEDset record identifier |
quietly |
logical(1) (default |
bedbase <- BEDbase() bedset_id <- "lola_hg38_ucsc_features" bb_to_grangeslist(bedbase, bedset_id)bedbase <- BEDbase() bedset_id <- "lola_hg38_ucsc_features" bb_to_grangeslist(bedbase, bedset_id)
bedbaser exposes the bedhost API
and includes convenience functions for common tasks, such as to import a
BED file by id into a GRanges object and a BEDset by its id into a
GRangesList.
BEDbase(cache_path, quietly = FALSE) getCache(x, cache_type = c("bedfiles", "bedsets")) setCache(x, cache_path, quietly = TRUE)BEDbase(cache_path, quietly = FALSE) getCache(x, cache_type = c("bedfiles", "bedsets")) setCache(x, cache_path, quietly = TRUE)
cache_path |
character(1) |
quietly |
logical(1) (default |
x |
BEDbase() object |
cache_type |
character(1) bedfiles or bedsets |
BEDbase() creates a cache similar to that of the
Geniml BBClient's cache.
The convenience functions are as follows
bedbaser::BEDbase(): API service constructor
bedbaser::getCache(): Retrieve cache
bedbaser::setCache(): Set path to cache
bedbaser::bb_stats(): Retrieve BEDbase statistics
bedbaser::bb_example(): Retrieve an example BED file or BEDset
bedbaser::bb_metadata(): Retrieve metadata for a BED file or BEDset
bedbaser::bb_list_beds(): List all BED files
bedbaser::bb_list_bedsets(): List all BEDsets
bedbaser::bb_beds_in_bedset(): List BED files in BEDset
bedbaser::bb_bed_text_search(): Search BED files by text
bedbaser::bb_to_granges(): Create a GRanges object from a BED id
bedbaser::bb_to_grangeslist(): Create a GRangesList from a BEDset id
bedbaser::bb_save(): Save a BED file to a path.
BEDbase object
bedbase <- BEDbase(cache_path = tempdir()) ex_bed <- bb_example(bedbase, "bed") bb_metadata(bedbase, ex_bed$id)bedbase <- BEDbase(cache_path = tempdir()) ex_bed <- bb_example(bedbase, "bed") bb_metadata(bedbase, ex_bed$id)
Return cache path
## S4 method for signature 'BEDbase' getCache(x, cache_type = c("bedfiles", "bedsets"))## S4 method for signature 'BEDbase' getCache(x, cache_type = c("bedfiles", "bedsets"))
x |
BEDbase() object |
cache_type |
character(1) bedfiles or bedsets |
BiocFileCache() object of BED files
bedbase <- BEDbase(tempdir()) getCache(bedbase, "bedfiles")bedbase <- BEDbase(tempdir()) getCache(bedbase, "bedfiles")
Display functions defined through the bedhost API and their corresponding parameters.
## S4 method for signature 'BEDbase' operations(x, ..., .deprecated = FALSE)## S4 method for signature 'BEDbase' operations(x, ..., .deprecated = FALSE)
x |
BEDbase() object |
... |
other options |
.deprecated |
(default |
list() API endpoints
bedbase <- BEDbase() operations(bedbase)bedbase <- BEDbase() operations(bedbase)
Display bedhost API schemas
## S4 method for signature 'BEDbase' schemas(x)## S4 method for signature 'BEDbase' schemas(x)
x |
BEDbase() object |
list() API endpoints
bedbase <- BEDbase() schemas(bedbase)bedbase <- BEDbase() schemas(bedbase)
Create a cache for BED files and BEDsets like Geniml BBClient's cache.
## S4 method for signature 'BEDbase' setCache(x, cache_path, quietly = TRUE)## S4 method for signature 'BEDbase' setCache(x, cache_path, quietly = TRUE)
x |
BEDbase() object |
cache_path |
character(1) |
quietly |
logical(1) (default |
BiocFileCache() object of BED files
bedbase <- BEDbase(tempdir()) bedbase <- setCache(bedbase, "/tmp")bedbase <- BEDbase(tempdir()) bedbase <- setCache(bedbase, "/tmp")
Display functions available through the API associated with a tag keyword in bedhost.
## S4 method for signature 'BEDbase' tags(x, .tags, .deprecated = FALSE)## S4 method for signature 'BEDbase' tags(x, .tags, .deprecated = FALSE)
x |
BEDbase() object |
.tags |
character() tags for filtering operations |
.deprecated |
(default |
list() API endpoints
bedbase <- BEDbase() unique(tags(bedbase)$tag) tags(bedbase, "bedset")bedbase <- BEDbase() unique(tags(bedbase)$tag) tags(bedbase, "bedset")