This function extracts gene and exon information from a TxDb object for a specific genomic region.
Arguments
- txdb
A TxDb object (e.g., TxDb.Hsapiens.UCSC.hg19.knownGene)
- region_gr
A GRanges object specifying the genomic region
- org.Hs.eg.db
An OrgDb object for gene symbol lookup (e.g., org.Hs.eg.db). If NULL (default), the function will attempt to auto-detect an OrgDb object from the global environment. If not found, gene IDs will be used as gene names.
Examples
if (FALSE) { # \dontrun{
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(org.Hs.eg.db)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
region_gr <- parse_region("chr1:1000000-2000000")
gene_data <- extract_txdb_data(txdb, region_gr)
} # }