When making a model diagram for a report, what tool do you use? I know that I can use
dia in LaTeX,
igraph in R/rmarkdown, or PowerPoint for Word-based reports; or I can use a generic drawing tool like Inkscape. I’m wanting to up my game, and I’m curious how others are doing it.
Ideally, the diagram would automatically update based on the model (I know that this is a hard problem) or be linked to the model file in some way (maybe as a comment), and be simple to both make and integrate into the report.
Are you familiar with the modelviz R package? I initiated this project a couple years ago to automatize diagram generation and improve their informativeness. I haven’t had the chance to work on it lately but the my idea is to have it as an xpose add on in the future.
I’ll give my two cents from the systems modeling perspective (more of a rant than a helpful reply though, but maybe it will spur some replies)… We haven’t found a great solution. And it would be really great for something better to exist.
Just for report purposes, we used
dia in the past, but I have a lot of problems keeping it running on my Mac. Lately, we’ve been using
Omnigraffle, which makes nice flowcharts, but requires us to update the diagram manually and is pretty expensive for a little more functionality than PowerPoint.
For actively-maintained systems, which generate the model from the diagram itself, I’ve only ever used Mathworks’
SimBiology. However, I am not actively using that package and was never able to use their diagrams in a report, which is probably a large reason why I do not use it. I have no experience with Wolfram’s
SystemsModeler. The Entelos software used to generate a diagram that was good enough to stick in reports, but that software’s time has passed.
Hi Ben and Ted,
@guiastrennec, I wasn’t familiar with modelviz, and it looks a lot like what I’m looking for! I just tried it out, and it doesn’t seem to work with the current version of
DiagrammeR (“Error: ‘set_global_graph_attrs’ is not an exported object from ‘namespace:DiagrammeR’”). Do you have any plans for an update? (I’ll play around a bit, and you may see a pull request from me if I get something working.) Looking at the structure of the example figures, it doesn’t seem to require NONMEM. Other than naming conventions (and the name “advan” being in the list) is there a reason it requires NONMEM or can it be more general?
@Theodore_Rieger, I feel your pain. My first solution would need to be something that made figures simple to generate (modelviz looks like it may have a lot of my needs covered there) and ideally allows for simple modification of the structure for clarity without requiring specifying everything. For example, I’d like to have it make a default model with a minimal specification and then shift things around a bit for clarity without having to specify everything (e.g. if I have a PK and a PD model, perhaps I want to set the location of the compartments connecting PK and PD with automatic layout of the other compartments).
@bdenney I am glad you liked modelviz. I unfortunately do not have time for R development at the moment. If I see an interest in this project I might revive it but up to this point this was just a proof of concept (hence the focus on NONMEM). But it should be possible to easily work with other modeling software thanks to an xpose integration to grab the parameter table and parse labels.
Seeing this post reminded me of a set of functions I created a couple of years ago to animate PBPK simulations using ggplot. I decided to package up the functions in case you may find them useful (https://github.com/mhismail/ggdiagram). Unfortunately the diagrams do not update based on a specific model, but have the benefit of being able to be highly customized. See an example animation below.
Thanks for sharing! There appear to be several good solutions out there each with a slightly different focus. While looking around in the interim, I also found ggraph (https://github.com/thomasp85/ggraph/) to be a potentially useful option.
Each method has a somewhat different focus and I can see choosing each when looking for different solutions.
(And, if anyone else has another suggestion, I’m interested to hear more!)