Graphs and networks largely finished.
This commit is contained in:
parent
affe00f6fb
commit
7b0142afd1
71
myScripts/Graphs_and_networks.R
Normal file
71
myScripts/Graphs_and_networks.R
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
generate_overview_graph <- function() {
|
||||||
|
sealKey()
|
||||||
|
scCCnet <- readRDS("./data/scCCnet.rds") # S. cerevisiae Cell Cycle network
|
||||||
|
scCCnet_ns <- scCCnet[-3] # Remove scores
|
||||||
|
graph <- igraph::graph_from_edgelist(as.matrix(scCCnet_ns), directed = FALSE)
|
||||||
|
degrees <- igraph::degree(graph, normalized = TRUE)
|
||||||
|
graphxy <- igraph::layout_with_graphopt(graph, charge=0.30, mass=30)
|
||||||
|
|
||||||
|
# Generate color palette:
|
||||||
|
colors = heat.colors(
|
||||||
|
max(igraph::degree(graph)+1)
|
||||||
|
)[igraph::degree(graph)+1]
|
||||||
|
|
||||||
|
plot(
|
||||||
|
graph,
|
||||||
|
layout=graphxy,
|
||||||
|
rescale=TRUE, # Default is true, explicit as reminder.
|
||||||
|
vertex.size = (125 * degrees),
|
||||||
|
vertex.color = colors,
|
||||||
|
vertex.label=NA
|
||||||
|
)
|
||||||
|
|
||||||
|
legend(
|
||||||
|
"topright",
|
||||||
|
legend=c(max(igraph::degree(graph)), 0),
|
||||||
|
fill=c(colors[which.max(igraph::degree(graph))], colors[1]),
|
||||||
|
title = "Degrees"
|
||||||
|
)
|
||||||
|
sealKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
generate_log_freq_vs_log_rank <- function() {
|
||||||
|
sealKey()
|
||||||
|
scCCnet <- readRDS("./data/scCCnet.rds") # S. cerevisiae Cell Cycle network
|
||||||
|
scCCnet_ns <- scCCnet[-3] # Remove scores
|
||||||
|
graph <- igraph::graph_from_edgelist(as.matrix(scCCnet_ns), directed = FALSE)
|
||||||
|
degrees <- igraph::degree(graph, normalized = FALSE)
|
||||||
|
freqs <- table(degrees)
|
||||||
|
scatter.smooth(log10(as.numeric(names(freqs)) + 1),
|
||||||
|
log10(as.numeric(freqs)), type = "b",
|
||||||
|
bg = "#A5F5CC",
|
||||||
|
xlab = "log(Rank)", ylab = "log(frequency)",
|
||||||
|
main = "Log Frequency against Log-Rank")
|
||||||
|
sealKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get_top_degrees <- function(n = 5) {
|
||||||
|
sealKey()
|
||||||
|
scCCnet <- readRDS("./data/scCCnet.rds") # S. cerevisiae Cell Cycle network
|
||||||
|
scCCnet_ns <- scCCnet[-3] # Remove scores
|
||||||
|
graph <- igraph::graph_from_edgelist(as.matrix(scCCnet_ns), directed = FALSE)
|
||||||
|
degrees <- igraph::degree(graph, normalized = FALSE)
|
||||||
|
|
||||||
|
sorted_degrees <- degrees[order(degrees)]
|
||||||
|
sealKey()
|
||||||
|
tail(sorted_degrees, n)
|
||||||
|
}
|
||||||
|
|
||||||
|
get_bot_degrees <- function(n = 5) {
|
||||||
|
sealKey()
|
||||||
|
scCCnet <- readRDS("./data/scCCnet.rds") # S. cerevisiae Cell Cycle network
|
||||||
|
scCCnet_ns <- scCCnet[-3] # Remove scores
|
||||||
|
graph <- igraph::graph_from_edgelist(as.matrix(scCCnet_ns), directed = FALSE)
|
||||||
|
degrees <- igraph::degree(graph, normalized = FALSE)
|
||||||
|
|
||||||
|
sorted_degrees <- degrees[order(degrees)]
|
||||||
|
sealKey()
|
||||||
|
head(sorted_degrees, n)
|
||||||
|
}
|
||||||
|
|
2
myScripts/genome_annotation.R
Normal file
2
myScripts/genome_annotation.R
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Integrator Unit: Genome Annotation
|
||||||
|
bio3d::get.seq()
|
BIN
myScripts/graphs_and_networks_logs.png
Normal file
BIN
myScripts/graphs_and_networks_logs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
myScripts/graphs_and_networks_overview.png
Normal file
BIN
myScripts/graphs_and_networks_overview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
Loading…
Reference in New Issue
Block a user