Menu

#27 Implement function getReactionIdFromXPathIdentifier

2.3
open
nobody
None
5
2016-07-27
2016-07-13
No

From Chris Myers
You can create XPath expressions for LocalParameters, and you can get the Id from this expression. However, there is no function to get the ReactionId from this expression. See my attempt at one in the attached file, getReactionIdFromXPathIdentifier.

Related

Feature Requests: #27

Discussion

  • Richard Adams

    Richard Adams - 2016-07-27

    Are you talking about LocalParameters in SBML? In which case, I don't think that code that is very specific to SBML structure should be in jlibsedml, which should be model agnostic as much as possible, other than perhaps some String constants for URNs and model language identifiers for example.

    Anyway if I've misunderstood please could you resend attachment?
    Thanks

     
    • Chris Myers

      Chris Myers - 2016-07-28

      There is a class called SBMLSupport:

      file:///Users/myers/Downloads/jlibsedml-2.2.3/javadoc/index.html

      This includes methods to get Ids from XPath expressions for several common SBML elements, but it is missing a means to get the ReactionId for a LocalParameter. This is the code I wrote for this:

      public static String getReactionIdFromXPathIdentifer(String xPath) {
          if (!xPath.contains("reaction[@id")) return null;
          String reactionId = xPath.replace("/sbml:sbml/sbml:model/sbml:listOfReactions/sbml:reaction[@id='", "");
          reactionId = reactionId.substring(0,reactionId.indexOf("'"));
          return reactionId;
      }
      

      Similarly, I wrote code to get XPath expressions for Reactants and Products:

      public static String getXPathForReactant(String reactionId,String reactantId) {
          SBMLSupport support = new SBMLSupport();
          return support.getXPathForReaction(reactionId)
      
                  + "/sbml:listOfReactants" + "/sbml:speciesReference[@id='" + reactantId + "']";
      }
      
      public static String getXPathForProduct(String reactionId,String productId) {
          SBMLSupport support = new SBMLSupport();
          return support.getXPathForReaction(reactionId)
      
                  + "/sbml:listOfProducts" + "/sbml:speciesReference[@id='" + productId + "']";
      }
      

      On Jul 27, 2016, at 2:30 PM, Richard Adams otter606@users.sf.net wrote:

      Are you talking about LocalParameters in SBML? In which case, I don't think that code that is very specific to SBML structure should be in jlibsedml, which should be model agnostic as much as possible, other than perhaps some String constants for URNs and model language identifiers for example.

      Anyway if I've misunderstood please could you resend attachment?
      Thanks

      [feature-requests:#27] https://sourceforge.net/p/jlibsedml/feature-requests/27/ Implement function getReactionIdFromXPathIdentifier

      Status: open
      Group: 2.3
      Created: Wed Jul 13, 2016 08:56 PM UTC by Richard Adams
      Last Updated: Wed Jul 13, 2016 08:56 PM UTC
      Owner: nobody

      From Chris Myers
      You can create XPath expressions for LocalParameters, and you can get the Id from this expression. However, there is no function to get the ReactionId from this expression. See my attempt at one in the attached file, getReactionIdFromXPathIdentifier.

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jlibsedml/feature-requests/27/ https://sourceforge.net/p/jlibsedml/feature-requests/27/
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #27

MongoDB Logo MongoDB