Skip to contents

Assigns a target gene per variant without folding the result into any composite score. Tier 1 (Direct): among tracks whose quantile_score passes q_threshold, the highest-ranked gene-annotated gene_name becomes the target. Tier 2 (Distal): when no gated gene evidence remains, the nearest annotated gene (from av_annotate_genes) is used. CHIP_TF / CHIP_HISTONE tracks contribute their transcription-factor and histone-mark annotations as parallel supporting evidence.

Usage

av_map_targets(
  obj,
  q_threshold = .AV_Q_DEFAULT,
  gene_types = c("protein_coding", "lncRNA"),
  agg_method = c("mean", "median", "max")
)

Arguments

obj

An object of class AlphaVarSet. Tier 2 additionally needs dist_to_tss (from av_annotate_genes); without it the distal target and distance are NA.

q_threshold

Numeric. Minimum abs(quantile_score) for a track to qualify as Tier 1 evidence (default 0.95).

gene_types

Character vector. Gene biotypes eligible for Tier 1 ranking (default c("protein_coding", "lncRNA")).

agg_method

Character. Per-gene aggregation across tracks: "mean" (default), "median", or "max".

Value

The updated AlphaVarSet with a table at obj$stats$targets[["variant_id"]]: variant_id, target_gene, all_target_genes, supporting_tfs, supporting_marks, n_target_genes, evidence_tier, distance_to_tss.

Details

This is the descriptive V2G layer split out of the retired av_score_evidence; distance_to_tss is reported as information, not applied as a distance-decay multiplier.

Examples

example_file <- system.file("extdata", "bcl11a_rs1427407_example.csv",
                            package = "AlphaVaR")
obj <- av_import_csv(example_file)
#> Reading bcl11a_rs1427407_example.csv ...
obj <- av_map_targets(obj)
obj$stats$targets[["variant_id"]]
#> # A tibble: 2 × 8
#>   variant_id        target_gene all_target_genes supporting_tfs supporting_marks
#>   <chr>             <chr>       <chr>            <chr>          <chr>           
#> 1 chr2:60490908:T>C BCL11A      BCL11A           EP300|GATA1|Z… H3K27ac|H3K36me…
#> 2 chr2:60490908:T>G NA          NA               FOXM1|TCF12    H3K4me2|H3K79me2
#> # ℹ 3 more variables: n_target_genes <int>, evidence_tier <chr>,
#> #   distance_to_tss <dbl>