Skip to contents

Switch between quantile and raw score for downstream analyses. Cached statistics are cleared on a real mode change to prevent stale results.

Usage

av_set_active_score(obj, score_type = c("quantile", "raw"))

Arguments

obj

An AlphaVarSet object.

score_type

Character: "quantile" (default) or "raw".

Value

The modified AlphaVarSet with updated meta$active_score.

Examples

example_file <- system.file(
  "extdata", "bcl11a_rs1427407_example.csv",
  package = "AlphaVaR"
)
obj <- av_import_csv(example_file)
#> Reading bcl11a_rs1427407_example.csv ...
obj$meta$active_score
#> [1] "quantile_score"

obj <- av_calc_enrichment(obj, group_by = "output_type")
names(obj$stats)
#> [1] "comparisons"

# The switch invalidates every cached result computed on the old column.
obj <- av_set_active_score(obj, "raw")
#> Switched active score: quantile_score -> raw_score. Statistics cleared.
obj$meta$active_score
#> [1] "raw_score"
length(obj$stats)
#> [1] 0