Skip to content

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

Description

@djinnome

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions