calcHpSim: Compare HP terms based on semantic similarity

Description Usage Arguments Value Author(s) See Also Examples

View source: R/calcHpSim.R

Description

This function compares 2 HP terms based on provided Information Content and ancestors

Usage

1
calcHpSim(term1, term2, method = c("Resnik"), IC, ancestors)

Arguments

term1

one of the HP term to compare

term2

the other HP term to compare

method

the method for computing semantic simalirity (default: "Resnik" returns the IC of the MICA: Most Informative common ancestor)

IC

a named vector of Information Content by HP term

ancestors

a named list of ancestors by HP term

Value

A numeric value

Author(s)

Patrice Godard

See Also

compareHPSets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Prerequisite
data(geneByHp, hp_descendants, package="PCAN")
geneByHp <- unstack(geneByHp, entrez~hp)
ic <- computeHpIC(geneByHp, hp_descendants)

## Compute similarity between different couples of HP terms
data(hp_ancestors, hpDef, package="PCAN")
hp1 <- "HP:0000518"
hp2 <- "HP:0030084"
hp3 <- "HP:0002119"
hp4 <- "HP:0001305"
hpDef[which(hpDef$id %in% c(hp1, hp2)), 1:2]
calcHpSim(hp1, hp2, IC=ic, ancestors=hp_ancestors)
hpDef[which(hpDef$id %in% c(hp2, hp3)), 1:2]
calcHpSim(hp2, hp3, IC=ic, ancestors=hp_ancestors)
hpDef[which(hpDef$id %in% c(hp2, hp4)), 1:2]
calcHpSim(hp2, hp4, IC=ic, ancestors=hp_ancestors)
hpDef[which(hpDef$id %in% c(hp3, hp4)), 1:2]
calcHpSim(hp3, hp4, IC=ic, ancestors=hp_ancestors)

Example output

Loading required package: BiocParallel
             id         name
401  HP:0000518     Cataract
9645 HP:0030084 Clinodactyly
[1] 0
             id             name
1601 HP:0002119 Ventriculomegaly
9645 HP:0030084     Clinodactyly
[1] 0
             id                      name
1012 HP:0001305 Dandy-Walker malformation
9645 HP:0030084              Clinodactyly
[1] 0.713151
             id                      name
1012 HP:0001305 Dandy-Walker malformation
1601 HP:0002119          Ventriculomegaly
[1] 2.850015

PCAN documentation built on Nov. 8, 2020, 6:47 p.m.