from_list_to_df: Tidy-up a list of wTO scores, as given by wTO.network

Description Usage Arguments Examples

View source: R/bowtie_functions.R

Description

Tidy up a list of wTO scores, returning a complete pairwise matrix

Usage

1
from_list_to_df(score_list)

Arguments

score_list

A list containing three vectors: The names of node1, names of node2 and pairwise wTO scores

Examples

 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))

k-niss/bowtie documentation built on March 10, 2020, 10:10 a.m.