Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# AIGO.Similarity.GOSet_PWSimilarity

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
```Calculates pairwise semantic similarity scores between two given annotation sets
```

```        def GOSet_PWSimilarity(G, GO1, GO2, metric="GS2", **kargs):
"""
Calculates pairwise semantic similarity scores between two given annotation sets
"""

if metric=="GS2":
sim, l=G.GS2([G.GOtoInt(GO1), G.GOtoInt(GO2)])
elif metric=="CzekanowskiDice":
sim = G.CzekanowskiDice(G.GOtoInt(GO1), G.GOtoInt(GO2))
l=[sim,sim]
elif metric=="Resnik":
sim,l = G.Resnik(G.GOtoInt(GO1), G.GOtoInt(GO2), kargs.get('IC', dict()))
else:
logger.handleWarning ("Sorry, unknown semnatic similarity %s " % metric)
sim,l=None,None

return sim, l
```

```
from AIGO import allAspect, logger, logFun
from AIGO.Similarity import GOSet_PWSimilarity

class CompareFA(dict):
```
```                D=dict()
for g in commonGene:
sim,l=GOSet_PWSimilarity(FA1.G, FA1.GPtoGO[aspect][g], FA2.GPtoGO[aspect][g])
D[g]=(l[0],l[1])

```