Skip to content
May 14, 2012 / tninja1980msn

miR2net.org

Build the graph and show some basic statistics

Load the data, create graph using “igraph” package

The vertex type distribution

# basic statistics of this graph
# vertics types
library(stringr)
vertex <- V(g)
print(ascii(transform(ddply(transform(data.frame(vertex=vertex$name), type=ifelse(str_detect(vertex, 'hsa-'), 'microRNA', 'Gene')), .(type), summarise, n=length(type)), percent=sprintf('%.1f%%', n*100/sum(n))), include.rownames=F, digits=0, caption='regulator type distribution'), type='org')
regulator type distribution
type n percent
Gene 9532 98.1%
microRNA 180 1.9%

Edge type distribution

# edge types
library(plyr)
library(ascii)
print(ascii(transform(ddply(reg2tar, .(type), summarise, n=length(type)), percent=sprintf('%.1f%%', n*100/sum(n))), include.rownames=F, digits=0, caption='regulation type distribution'), type='org')
regulation type distribution
type n percent
mir2gene 516 2.7%
tf2gene 18455 95.3%
tf2mir 403 2.1%

Render the network

Render MYC network

# generate the subgraph
nodes.name <- c('MYC')
nodes.id <- which(V(g)$name %in% nodes.name) - 1
neighbor.nodes <- neighbors(g, v=nodes.id)
g.sub <- subgraph(g, c(nodes.id, neighbor.nodes))

# plot it
library(stringr)
plot(g.sub, layout=layout.fruchterman.reingold, vertex.size=ifelse(str_detect(V(g)$name, 'hsa-'), 3, 6), vertex.label=V(g.sub)$name, vertex.color=ifelse(str_detect(V(g)$name, 'hsa-'), 'pink', 'lightblue'), edge.color=ifelse(E(g.sub)$coef > 0, 'red', 'green'))

https://tninja1980msn.files.wordpress.com/2012/05/wpid-mycnetwork.pdf

Render TP53 network

# generate the subgraph
nodes.name <- c('TP53')
nodes.id <- which(V(g)$name %in% nodes.name) - 1
neighbor.nodes <- neighbors(g, v=nodes.id)
g.sub <- subgraph(g, c(nodes.id, neighbor.nodes))

# plot it
library(stringr)
plot(g.sub, layout=layout.fruchterman.reingold, vertex.size=ifelse(str_detect(V(g)$name, 'hsa-'), 3, 6), vertex.label=V(g.sub)$name, vertex.color=ifelse(str_detect(V(g)$name, 'hsa-'), 'pink', 'lightblue'), edge.color=ifelse(E(g.sub)$coef > 0, 'red', 'green'))

https://tninja1980msn.files.wordpress.com/2012/05/wpid-tp53network.pdf

Render the whole network

Not able to do it since it just run out of my RAM (3-4G).

Potential solutions:

  • It require some time to build a R-cytoscape pipeline to render it on low-RAM machine.
  • Use a high-performance computer, for example, Amazon EC2 Large RAM Ultra-Large Instance is required for this job.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: