## Not run:
# # 1) conversion between 'Onto' and 'igraph'
# # 1a) load onto.GOMF (as 'Onto' object)
# on <- dcRDataLoader('onto.GOMF')
# on
# # 1b) convert the object from 'Onto' to 'igraph' class
# ig <- dcConverter(on, from='Onto', to='igraph')
# ig
# # 1c) convert the object from 'igraph' to 'Onto' class
# dcConverter(ig, from='igraph', to='Onto')
#
# # 2) conversion between 'Dnetwork' and 'igraph'
# # 2a) computer a domain semantic network (as 'Dnetwork' object)
# g <- dcRDataLoader('onto.GOMF')
# Anno <- dcRDataLoader('SCOP.sf2GOMF')
# dag <- dcDAGannotate(g, annotations=Anno, path.mode="shortest_paths",
# verbose=FALSE)
# alldomains <- unique(unlist(nInfo(dag)$annotations))
# domains <- sample(alldomains,5) # randomly sample 5 domains
# dnetwork <- dcDAGdomainSim(g=dag, domains=domains,
# method.domain="BM.average", method.term="Resnik", parallel=FALSE,
# verbose=FALSE)
# dnetwork
# # 2b) convert the object from 'Dnetwork' to 'igraph' class
# ig <- dcConverter(dnetwork, from='Dnetwork', to='igraph')
# ig
# # 2c) convert the object from 'igraph' to 'Dnetwork' class
# dcConverter(ig, from='igraph', to='Dnetwork')
# ## End(Not run)
Run the code above in your browser using DataLab