order_topological_matrix: Order the noisy differential topological adjacency matrix

Description Usage Arguments Value Author(s) References See Also Examples

Description

First step of DCD approach. Orders the noisy differential topological adjacency matrix to generate approximate block diagonals.

Usage

1

Arguments

A

Noisy differential topological adjacency matrix

mink

Minimum size of a community for it to be considered differential, default value is 7.

Value

Returns an ordered list for nodeids, by using which the noisy differential matrix is ordered such that it consists of approximate block diagonals.

Author(s)

Raghvendra Mall <rmall@hbku.edu.qa>

References

\insertRef

Rpack:bibtexRdpack

See Also

calculate_jaccard

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
31
32
33
34
35
#Get ordered list for approximate block diagonals
library(igraph)
library(WGCNA)
g_A <- sample_grg(200, 0.15, torus=FALSE, coords = FALSE)
A <- get.adjacency(g_A)
g_B = permute(g_A,c(sample(20),21:200))
B <- get.adjacency(g_B)

cosine_sim_A <- TOMsimilarity(as.matrix(A),TOMType = "unsigned",TOMDenom = "min");
cosine_sim_B <- TOMsimilarity(as.matrix(B),TOMType = "unsigned",TOMDenom = "min")
edgelist_A <- get.edgelist(g_A);
edgelist_B <- get.edgelist(g_B);
if (is.null(E(g_A)$weight))
{
  edgelist_A <- cbind(edgelist_A,rep(1,nrow(edgelist_A)));
}else
{
  edgelist_A <- cbind(edgelist_A,E(g_A)$weight);
}
if (is.null(E(g_B)$weight))
{
  edgelist_B <- cbind(edgelist_B,rep(1,nrow(edgelist_B)));
}else
{
  edgelist_B <- cbind(edgelist_B,E(g_B)$weight);
}
edgelist_A <- as.data.frame(edgelist_A);
edgelist_B <- as.data.frame(edgelist_B);

mink <- 7
#Noisy Difference in topological matrices
diff_topological_matrix <- abs(cosine_sim_A-cosine_sim_B);

#Order the nodes in topological graph using greedy approach
ordered_list <- order_topological_matrix(diff_topological_matrix,mink);

DCD documentation built on May 2, 2019, 9:29 a.m.