GenomicFeatures
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
- Version: 1.64.0 · Bioconductor: 3.23 · R: ≥ 4.6
- Depends: BiocGenerics, S4Vectors, IRanges, Seqinfo, GenomicRanges, AnnotationDbi
- Imports: DBI, XVector, Biostrings, rtracklayer
- Install:
BiocManager::install("GenomicFeatures")
When to Use
- Extract genomic coordinates for exons, transcripts, or coding sequences as
GRangesobjects usingtranscripts,exons, orcds. - Group genomic features by gene or transcript into a
GRangesListusingtranscriptsByorexonsBy. - Retrieve actual sequence data by pairing a
TxDbwith aBSgenomepackage and usingextractTranscriptSeqs.
When NOT to Use
- For extracting actual sequence data without a
BSgenomepackage (useBSgenomedirectly instead becauseGenomicFeaturesonly stores coordinates). - For finding overlaps between alignments and features without first extracting the features (use
findOverlapson the extractedGRangesListinstead).
Data Requirements
- Requires a
TxDbobject (loaded vialoadDbor an annotation package likeTxDb.Hsapiens.UCSC.hg19.knownGene). - Sequence extraction requires an appropriate
BSgenomepackage (e.g.,BSgenome.Hsapiens.UCSC.hg19).
Key Parameters
- keys (default): A vector of identifiers to look up when using
select. - columns (default): The columns to retrieve when using
select. - keytype (default): The type of key being passed to
select. - filter (default): A list (e.g.,
tx_chrom,tx_strand) to subset results intranscripts. - upstream (default): Number of bases upstream from the transcription start site for
promoters. - downstream (default): Number of bases downstream from the transcription start site for
promoters. - by (default): The feature to group by (e.g., "gene", "tx") in
transcriptsByorexonsBy. - use.names (default): Logical to retain sequence names in
extractTranscriptSeqs.
Best Practices
- Check active chromosomes using
seqlevelsbefore extracting features to limit the data returned. - Use
selectto map between different identifiers (e.g.,TXNAMEtoGENEID) within theTxDbobject. - Group features into a
GRangesList(e.g., usingexonsBy) before usingfindOverlapsto contextualize high-throughput sequencing alignments.
Common Pitfalls
- Extracting sequences for all transcribed regions instead of just coding regions. Fix: Use
cdsByto subset coding regions before callingextractTranscriptSeqs. - Translating non-coding sequences resulting in meaningless translations. Fix: Ensure you extract sequences using
cdsBybefore passing them totranslate. - Forgetting which chromosomes are active after filtering. Fix: Use
seqlevels0to reset to the original chromosomes stored in the database.
Alternatives
txdbmaker: For makingTxDbobjects from genomic annotations (UCSC, Ensembl, GFF) rather than querying existing ones.BSgenome: For working directly with full genome sequences rather than transcript-specific metadata.GenomicRanges: For general manipulation ofGRangesobjects rather than extracting them from a database.
Citations
- Carlson M, Aboyoun P, Pagès H, Falcon S, Morgan M (2026). "Obtaining and Utilizing TxDb Objects." Bioconductor Vignette.
References
- Homepage: bioconductor.org/packages/GenomicFeatures
- Vignette: vignette_0_d47eae8b.txt
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use genomicfeatures. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.


