overlap_coefficient {phoenics}R Documentation

Calculate overlap coefficient between pathways

Description

Calculate overlap coefficient between pathways

Usage

overlap_coefficient(pathwayA, pathwayB, pathways = NULL, organism = NULL)

Arguments

pathwayA

a character string of pathway name or pathway code or a character vector of metabolite names or metabolite codes

pathwayB

a character string of pathway name or pathway code or a character vector of metabolite names or metabolite codes

pathways

data.frame or matrix with metabolites in rows and the following information in columns:

  • metabolite_code metabolite code

  • metabolite_name metabolite name

  • pathway_code pathway code (identifier)

  • pathway_name name of the pathway

Used if pathwayA and pathwayB are pathway names or pathway codes.

organism

organism code in KEGG database. Required if pathways = NULL and pathwayA and pathwayB are pathway names and ignored otherwise.

Value

A value between 0 and 1 calculated with the formula:

\text{OC}(A,B) = \frac{\vert A \cap B \vert}{\min(\vert A \vert, \vert B \vert)}

An overlap coefficient of 1 means that one pathway is included in the other. An overlap coefficient of 0 means that there is no overlap between the pathways.

References

Wieder C., Lai R.P.J., Ebbels T.M.D. (2022). Single sample pathway analysis in metabolomics: performance evaluation and application. BMC Bioinformatics, 23, 481. doi:10.1186/s12859-022-05005-1

Examples

data("MTBLS422")
pathwayA <- "Galactose metabolism"
pathwayB <- "Vitamin digestion and absorption"
overlap_coefficient(pathwayA, pathwayB, pathways)

if (requireNamespace("KEGGREST", quietly = TRUE)) {
  pathwayA <- "Galactose metabolism"
  pathwayB <- "Vitamin digestion and absorption"
  
  overlap_coefficient(pathwayA, pathwayB, organism = "mmu")
  
}

pathwayA <- "mmu00052"
pathwayB <- "mmu00562"
overlap_coefficient(pathwayA, pathwayB, pathways)

pathwayA <- c("C00029", "C00116", "C00137", "C00794", "C00984", "C01697")
pathwayB <- c("C00191", "C00092", "C00137")
overlap_coefficient(pathwayA, pathwayB)


[Package phoenics version 0.3 Index]