# NOT RUN {
# Be careful when testing this since it involves GO similarity computation
# and might produce unpredictable results in some environments
require(GOSemSim)
require(org.Hs.eg.db)
# by GO terms
go1 = c("GO:0004022", "GO:0004024", "GO:0004023")
go2 = c("GO:0009055", "GO:0020037")
gsim1 = twoGOSim(go1, go2, type = 'go', ont = 'MF', measure = 'Wang')
print(gsim1)
# by Entrez gene id
gene1 = '241'
gene2 = '251'
gsim2 = twoGOSim(gene1, gene2, type = 'gene', ont = 'BP', measure = 'Lin')
print(gsim2)
# }
Run the code above in your browser using DataLab