View source: R/coor_to_genomic_ranges.R
| coor_to_genomic_ranges | R Documentation |
Fast conversion of genomic coordinate strings to a GRanges object with
reference sequences fetched from installed BSgenome.* packages.
Designed for large sliding-window inputs: genome packages are loaded once,
coordinate strings are parsed in one pass, and sequences are extracted with
vectorized getSeq (or optional chromosome
preloading).
coor_to_genomic_ranges(
input,
complement_seq = NULL,
method = c("vectorized", "preload_chr")
)
input |
Coordinate input. Either:
Supported colon-separated formats:
|
complement_seq |
Optional complement coordinates in the same format as
|
method |
Sequence extraction strategy:
|
For genome-wide tiling with thousands of windows, pass coordinates as
list(pkg_name = "BSgenome.Hsapiens.UCSC.hg38", seq = ...) so the
genome package is loaded once instead of per interval.
A GRanges object with metadata columns:
sequenceReference sequence for each interval.
complementComplementary sequence.
GCGC fraction (0-1) per interval.
region_idRegion identifier from the coordinate string.
genome_pkgBSgenome package name used.
Junhui Li
to_genomic_ranges, to_genomic_ranges_fast
## Not run:
coords <- c(
"chr1:1000-1199:+:win1",
"chr1:1200-1399:+:win2"
)
gr <- coor_to_genomic_ranges(
list(pkg_name = "BSgenome.Hsapiens.UCSC.hg38", seq = coords)
)
gr
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.