jaccard_dist: Jaccard Distance.

Description Usage Arguments Details Value Author(s) Examples

Description

jaccard_dist calculates the pairwise distance of genes in an interaction network.

Usage

1
jaccard_dist(gene1, gene2, graph)

Arguments

gene1

Character, HGNC symbol of the first gene.

gene2

Character, HGNC sysmbol of the second gene

graph

igraph object representing the network

Details

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.

Value

Numeric, distance score

Author(s)

Rachel Silverstein (aut)

Examples

 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)

hyginn/BCB420.2019.ESA documentation built on May 29, 2019, 1:23 p.m.