| Title: | Coordinate-Level Pharmacological Annotation of Genomic Regions |
|---|---|
| Description: | Maps genomic regions to gene features and then to traceable drug-gene relationships. The package preserves genomic coordinates, relationship categories, evidence scope, and source provenance. It deliberately reports coordinate-level pharmacological relevance rather than predicting treatment response, efficacy, toxicity, or dose. |
| Authors: | Vasileios Lemonidis [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-6446-3536>), Center for Oncological Research, University of Antwerp [cph, fnd], Department of Human Genetics, KU Leuven [cph, fnd], Stichting Tegen Kanker [fnd] |
| Maintainer: | Vasileios Lemonidis <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 0.99.0 |
| Built: | 2026-09-29 10:53:04 UTC |
| Source: | https://github.com/BiocStaging/drugannotR |
Finds overlaps between input regions and mapped drug-gene features while preserving coordinates, feature type, evidence scope, and source provenance.
annotateDrugRegions(bed, drug_ranges)annotateDrugRegions(bed, drug_ranges)
bed |
A GenomicRanges::GRanges, an existing BED file path, or a data
frame with |
drug_ranges |
A GenomicRanges::GRanges returned by
|
Overlaps ignore strand because the input represents observed genomic regions rather than stranded transcripts. The returned interpretation never asserts a functional effect or predicts drug response.
A GenomicRanges::GRanges containing input region coordinates.
Rows are specific to a region, source evidence record, relationship,
feature type, and coordinate evidence scope. Multiple transcript pieces
belonging to the same logical mapping are collapsed. Metadata includes
overlap_bp, overlap_fraction, overlap_segments, and a cautious
interpretation.
drug_sets <- buildDrugGeneSets( sources = "custom", source_data = list(custom = data.frame( drug_name = "example drug", gene_symbol = "GENE1", relationship_category = "target", evidence_scope = "gene_association", source = "example" )) ) genes <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1001, 2000), strand = "+", gene_symbol = "GENE1" ) drug_ranges <- mapDrugGenes( drug_sets, gene_model = genes, features = "gene_body" ) regions <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1200, 1300), region_id = "region_1" ) annotateDrugRegions(regions, drug_ranges)drug_sets <- buildDrugGeneSets( sources = "custom", source_data = list(custom = data.frame( drug_name = "example drug", gene_symbol = "GENE1", relationship_category = "target", evidence_scope = "gene_association", source = "example" )) ) genes <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1001, 2000), strand = "+", gene_symbol = "GENE1" ) drug_ranges <- mapDrugGenes( drug_sets, gene_model = genes, features = "gene_body" ) regions <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1200, 1300), region_id = "region_1" ) annotateDrugRegions(regions, drug_ranges)
Imports supported source tables into a common long-form
S4Vectors::DataFrame. DGIdb and DrugCentral are target-interaction
sources and are therefore mapped only to relationship_category = "target".
They are never used to infer efficacy, toxicity, or dosage associations.
buildDrugGeneSets( sources = c("PharmGKB", "DGIdb", "DrugCentral"), source_data = NULL, cache = NULL, refresh = FALSE, organism = "Homo sapiens" )buildDrugGeneSets( sources = c("PharmGKB", "DGIdb", "DrugCentral"), source_data = NULL, cache = NULL, refresh = FALSE, organism = "Homo sapiens" )
sources |
Character vector containing any of |
source_data |
Named list of local file paths, data frames, or
S4Vectors::DataFrame objects. Names identify sources. A ClinPGx entry
can be |
cache |
|
refresh |
Logical scalar. If |
organism |
Character vector used to filter DrugCentral records.
The default retains human records. Use |
ClinPGx/PharmGKB summary annotations, DGIdb interactions, and DrugCentral
targets are downloaded into a BiocFileCache::BiocFileCache when their
entries are omitted from source_data.
Supported relationship categories are target, pharmacodynamics,
metabolism, transport, carrier, efficacy, toxicity, dosage,
Other, resistance, and exposure.
evidence_scope describes the scope of the source statement. Coordinate
scope is recalculated by mapDrugGenes() for each mapped genomic feature.
In particular, an rsID is not coordinate-exact until matching coordinates
are supplied to mapDrugGenes().
A S4Vectors::DataFrame with one row per source evidence
statement. Canonical columns are drug_id, drug_name, gene_id,
gene_symbol, relationship_category, interaction_type, direction,
phenotype, phenotype_category, evidence_level, evidence_scope,
source, source_record_id, genome_build, and variant_id.
Source-specific provenance columns are retained.
dgidb <- data.frame( gene_claim_name = "HGNC:1595", gene_concept_id = "hgnc:1595", gene_name = "CYP2C19", drug_claim_name = "CHEBI:37941", drug_concept_id = "chembl:1771", drug_name = "CLOPIDOGREL", interaction_source_db_name = "ExampleSource", interaction_types = "substrate", evidence_score = 1 ) sets <- buildDrugGeneSets( sources = "DGIdb", source_data = list(DGIdb = dgidb) ) setsdgidb <- data.frame( gene_claim_name = "HGNC:1595", gene_concept_id = "hgnc:1595", gene_name = "CYP2C19", drug_claim_name = "CHEBI:37941", drug_concept_id = "chembl:1771", drug_name = "CLOPIDOGREL", interaction_source_db_name = "ExampleSource", interaction_types = "substrate", evidence_score = 1 ) sets <- buildDrugGeneSets( sources = "DGIdb", source_data = list(DGIdb = dgidb) ) sets
Joins a canonical drug-gene table to an explicit gene model and returns
genomic ranges for each requested feature and evidence statement. Promoters
are derived from transcript starts for TxDb inputs. An untyped GRanges
model is treated as gene bodies and can also yield strand-aware promoters.
mapDrugGenes( drug_sets, genome = "GRCh38", gene_model = NULL, features = c("gene_body", "promoter"), promoter_upstream = 2000L, promoter_downstream = 500L, org_db = NULL, org_db_keytype = "ENTREZID", org_db_symbol_column = "SYMBOL", variant_ranges = NULL )mapDrugGenes( drug_sets, genome = "GRCh38", gene_model = NULL, features = c("gene_body", "promoter"), promoter_upstream = 2000L, promoter_downstream = 500L, org_db = NULL, org_db_keytype = "ENTREZID", org_db_symbol_column = "SYMBOL", variant_ranges = NULL )
drug_sets |
A canonical S4Vectors::DataFrame, normally returned by
|
genome |
Genome build label. |
gene_model |
A |
features |
Any of |
promoter_upstream, promoter_downstream
|
Non-negative promoter widths relative to transcript or gene-body transcription starts. |
org_db |
Optional AnnotationDbi::AnnotationDb or mapping table used to add gene symbols to identifier-only models. |
org_db_keytype, org_db_symbol_column
|
Columns used with |
variant_ranges |
Optional GenomicRanges::GRanges with a |
Feature-derived coordinate scope is explicit:
promoter ranges use regulatory_overlap;
gene bodies, coding exons, UTRs, and introns use gene_association;
only supplied variant coordinates use exact_variant.
A source statement mentioning an rsID is not treated as an exact genomic overlap unless coordinates for that rsID are supplied.
A GenomicRanges::GRanges with one or more genomic pieces per
source record and feature type. mapping_id identifies pieces belonging
to the same logical annotation. Unmapped drug-gene records are retained
in metadata(result)$unmapped_records.
drug_sets <- buildDrugGeneSets( sources = "custom", source_data = list(custom = data.frame( drug_id = "drug:1", drug_name = "example drug", gene_id = "gene:1", gene_symbol = "GENE1", relationship_category = "metabolism", evidence_scope = "gene_association", source = "example" )) ) genes <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1001, 2000), strand = "+", gene_id = "gene:1", gene_symbol = "GENE1" ) mapDrugGenes( drug_sets, genome = "GRCh38", gene_model = genes, features = c("gene_body", "promoter") )drug_sets <- buildDrugGeneSets( sources = "custom", source_data = list(custom = data.frame( drug_id = "drug:1", drug_name = "example drug", gene_id = "gene:1", gene_symbol = "GENE1", relationship_category = "metabolism", evidence_scope = "gene_association", source = "example" )) ) genes <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1001, 2000), strand = "+", gene_id = "gene:1", gene_symbol = "GENE1" ) mapDrugGenes( drug_sets, genome = "GRCh38", gene_model = genes, features = c("gene_body", "promoter") )
Aggregates annotation rows without calculating enrichment p-values, drug rankings, or effect-direction predictions.
summariseDrugAnnotations(annotations, by = c("region", "drug", "relationship"))summariseDrugAnnotations(annotations, by = c("region", "drug", "relationship"))
annotations |
A GenomicRanges::GRanges returned by
|
by |
Grouping dimensions. Supported values are |
Overlap base pairs are unioned within each input region before summation,
preventing duplicated source records or transcript fragments from inflating
coverage. strongest_evidence_level ranks only recognised PharmGKB-style
levels (1A, 1B, 2A, 2B, 3, 4). It is NA when multiple
unranked evidence labels cannot be compared safely.
A S4Vectors::DataFrame with the grouping columns plus applicable
counts, unioned overlap base pairs, represented categories, evidence
scopes, evidence levels, exact-variant presence, and source provenance.
Summary columns for dimensions already present in by are omitted.
drug_sets <- buildDrugGeneSets( sources = "custom", source_data = list(custom = data.frame( drug_name = "example drug", gene_symbol = "GENE1", relationship_category = "target", evidence_scope = "gene_association", source = "example" )) ) genes <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1001, 2000), strand = "+", gene_symbol = "GENE1" ) mapped <- mapDrugGenes( drug_sets, gene_model = genes, features = "gene_body" ) regions <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1200, 1300), region_id = "region_1" ) annotations <- annotateDrugRegions(regions, mapped) summariseDrugAnnotations(annotations)drug_sets <- buildDrugGeneSets( sources = "custom", source_data = list(custom = data.frame( drug_name = "example drug", gene_symbol = "GENE1", relationship_category = "target", evidence_scope = "gene_association", source = "example" )) ) genes <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1001, 2000), strand = "+", gene_symbol = "GENE1" ) mapped <- mapDrugGenes( drug_sets, gene_model = genes, features = "gene_body" ) regions <- GenomicRanges::GRanges( "chr1", IRanges::IRanges(1200, 1300), region_id = "region_1" ) annotations <- annotateDrugRegions(regions, mapped) summariseDrugAnnotations(annotations)