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)

Arguments

bedbase

BEDbase() object

bed_id

integer(1) BED record identifier

extra_cols

character() (default NULL) extra column names to construct GRanges objects

quietly

logical(1) (default TRUE) display messages

Value

GRanges

Examples

bedbase <- BEDbase()
#> 663721 BED files available.
ex_bed <- bb_example(bedbase, "bed")
bb_to_granges(bedbase, ex_bed$id)
#> 'getOption("repos")' replaces Bioconductor standard repositories, see
#> 'help("repositories", package = "BiocManager")' for details.
#> Replacement repositories:
#>     CRAN: https://p3m.dev/cran/__linux__/noble/latest
#> GRanges object with 29104 ranges and 3 metadata columns:
#>           seqnames              ranges strand |            name     score
#>              <Rle>           <IRanges>  <Rle> |     <character> <numeric>
#>       [1]     chr1       778582-778929      * | Stringent(qval)    778797
#>       [2]     chr1       827207-827302      * |         Relaxed    827301
#>       [3]     chr1       827419-827742      * | Stringent(qval)    827720
#>       [4]     chr1       904667-904855      * | Stringent(qval)    904812
#>       [5]     chr1       923746-923944      * | Stringent(qval)    923922
#>       ...      ...                 ...    ... .             ...       ...
#>   [29100]     chrX 155216250-155216526      * | Stringent(qval) 155216459
#>   [29101]     chrX 155612500-155612630      * |         Relaxed 155612585
#>   [29102]     chrX 155612883-155613051      * |         Relaxed 155613039
#>   [29103]     chrX 155767493-155767771      * |         Relaxed 155767753
#>   [29104]     chrX 155881161-155881411      * | Stringent(qval) 155881357
#>                  V6
#>           <numeric>
#>       [1]    778612
#>       [2]    827207
#>       [3]    827505
#>       [4]    904704
#>       [5]    923747
#>       ...       ...
#>   [29100] 155216280
#>   [29101] 155612570
#>   [29102] 155612942
#>   [29103] 155767502
#>   [29104] 155881197
#>   -------
#>   seqinfo: 711 sequences (1 circular) from hg38 genome