dcConverter: Function to convert an object between graph classes

Description Usage Arguments Value Note See Also Examples

Description

dcConverter is supposed to convert an object between classes 'Onto' and 'igraph', or between 'Dnetwork' and 'igraph', or between 'Cnetwork' and 'igraph'.

Usage

1
2
dcConverter(obj, from = c("Onto", "igraph", "Dnetwork", "Cnetwork"),
to = c("igraph", "Onto", "Dnetwork", "Cnetwork"), verbose = TRUE)

Arguments

obj

an object of class "Onto", "igraph", "Dnetwork" or "Cnetwork"

from

a character specifying the class converted from. It can be one of "Onto", "igraph", "Dnetwork" and "Dnetwork"

to

a character specifying the class converted to. It can be one of "Onto", "igraph", "Dnetwork" and "Dnetwork"

verbose

logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display

Value

an object of class "Onto", "igraph", "Dnetwork" or "Cnetwork"

Note

Conversion is also supported between classes 'Onto' and 'igraph', or between 'Dnetwork' and 'igraph', or between 'Cnetwork' and 'igraph'

See Also

dcRDataLoader, Onto-class, Dnetwork-class, Cnetwork-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## 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)

dcGOR documentation built on May 2, 2019, 3:34 p.m.

Related to dcConverter in dcGOR...