
Calculates the critical value
calculate_critical_value.RdThis function calculates the critical value for a given ontology similarity matrix.
Arguments
- x
Numerical matrix or
OntologySimclass, seeOntologySim(). This function tends to be slower on matrices compared to theOntologySimclass.- alpha
Float. The alpha value. For example, 0.001 would mean that the critical value is smaller than 0.1 percentile of the random permutations.
- permutations
Number of random permutations.
- seed
Integer. For reproducibility purposes
Examples
# critical value of a Wang similarity matrix at alpha 0.1
onto <- data.table::data.table(
parent = c("a", "b", "b", "b", "c"),
child = c("b", "c", "d", "e", "f"),
type = c("part_of", "part_of", "part_of", "is_a", "is_a")
)
weights <- c(part_of = 0.8, is_a = 0.6)
sim_mat <- calculate_wang_sim_mat(onto, weights = weights)
calculate_critical_value(sim_mat, alpha = 0.1)
#> [1] 0.7641509