
Filter the calculated similarities
filter_similarities.RdThis function calculates the critical value, see
calculate_critical_value() and filters subsequently all the
term pairs to the ones with a value ≥ critical value.
Arguments
- object
OntologySimclass. SeeOntologySim().- 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.
- .verbose
Boolean. Controls verbosity of the function.
Examples
# keep only term pairs above the permutation-derived critical value
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")
)
onto_obj <- OntologySim(onto, .verbose = FALSE)
onto_obj <- calculate_wang_sim_onto(
onto_obj,
weights = c(part_of = 0.8, is_a = 0.6),
.verbose = FALSE
)
onto_obj <- filter_similarities(onto_obj, alpha = 0.1, .verbose = FALSE)
head(get_results(onto_obj))
#> t1 t2 sim
#> <char> <char> <num>
#> 1: f c 0.7960848
#> 2: d b 0.7641509
#> 3: b c 0.7641509