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 - Only show changes (within a neighborhood) #14

Open
kastman opened this issue Jun 29, 2017 · 7 comments
Open

Feature Request - Only show changes (within a neighborhood) #14

kastman opened this issue Jun 29, 2017 · 7 comments

Comments

@kastman
Copy link

kastman commented Jun 29, 2017

Hi James,

I'm trying to compare draft reconstructions of genome scale models for closely related strains of a species. Does sbml-diff have a functionality to only print the changes (maybe with a relative neighborhood) for the models? This would really be just a first pass, "what's in my model" kind of thing. The outputs are currently very large, which is unwieldy both in time and display.

I poked around in the help and code and didn't see anything obvious, but I thought I'd ask. If not, would you be interested in PRs? Thanks,

Erik

@jamesscottbrown
Copy link
Owner

This is not currently implemented, but is a good idea. I'd welcome to receive a PR that implements this, if you have time to write one.

The original application for sbml-diff comparing models of genetic circuits in synthetic biology, which are typically quite small. It would be good to increase the size of models to which the tool can be usefully applied.

Implementation

The main sbml-diff.py script creates an object that will produces the output DOT code.

This has a generate_dot function that gets called with an argument that is an object containing the union of all features (nodes or arrows) in the all input models, annotated with a list of which models contain them.

You would need to modify this function, so that it first identifies which features are in the neighborhood of a a change, and prints DOT code only for these.

A feature is changed if it is only present in some of the models (self.num_models != len(model_set)), the stoichiometry for an arrow differs between models (stoich = '?' ), or the rate law of a reaction node differs between models (rate_law == "different").

@kastman
Copy link
Author

kastman commented Jul 3, 2017

Seems reasonable - I'll take a crack at this and let you know if I have any questions.

@jamesscottbrown
Copy link
Owner

Did you have time to try this? If so, did you get it working or encounter problems?

@kastman
Copy link
Author

kastman commented Mar 28, 2018

I don't remember why, but I added py3 compatibility (ENH_Py3 branch) and some whitespace nitpick changes that Atom did automatically, but lost progress on the project I was trying to use this for about around September and didn't have any substantial changes.

I'm definitely still interested in doing this, but I don't have the time at the moment. Are you doing a push on it now?

@kastman
Copy link
Author

kastman commented Mar 28, 2018

Also happy to rebase that since master is almost a year old. The changes were pretty small IIRC

@jamesscottbrown
Copy link
Owner

I also added py3 compatability, and made a set of changes that look pretty similar (except that I enocuntered some problem with six.StringIO, so instead use either io.StringIO and io.BytesIO depending on whether 2 or 3 is being used ).

I think this would be a useful feature, but like you I'm fairly busy with other things at the moment.

@kastman
Copy link
Author

kastman commented Apr 10, 2018

Yeah, I saw that you'd already pulled a lot of these in. Sorry that I didn't push earlier; it would've saved some work. Out of curiosity, what problems did you find with six?

Again, I agree but it looks like it'll have to wait. When I come back to metabolic modelling again I'll check in with the issue, and push earlier.

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

2 participants