Description Usage Arguments Details Value Author(s) Examples
jaccard_dist
calculates the pairwise distance of genes in an interaction network.
1 | jaccard_dist(gene1, gene2, graph)
|
gene1 |
Character, HGNC symbol of the first gene. |
gene2 |
Character, HGNC sysmbol of the second gene |
graph |
igraph object representing the network |
Jaccard similarity of 2 nodes in the gene network is calculated. Jaccard similarity is the number of common neighbors divided by the number of vertices that are neighbors of at least one of the 2 nodes. Distance is then obtained by taking 1 - similarity.
Numeric, distance score
Rachel Silverstein (aut)
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
STRING <- fetchData("STRINGedges0.8")
# convert the STRINGedges object into an igraph object
if (requireNamespace("igraph")) {
STRINGgraph <- igraph::graph_from_edgelist(as.matrix(STRING[,1:2]))
} else {
cat("igraph is required for this example")
}
# calculate the Jaccard network distance between "BRCA1" and "BRCA2"
jaccard_dist("BRCA1", "BRCA2", STRINGgraph)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.