Skip to content

Latest commit

 

History

History
105 lines (86 loc) · 2.24 KB

README.md

File metadata and controls

105 lines (86 loc) · 2.24 KB

RENDOR method for removing indirect noise

Reverse network diffusion to remove indirect noise for better inference of gene regulatory networks.

Authors

Pipeline

Logo


Installation

You can install the development version of RENDOR like so:

devtools::install_github("Wu-Lab/RENDOR")

Example

This is a basic example which shows you how to solve a common problem:

library(RENDOR)
mat <- matrix(runif(100), nrow = 10)
m <- 5
denoised_network <- RENDOR(mat, m)

Here is a more comprehensive example using the load_example_data function, which includes example data from the paper:

library(ggplot2)
library(RENDOR)
library(igraph)

# Load example data
example_A <- load_example_data()
# Original graph
g1 <- graph_from_adjacency_matrix(example_A$True_net, mode = 'undirected')
e1 <- length(E(g1))
E(g1)$color <- 'black'
plot(
  g1,
  edge.width = 2,
  vertex.color = "#56B4E9",
  main = 'Original Graph',
  vertex.label.cex = 0.8,
  vertex.size = 20,
  layout = layout_in_circle(g1)
)

Logo

# Noisy graph
g2 <- graph_from_adjacency_matrix(example_A$Noisy_net, mode = 'undirected')
g2 <- g1 + edge(c(t(as_edgelist(g2 - g1))), color = '#EE2C2C')
plot(
  g2,
  edge.width = 2,
  vertex.color = "#56B4E9",
  main = 'Noisy Graph',
  vertex.label.cex = 0.8,
  vertex.size = 20,
  layout = layout_in_circle(g2)
)

Logo

# RENDOR denoising
w_out <- RENDOR(example_A$Noisy_net, 3, 1, 1)
A_out <- change_into_adj_keep_edges(w_out, e1)
g3 <- graph_from_adjacency_matrix(A_out, mode = 'undirected')
E(g3)$color <- 'black'
e3 <- length(E(g3))
g3 <- g1 - (g1 - g3) + edge(c(t(as_edgelist(g3 - g1))), color = '#EE2C2C')
plot(
  g3,
  edge.width = 2,
  vertex.color = "#56B4E9",
  main = 'RENDOR Denoised Graph',
  vertex.label.cex = 0.8,
  vertex.size = 20,
  layout = layout_in_circle(g3)
)

Logo