nlmixr2 / nlmixr2plot

Plotting support for nlmixr2
https://nlmixr2.github.io/nlmixr2plot/
GNU General Public License v3.0
2 stars 0 forks source link

Feature Brainstorm: Automatic model diagrams #10

Open billdenney opened 2 years ago

billdenney commented 2 years ago

Automatic model diagrams would be hard to get right, but I think that we could possibly get close (good enough for most reports and giving the user something to work from in any case). This will be oriented toward PK/PD models, and it should work okay with PK combined to a single PD model, I think.

Here is how I'm thinking of it:

I think that all of this could be automated. The way that I'm doing it right now would add dependencies of tidygraph and ggraph.

An example is in https://github.com/thomasp85/ggraph/issues/316#issuecomment-1152972487

mattfidler commented 2 years ago

I had this feature when I first started working with rxode but used regular expressions. I thought if was to fragile. I thinj if we do it it should be with parsing.

mattfidler commented 2 years ago

Should it be in nlmixr2plot?

billdenney commented 2 years ago

@mattfidler , Good point that it should be in nlmixr2plot. I moved the issue.

I think that it can be done with parsing and that it can be robust for what it does. As I'm thinking about it now, there will be some specific limitations about how the model equations will have to be formatted. It should be possible to loosen those with time.

mattfidler commented 2 years ago

Perhaps this can also be looked at in another direction. Using shiny+diagram to create models. It would be less fragile? And perhaps more useful for some...

billdenney commented 2 years ago

Once we have the ability to make a graph (in the "set of nodes and vertices" sense), it should be straight-forward to visualize the diagram in many different ways. To me, the fragility will be in the creation of the graph.