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

Feature Request: Wrapper around cobrapy to allow simultaneous editing. #203

Closed
ChristianLieven opened this issue Oct 3, 2017 · 3 comments

Comments

@ChristianLieven
Copy link

ChristianLieven commented Oct 3, 2017

Hi @zakandrewking ,

I was wondering if it was possible to implement a way for Escher to wrap around a model object in cobrapy or cameo, such that if one makes changes to the model, they are reflected in the map too.

For example, let's say I'm reconstructing a model from scratch and I wanted to build an Escher map alongside. I would always have to work on the model first, then stop, load it into Escher, layout the reactions and then continue with working on the model. And later, once the draft is reconstructed, if I needed to change let's say IDs or reaction-directionality, I would have to do this in the model and the escher map separately. So my suggestion would be some form of wrapping that captures certain operations done in cobrapy and replicates them in Escher.

Here is a bit of mock-up code to illustrate how this could look like:

from cobrapy.io.json import read_json_model

model = read_json_model('SOMEMODEL.json')
wrapper = Wrapper(model)
builder = Builder(map_json='SOMEMAP.json', model=wrapper)
builder.display_in_browser()

wrapper.add_reaction('MDH')

wrapper.reaction.MDH.id = 'MNXR101439'
@zakandrewking
Copy link
Owner

This would be fantastic. I have been thinking about the kinds of features we would want if we re-wrote the Python package for Escher. Right now, we are using an old-school approach for embedding Escher in Jupyter, and the data only goes in one direction. But now, with Jupyter Widgets, we could implement two-way bindings like you describe.

It would take some work, but I'm excited to see it happen. I added it to our roadmap:

https://github.com/zakandrewking/escher/wiki/Development-Roadmap

@z-haiman has expressed interest in helping out.

@ChristianLieven
Copy link
Author

Awesome! Looking forward to see what you guys come up with!

@zakandrewking
Copy link
Owner

zakandrewking commented Feb 20, 2018

As further support for this task, the current approach used by Escher-Python is not supported in JupyterLab:

screen shot 2018-02-20 at 9 39 57 am

@zakandrewking zakandrewking added this to the 1.7 milestone Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants