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()
#> 125977 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 41076 ranges and 5 metadata columns:
#>           seqnames              ranges strand |        name     score
#>              <Rle>           <IRanges>  <Rle> | <character> <numeric>
#>       [1]     chr1       629971-630247      * |        id-1      1000
#>       [2]     chr1       630555-630686      * |        id-2      1000
#>       [3]     chr1       631456-631616      * |        id-3      1000
#>       [4]     chr1       631623-631796      * |        id-4      1000
#>       [5]     chr1       632786-632900      * |        id-5      1000
#>       ...      ...                 ...    ... .         ...       ...
#>   [41072]     chrX 155968377-155968453      * |    id-41072        20
#>   [41073]     chrX 155997389-155997709      * |    id-41073        30
#>   [41074]     chrX 156001649-156001891      * |    id-41074        30
#>   [41075]     chrX 156002581-156002727      * |    id-41075        20
#>   [41076]     chrY   20494510-20494735      * |    id-41076      1000
#>           signalValue    pValue    qValue
#>             <numeric> <numeric> <numeric>
#>       [1]          -1        -1       100
#>       [2]          -1        -1       100
#>       [3]          -1        -1       100
#>       [4]          -1        -1       100
#>       [5]          -1        -1       100
#>       ...         ...       ...       ...
#>   [41072]          -1        -1   2.02910
#>   [41073]          -1        -1   3.30539
#>   [41074]          -1        -1   3.30539
#>   [41075]          -1        -1   2.30251
#>   [41076]          -1        -1 100.00000
#>   -------
#>   seqinfo: 711 sequences (1 circular) from hg38 genome