How can we reflect Fruchterman-Reingold layout using Cytoscape? I cannot replicate the Fruchterman-Reingold layout figure from igraph using Cytoscape.
library(RCy3)
library(igraph)
library(ggraph)
library(tidygraph)
library(RColorBrewer)
actors <- data.frame(name=c("Alice", "Bob", "Cecil", "David",
"Esmeralda"),
age=c(48,33,45,34,21),
gender=c("F","M","F","M","F"))
relations <- data.frame(from=c("Bob", "Cecil", "Cecil", "David",
"David", "Esmeralda"),
to=c("Alice", "Bob", "Alice", "Alice", "Bob", "Alice"),
same.dept=c(FALSE,FALSE,TRUE,FALSE,FALSE,TRUE),
weight=c(4,5,5,2,1,1), advice=c(4,5,5,4,2,3))
ig <- graph_from_data_frame(relations, directed=F, vertices=actors)
coul <- brewer.pal(2, "Set1")
my_color <- coul[as.numeric(as.factor(V(ig)$gender))]
coords <- layout.fruchterman.reingold(ig)
plot(ig,layout=coords, vertex.color=my_color)
cytoscapePing()
createNetworkFromIgraph(ig,"myIgraph")
layoutNetwork('fruchterman-rheingold gravity_multiplier=1 nIterations=100')