register_top_value_methods.Rd
Register user-defined top-value methods
register_top_value_methods(..., validate = TRUE)
A named list of functions.
Whether validate the functions.
The user-defined function should accept one argument which is the data matrix where the scores are calculated by rows. Rows with top scores are treated as "top rows" in cola analysis. Following is how we register "SD" (standard deviation) top-value method:
register_top_value_methods(SD = function(mat) apply(mat, 1, sd))
Of course, you can use rowSds
to give a faster calculation of row SD:
register_top_value_methods(SD = rowSds)
The registered top-value method will be used as defaults in run_all_consensus_partition_methods
.
To remove a top-value method, use remove_top_value_methods
.
There are four default top-value methods:
No value is returned.
all_top_value_methods
lists all registered top-value methods.
all_top_value_methods()
#> [1] "SD" "CV" "MAD" "ATC"
register_top_value_methods(
ATC_spearman = function(mat) ATC(mat, method = "spearman")
)
all_top_value_methods()
#> [1] "SD" "CV" "MAD" "ATC" "ATC_spearman"
remove_top_value_methods("ATC_spearman")