Skip to contents

Calculate EnrichmentMap's similarity metric for pathways, which is 50% Jaccard index and 50% overlap score. Function is used internally in enrichment_network_vis().

Usage

calc_similarity_metric(
  pws,
  fid_lists,
  include_metab_singletons,
  parent_pathways,
  clust1sig_collapsed,
  similarity_cutoff
)

Arguments

pws

character vector of pathway term IDs, length 2

fid_lists

named list where names are pathway terms IDs and values are lists of integers corresponding to unique feature IDs

include_metab_singletons

boolean. If TRUE, include pathways enriched only by metabolites (ome METAB) as singleton nodes

parent_pathways

named list, map of KEGG and REAC pathway term ID to parent pathway. Used to create labels for clusters of pathway enrichments. List names must correspond to values in pw_enrich_res$term_id. MotrpacRatTraining6moData::PATHWAY_PARENTS by default. If NULL, then only the pathway names are used to create cluster labels, which is quite meaningless is all pathway names are unique. In that case, it is recommended to set label_nodes to FALSE.

clust1sig_collapsed

data table of merged pathway enrichment results passed by enrichment_network_vis()

similarity_cutoff

numeric, edges are drawn between pairs of pathways if they have a similarity metric above this value

Value

numeric similarity score