|
From: Haoran Yu <hal...@gm...> - 2017-07-14 07:09:03
|
Sorry for not attaching the links to the Figures, here are the links in case the Figures don't shown up in the previous email. Figure 1 <https://1.bp.blogspot.com/-fs90lVuf2xw/WVypEN9zJGI/AAAAAAAAGfY/gsEbiGH228w9ocY1hgg0v7cDlwxpkllQgCLcBGAs/s320/or-simple.png> Figure 2 <https://2.bp.blogspot.com/-u_5AitRQqfw/WVypIP5Rz0I/AAAAAAAAGfc/CeQGeo3Ua6gOmDqT8KJeuvbj_-ze3_ddQCLcBGAs/s1600/or-simple-new.png> Figure 3 <https://4.bp.blogspot.com/-gmKV5sxzvbs/WWhtqdAzU_I/AAAAAAAAGiY/Rx1m2l5Z9Gw5aXIUmJn9tdg75udVW-R_wCLcBGAs/s1600/compartment.png> Thank you again! Haoran On Fri, Jul 14, 2017 at 2:55 AM, Haoran Yu <hal...@gm...> wrote: > Hi all, > > I have a couple of questions regarding how to design Logic Models when > writing SBML from scratch. The questions might not be specifically for SBML > 'qual', but I thought it might be convenient to have all my questions in > one place rather than across different mailing lists. > > I'm currently implementing the following bidirectional converters between > SBML and SBGN-ML: > > (1) SBML 'core'+'layout'+'render' <-> SBGN-ML PD > (2) SBML 'core'+'qual' <-> SBGN-ML AF > > I have made some progress in both converters (1) and (2). All the > questions I have is for the SBGN - > SBML conversion. The questions were > posted on my blog over the last 2 weeks, Week 10 > <http://haleyyew-gsoc.blogspot.ca/2017/07/week-10.html> (section 2) and Week > 11 <http://haleyyew-gsoc.blogspot.ca/2017/07/week-11.html> (section 1.1). > > The SBGN examples that motivated the questions are > libsbgn/test-files/PD/or.sbgn > <https://github.com/sbgn/libsbgn/blob/master/test-files/PD/or-simple.png> > and libsbgn/test-files/AF/compartment.sbgn > <https://github.com/sbgn/libsbgn/blob/master/test-files/AF/compartment.png> > > *Question 1:* > There are 2 alternative mappings for SBGN PD->SBML for the example > "or.sbgn" that involves choosing between 'layout' SpeciesGlyphs, > ReactionGlyphs and GeneralGlyphs. > I included a color coded diagram to illustrate the 2 mapping alternatives, Blue > is SpeciesGlyphs, Green is ReactionGlyphs and Red is GeneralGlyphs. > [Figure 1] > [Figure 2] > > In Figure 1, I mapped the 'OR' SBGN Glyph to a ReactionGlyph ,and > therefore all Arcs connecting the 'OR' glyph should become > SpeciesReferences. But I found this mapping to be inadequate. Arc [1] is a > ModifierSpeciesReference, and by *Rule 21111* in the > *sbml-level-3-version-1-core-release-2* specification, the *species *attribute > must refer to an existing Species. Which means Arc [1] refers to the 'OR' > glyph and 'OR' must be a Species, otherwise Arc [1] can't be a > ModifierSpeciesReference of the green reaction. That is why I had to make > Arc [1] a GeneralGlyph instead without associating with any core Model > components. > > In Figure 2, the reason that the 'OR' SBGN Glyph is changed from a > ReactionGlyph to a SpeciesGlyph is to fix the problem with the Arc [1] in > Figure 1. The 2 Logic Arcs below *Enzyme1 *and *Enzyme2 *become > GeneralGlyphs, and the 'OR' SBGN Glyph becomes a Species. Then Arc [1] can > be a ModifierSpeciesReference in the green reaction below, and associate > with the 'OR' Species. The 2 Logic Arcs should be GeneralGlyphs because > they are not real Model components anyway. > > I have implemented the mapping in Figure 1, but later changed the > implementation to the mapping in Figure 2. *Since neither of the 2 > alternatives are perfect, I'm wondering if there is a third alternative > that might be a better mapping? Or any suggestions that improve the > mappings in either Figure 1 or Figure 2? * > > > *Question 2:* > While working on converter (2), the "compartment.sbgn" example in SBGN AF > is more complex than I thought, and I have trouble mapping it to SBML > 'qual'. I can map an SBGN Logic Arc to a SBML 'qual' Transition, where the > Input and Output QualitativeSpecies could be anything connected to the > Logic Arc. > [Figure 3] > > But in the more complex case where many Logic Arcs meet with a Logic > Operator, and then output an Arc to connect to the target Glyph. All of > these Arcs and Glyphs would belong to a single Transition in 'qual'. Each > Logic Arc has an Input. Then each of them would have a separate > FunctionTerm. But each FunctionTerm must have a resultLevel. The problem is > that in Logic Models, the possible Input and Ouput values could only be 0 > or 1. *Are there are only 2 possible FunctionTerms in all Transitions > (resultLevel 0 or 1)?* > > Due to my current choice mapping: the 'AND' glyph would be mapped to a > QualitativeSpecies, and for each SBGN Glyph that is connected to a Logic > Arc, I map the Glyph to a QualitativeSpecies. Then I create SpeciesGlyphs > that correspond to the QualitativeSpecies. But the 'AND' Logic Operator is > part of a Transition, and the Arc that acts as the Output must connect to > only one QualitativeSpecies. Therefore the 'AND' glyph does not have a > mapping, i.e. it is lost in the mapped SBML Model. > > *Is there a better mapping that is able to preserve the 'AND' glyph? * > I have thought about storing the 'AND' as part of the Math element in a > FunctionTerm. But I have trouble coming up with a good algorithm to map the > SBGN Glyph+Arcs to a Transition containing multiple FunctionTerms. It would > be great if someone could help me trace an algorithm for mapping of the > "compartment.sbgn" example. > > > Thank you for all your help! > Haoran > > |