Description Usage Arguments Examples
View source: R/bowtie_functions.R
Tidy up a list of wTO scores, returning a complete pairwise matrix
1 | from_list_to_df(score_list)
|
score_list |
A list containing three vectors: The names of node1, names of node2 and pairwise wTO scores |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Create graph
random_graph = sample_pa(n=200, power = 1.2, directed=F)
E(random_graph)$weight = runif(n=length(E(random_graph)))
# Calculate wTO
wTO_list = bowtie::wTO.network(node_vector = as.vector(V(random_graph)), igraph_object = random_graph, thread_numb = 4)
wTO_matrix = bowtie::from.list.to.df(wTO_list)
# Ordering of nodes
hclust_object = hclust(as.dist(1-wTO_matrix), method = 'average')
node_order = hclust_object$labels[hclust_object$order]
# Visualize
image(wTO_matrix[node_order,node_order], useRaster = T, col = colorRampPalette(brewer.pal(9,"YlGnBu"))(49))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.