euba / BacArena

agent based modelling
GNU General Public License v3.0
26 stars 11 forks source link

Cross-feeding plot customization #145

Closed tenguzame closed 5 years ago

tenguzame commented 5 years ago

Greetings, I'm exploring your interesting piece of software, and I'm finding it quite useful for my own line of research. I'm writing to ask whether there's a chance to give users the capability for customizing the igraphs produced by the FindFeeding modules. In some cases it seems that I'm looking at some kind of yarn ball, and it's hard to discern the feeding pathways among the organisms in my simulations. Best regards

euba commented 5 years ago

Hi,

If you use findFeeding3 you also export a data.frame (it's the first element of the returned list) with all the relevant information so that you can make your own igraph plot:

library(BacArena)
library(igraph)

data("sihumi_test")
ff3 = findFeeding3(sihumi_test, time=5, mets=c("EX_lac_D(e)","EX_etoh(e)"))
ffdata = ff3[[1]]

Then you can reformat the data and plot with igraph:

g <- graph.data.frame(ffdata[,1:2], directed=TRUE)
plot(g)

Hope this helps.

Best, Eugen

jotech commented 5 years ago

please reopen if still relevant