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
GRanges objects using transcripts, exons, or cds.
- Group genomic features by gene or transcript into a
GRangesList using transcriptsBy or exonsBy.
- Retrieve actual sequence data by pairing a
TxDb with a BSgenome package and using extractTranscriptSeqs.
When NOT to Use
- For extracting actual sequence data without a
BSgenome package (use BSgenome directly instead because GenomicFeatures only stores coordinates).
- For finding overlaps between alignments and features without first extracting the features (use
findOverlaps on the extracted GRangesList instead).
Data Requirements
- Requires a
TxDb object (loaded via loadDb or an annotation package like TxDb.Hsapiens.UCSC.hg19.knownGene).
- Sequence extraction requires an appropriate
BSgenome package (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 in transcripts.
- 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
transcriptsBy or exonsBy.
- use.names (default): Logical to retain sequence names in
extractTranscriptSeqs.
Best Practices
- Check active chromosomes using
seqlevels before extracting features to limit the data returned.
- Use
select to map between different identifiers (e.g., TXNAME to GENEID) within the TxDb object.
- Group features into a
GRangesList (e.g., using exonsBy) before using findOverlaps to contextualize high-throughput sequencing alignments.
Common Pitfalls
- Extracting sequences for all transcribed regions instead of just coding regions. Fix: Use
cdsBy to subset coding regions before calling extractTranscriptSeqs.
- Translating non-coding sequences resulting in meaningless translations. Fix: Ensure you extract sequences using
cdsBy before passing them to translate.
- Forgetting which chromosomes are active after filtering. Fix: Use
seqlevels0 to reset to the original chromosomes stored in the database.
Alternatives
txdbmaker: For making TxDb objects 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 of GRanges objects 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.
▶ Open genomicfeatures on BioMate →
1---2name: bioconductor-genomicfeatures3description: Extract the genomic locations of genes, transcripts, exons, introns, and CDS, for the gene models stored in a TxDb object. A TxDb object is a small database that contains the gene models of a given organism/assembly. Bioconductor provides a4---56# GenomicFeatures78## Dependencies & Environment910> Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.1112- **Version:** 1.64.0 · **Bioconductor:** 3.23 · **R:** ≥ 4.613- **Depends:** BiocGenerics, S4Vectors, IRanges, Seqinfo, GenomicRanges, AnnotationDbi14- **Imports:** DBI, XVector, Biostrings, rtracklayer15- **Install:** `BiocManager::install("GenomicFeatures")`1617## When to Use18- Extract genomic coordinates for exons, transcripts, or coding sequences as `GRanges` objects using `transcripts`, `exons`, or `cds`.19- Group genomic features by gene or transcript into a `GRangesList` using `transcriptsBy` or `exonsBy`.20- Retrieve actual sequence data by pairing a `TxDb` with a `BSgenome` package and using `extractTranscriptSeqs`.2122## When NOT to Use23- For extracting actual sequence data without a `BSgenome` package (use `BSgenome` directly instead because `GenomicFeatures` only stores coordinates).24- For finding overlaps between alignments and features without first extracting the features (use `findOverlaps` on the extracted `GRangesList` instead).2526## Data Requirements27- Requires a `TxDb` object (loaded via `loadDb` or an annotation package like `TxDb.Hsapiens.UCSC.hg19.knownGene`).28- Sequence extraction requires an appropriate `BSgenome` package (e.g., `BSgenome.Hsapiens.UCSC.hg19`).2930## Key Parameters31- **keys** (default): A vector of identifiers to look up when using `select`.32- **columns** (default): The columns to retrieve when using `select`.33- **keytype** (default): The type of key being passed to `select`.34- **filter** (default): A list (e.g., `tx_chrom`, `tx_strand`) to subset results in `transcripts`.35- **upstream** (default): Number of bases upstream from the transcription start site for `promoters`.36- **downstream** (default): Number of bases downstream from the transcription start site for `promoters`.37- **by** (default): The feature to group by (e.g., "gene", "tx") in `transcriptsBy` or `exonsBy`.38- **use.names** (default): Logical to retain sequence names in `extractTranscriptSeqs`.3940## Best Practices41- Check active chromosomes using `seqlevels` before extracting features to limit the data returned.42- Use `select` to map between different identifiers (e.g., `TXNAME` to `GENEID`) within the `TxDb` object.43- Group features into a `GRangesList` (e.g., using `exonsBy`) before using `findOverlaps` to contextualize high-throughput sequencing alignments.4445## Common Pitfalls46- Extracting sequences for all transcribed regions instead of just coding regions. Fix: Use `cdsBy` to subset coding regions before calling `extractTranscriptSeqs`.47- Translating non-coding sequences resulting in meaningless translations. Fix: Ensure you extract sequences using `cdsBy` before passing them to `translate`.48- Forgetting which chromosomes are active after filtering. Fix: Use `seqlevels0` to reset to the original chromosomes stored in the database.4950## Alternatives51- `txdbmaker`: For making `TxDb` objects from genomic annotations (UCSC, Ensembl, GFF) rather than querying existing ones.52- `BSgenome`: For working directly with full genome sequences rather than transcript-specific metadata.53- `GenomicRanges`: For general manipulation of `GRanges` objects rather than extracting them from a database.5455## Citations56- Carlson M, Aboyoun P, Pagès H, Falcon S, Morgan M (2026). "Obtaining and Utilizing TxDb Objects." Bioconductor Vignette.5758## References59- Homepage: bioconductor.org/packages/GenomicFeatures60- Vignette: vignette_0_d47eae8b.txt6162<!-- biomate-cta -->63---6465## Run this on BioMate6667This 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](https://www.biomate.ai?ref=kb&pkg=genomicfeatures)** — free to start.6869▶ **[Open `genomicfeatures` on BioMate →](https://www.biomate.ai?ref=kb&pkg=genomicfeatures)**