DCD (version 0.1.0)

DCD: Differential Community Detection for Paired Biological Networks, for e.g. case vs control

Description

The task of identifying differential sub-networks in paired biological networks (A:control,B:case) can be re-phrased as one of finding dense communities in a single noisy differential topological (DT) graph constructed by taking absolute difference between the topological graphs of A and B. In this software, we propose a fast three-stage approach, namely Differential Community Detection (DCD), to identify differential sub-networks as differential communities in a de-noised version of the DT graph. In the first stage, we iteratively re-order the nodes of the DT graph to determine approximate block diagonals present in the DT adjacency matrix using neighbourhood information of the nodes and Jaccard similarity. In the second stage, the ordered DT adjacency matrix is traversed along the diagonal to remove all the edges associated with a node, if that node has no immediate edges within a window. Finally, we apply community detection methods on this de-noised DT graph to discover differential sub-networks as communities.

Usage

DCD(g_A = sample_grg(200, 0.15, torus = FALSE, coords = FALSE),
    g_B = permute(g_A, c(sample(20), 21:200)), method = "Louvain",
    mink = 7, ground_truth = c(rep(1, 20), rep(0, 180)),
    plot_flag = 1, color = "blue", iter = 1, cores = 1)

Arguments

g_A

Igraph object representing graph A

g_B

Igraph object representing graph B

method

Community detection method can be either: "Louvain", "Infomap" or "Spectral", default "Louvain".

mink

Minimum number of nodes for a community to be considered differential community, default 7.

ground_truth

In case ground truth community information is available i.e. which nodes are part of differential communities and which are not. For example in 2 networks comprising 1000 nodes, if first 100 nodes are differential then ground_truth = c(rep(1,100),rep(0,900)).

plot_flag

Makes a precision recall plot if plot_flag=1 when ground_truth is available, else set plot_flag to 0.

color

Colour for the area under precision recall curve. Can be "blue", "black", "red" etc.

iter

No of iterations of experiment to run, default iter = 1.

cores

No of cores to use to calculate the Jaccard co-efficient in parallel for the hub node during each iteration of the greedy block diagonal identification approach.

Value

Returns a data frame with NodeIds and Predicted_Label columns. The Predicted_Label corresponds to the Differential ClusterId a node belongs to . All nodes with Predicted_Label = 0 are non-differential nodes or are nodes which are not part of any differential community.

References

Rpack:bibtexRdpack

See Also

get_ordered_community_output, calculate_jaccard, order_topological_matrix, prune_edges

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
<!-- %%DCD Example 1 Run%% -->
# }
# NOT RUN {
DCD_output <- DCD()
# }
# NOT RUN {
<!-- %%DCD Example 2 %% -->
# }
# NOT RUN {
library(igraph)
g_A <- sample_grg(200, 0.15, torus=FALSE, coords = FALSE)
g_B <- permute(g_A,c(sample(20),21:200))
ground_truth <- c(rep(1,20),rep(0,180))
DCD_output2 <- DCD(g_A = g_A, g_B = g_B, method = "Spectral", mink = 7,
                   ground_truth = ground_truth, plot_flag = 1, color = "red",
                   iter = 1, cores = 1 )
  
# }

Run the code above in your browser using DataLab