LCC_Significance: LCC Significance

View source: R/LCC_Significance.R

LCC_SignificanceR Documentation

LCC Significance

Description

Calculates the Largest Connected Component (LCC) from a given graph, and calculates its significance using a degree preserving approach. Menche, J., et al (2015) <doi.org:10.1126/science.1065103>

Usage

LCC_Significance(
  N = N,
  Targets = Targets,
  G,
  bins = 100,
  hypothesis = "greater",
  min_per_bin = 20
)

Arguments

N

Number of randomizations.

Targets

Name of the nodes that the subgraph will focus on - Those are the nodes you want to know whether if forms an LCC.

G

The graph of interest (often, in NetMed it is an interactome - PPI).

bins

the number os bins for the degree preserving randomization. When bins = 1, assumes a uniform distribution for nodes.

hypothesis

are you expecting an LCC greater or smaller than the average?

min_per_bin

the minimum size of each bin.

Value

a list with the LCC - $LCCZ all values from the randomizations - $mean the average LCC of the randomizations - $sd the sd LCC of the randomizations - $Z The score - $LCC the LCC of the given targets - $emp_p the empirical p-value for the LCC - $rLCC the relative LCC

Examples

set.seed(666)
net  = data.frame(
Node.1 = sample(LETTERS[1:15], 15, replace = TRUE),
Node.2 = sample(LETTERS[1:10], 15, replace = TRUE))
net$value = 1
net =  CoDiNA::OrderNames(net)
net = unique(net)

g <- igraph::graph_from_data_frame(net, directed = FALSE )
plot(g)
targets = c("I", "H", "F", "E")
 LCC_Significance(N = 100,
                   Targets = targets,
                                    G = g,
                                  bins = 1,
                                  min_per_bin = 2)



NetSci documentation built on July 4, 2022, 1:05 a.m.