get_sim_grid: Get similarity matrix of pairwise similarities of term sets.

Description Usage Arguments Details Value See Also

View source: R/term-set-sim.R


Using either an ontology_index object and numeric vector of information content per term - or a matrix of between-term similarities (e.g. the output of get_term_sim_mat), create a numeric matrix of ‘between-term set’ similarities. Either the ‘best-match-average’ or ‘best-match-product’ approach (i.e. where the 2 scores obtained by applying the asymmetric ‘best-match’ similarity function to two term sets in each order are combined by taking the average or the product respectively). Either Lin's (default) or Resnik's definition of term similarity can be used. If information_content is not specified, a default value from descendants_IC is generated.


get_sim_grid(ontology, information_content, term_sim_method, term_sim_mat,
  term_sets, term_sets2 = term_sets, combine = "average")



ontology_index object.


Numeric vector of information contents of terms (named by term)


Character string equalling either "lin" or "resnik" to use Lin or Resnik's expression for the similarity of terms.


Numeric matrix with rows and columns corresponding to (and named by) term IDs, and cells containing the similarity between the row and column term


List of character vectors of ontological term IDs.


Second set of term sets.


Character string - either "average" or "product", indicating whether to use the best-match-product' method, or function accepting two arguments - the first, the similarity matrix obtained by averaging across term sets in term_sets, and the second averaging across those in term_sets2.


Note that if any term set within term_sets has 0 terms associated with it, it will get a similarity of 0 to any other set. If you do not want to compare term sets with no annotation, take care to filter out empty sets first, e.g. by 'term_sets=term_sets[sapply(term_sets, length) > 0]'.


Numeric matrix of pairwise term set similarities.

See Also

get_term_sim_mat get_sim_p get_asym_sim_grid

ontologySimilarity documentation built on Dec. 19, 2019, 5:06 p.m.