SBRG / escher-maps

Extracted metabolic maps from simpheny/bigg1
2 stars 2 forks source link

JSON Schema for Escher maps #1

Open zakandrewking opened 9 years ago

zakandrewking commented 9 years ago

I think @draeger will be the most interested in this topic, but it's here for anyone else as well.

I've recently been working on a JSON Schema to define exactly how Escher map JSON files should be formed. The first version of that schema is here:

https://github.com/zakandrewking/escher/blob/efbf86557061749b8af572b032ab115be43e2332/escher/jsonschema/1-0-0

There are many validators that can be used to ensure that a new JSON file is correct, and these are already being used to debug Escher and to verify that maps from the BIGG export are now valid Escher files.

Here is an example of a map that conforms to the schema:

https://github.com/SBRG/escher-maps/blob/ec03793f6f8158f74c6be4d76f4d12fe78535366/1-0-0/maps/s_cerevisiae.iMM904.all_reactions.json

A neat feature is that the head of the file defines the format:

[
 {
    "map_name": "s_cerevisiae.iMM904.all_reactions",
    "map_id": "252134",
    "map_description": "All reactions in the iMM904 model.",
    "homepage": "https://zakandrewking.github.io/escher",
    "schema": "https://zakandrewking.github.io/escher/escher/jsonschema/1-0-0#"
  },
  {...}
]

A lot of @draeger's previous comments have gone into this schema, but any issues are still open to consideration. So let me know if you have time to take a look at it! We can collect any problems with the schema here, or at the main Escher rep if they are of broader interest.

-zak

draeger commented 9 years ago

Thank you, @zakandrewking. Here is again the list of problems I found recently:

zakandrewking commented 9 years ago

Hi Andreas. I've finally gotten to these issues.

I can only offer satisfying solutions for:

1. "Midmarkers being directly connected to metabolites without multimarkers in between". This can never happen in reactions built with Escher, and I add checks for those cases in my map validation function, escher.validate.validate_map().

4. "Nodes are linked to reactions through curve segments but don't have a corresponding metabolite and hence no stoichiometry information." I will also check for this, and throw out reactions that do not have stoichiometry for a drawn metabolite. I think this is the same as 5?

Do you have any suggestion for dealing with 2? Currently, I draw a one-sided reaction:

image

I do not have a good, short-term solution for 3. In the Escher Builder, it is easy to remove pieces of a reaction, and this might even be considered a feature. It would require a major reworking of the editor to disallow this kind of deletion.

zak

zakandrewking commented 9 years ago

Actually, I'm tempted to allow the connections between midmarker and metabolite, because they are quite well-behaved:

image

How would that affect your exporter?