Hi everyone! I was hoping someone could help me visualizing a minimum spanning tree. The code works but I do not know how to choose some arguments. I have my data (genomics data from bacterial genomes) and I made a distance matrix. I then used this code to make the plot:
mst_tree <- igraph::graph.adjacency(distance_matrix,
weighted = TRUE) %>%
igraph::mst() %>%
as_tbl_graph() %>%
activate(nodes)
ggraph(mst_tree, layout = 'stress') +
geom_edge_link() +
geom_node_point(color = 'steelblue', size = 7) +
geom_node_text(aes(label = name)) +
labs(title = 'cgMLST') +
theme_graph()
It works as expected and I get a nice tree. However, I am not very familiar with network analysis and visualization. The main doubt I have is with the layout argument in the ggraph() function. I simply do not know how to choose it. I tested few of the available layouts from igraph and at the end I decided to use 'stress' here based purely on the appearance of the final tree. However, I was wondering whether there is a proper/more scientific way to choose the layout. I looked for the descriptions of few of the layouts and I get the main idea of what they do but still do not know what the best or more appropriate one is for my data. I would appreciate some help or pointing out some comprehensive literature about it. Thank you