Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathways.plot_production_envelopes() does not pass plotter to plot() #288

Open
djinnome opened this issue Nov 24, 2021 · 0 comments
Open

Comments

@djinnome
Copy link

Hi folks,

When attempting to plot the phenotypic phase plane of a predicted pathway,

import gurobipy
model=read_sbml_model('data/iMM904.xml.gz')
model.solver = 'gurobi'
from cameo.visualizations.plotting.with_plotly import PlotlyPlotter
plotter = PlotlyPlotter()
predictor = pathway_prediction.PathwayPredictor(model)
pathways = predictor.run(product='vanillin', max_predictions=3)
pathways.plot_production_envelopes(plotter=plotter, model=model, objective=model.reactions.BIOMASS_SC5_notrace)

We get the following error:

182  ppp = pathway.production_envelop(model, objective=objective)
183  ppp.plot(grid=grid, width=450, title = "Pathway %i" % (i+1))

TypeError: plot() missing 1 required positional argument: 'plotter'

PastedGraphic-1

I think the problem is that plot() needs a plotter argument:

def plot(self, plotter, grid=None, width=None, height=None, title=None, axis_font_size=None, palette=None,

So the solution would be that line 183 in :

ppp.plot(grid=grid, width=450, title="Pathway %i" % (i + 1))

needs to be:

ppp.plot(plotter=plotter, grid=grid, width=450, title = "Pathway %i" % (i+1))
djinnome added a commit to djinnome/cameo that referenced this issue Nov 24, 2021
Solving  issue biosustain#288

Thanks to @jafemm for discovering this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant