Inheritance: IReaction
Exemplo n.º 1
0
 //! Copy constructor
 public Allostery(Allostery r) : base(r)
 {
     _effector = r._effector;
     _K        = r._K;
     _n        = r._n;
     _protein  = r._protein;
     _product  = r._product;
 }
Exemplo n.º 2
0
 //! Copy constructor
 public Allostery(Allostery r)
     : base(r)
 {
     _effector = r._effector;
     _K = r._K;
     _n = r._n;
     _protein = r._protein;
     _product = r._product;
 }
Exemplo n.º 3
0
    private string _protein; //! The name of the protein

    #endregion Fields

    #region Methods

    public static IReaction buildAllosteryFromProps(AllosteryProprieties props)
    {
        Allostery reaction = new Allostery();

        reaction.setName(props.name);
        reaction.setEffector(props.effector);
        reaction.setK(props.K);
        reaction.setN(props.n);
        reaction.setProtein(props.protein);
        reaction.setProduct(props.product);
        return reaction;
    }
Exemplo n.º 4
0
    /* !
     * \brief Checks that two reactions have the same Allostery field values.
     * \param reaction The reaction that will be compared to 'this'.
     */
    protected override bool PartialEquals(IReaction reaction)
    {
        Allostery allostery = reaction as Allostery;

        return((allostery != null) &&
               base.PartialEquals(reaction) &&
               (_effector == allostery._effector) &&
               (_K == allostery._K) &&
               (_n == allostery._n) &&
               (_protein == allostery._protein) &&
               (_product == allostery._product));
    }
Exemplo n.º 5
0
    //FIXME : Create function that create prop with this reaction

    /*!
     * \brief This function create a new Allostery reaction from an AllosteryProperties
     * \param props Properties of the reaction
     * \return This function return a new Allostery reaction or null if props is null
     */
    public static IReaction       buildAllosteryFromProps(AllosteryProperties props)
    {
        if (props == null)
        {
            return(null);
        }

        Allostery reaction = new Allostery();

        reaction.setName(props.name);
        reaction.setEffector(props.effector);
        reaction.setK(props.K);
        reaction.setN(props.n);
        reaction.setProtein(props.protein);
        reaction.setProduct(props.product);
        reaction.setEnergyCost(props.energyCost);

        return(reaction);
    }
Exemplo n.º 6
0
    /*!
    \brief This function load all the allostric reactions and add them to the given IReaction list
    \param node The xml load to parse
    \param reactions The list of reaction where will be appened the new allosteric reactions
    \return Return true of succed and false if the function has failed
      */
    public bool loadAllostericReactions(XmlNode node, LinkedList<IReaction> reactions)
    {
        XmlNodeList AReactionsList = node.SelectNodes("allostery");
        bool b = true;

        foreach (XmlNode AReaction in AReactionsList)
          {
        Allostery ar = new Allostery();
        foreach (XmlNode attr in AReaction)
          {
            switch (attr.Name)
              {
              case "name":
                b = b && loadAllosteryString(attr.InnerText, ar.setName);
                break;
              case "effector":
                b = b && loadAllosteryString(attr.InnerText, ar.setEffector);
                break;
              case "K":
                b = b && loadAllosteryFloat(attr.InnerText, ar.setK);
                break;
              case "EnergyCost":
                b = b && loadAllosteryFloat(attr.InnerText, ar.setEnergyCost);
                break;
              case "n":
                ar.setN(Convert.ToInt32(attr.InnerText));
                break;
              case "protein":
                b = b && loadAllosteryString(attr.InnerText, ar.setProtein);
                break;
              case "products":
                b = b && loadAllosteryString(attr.InnerText, ar.setProduct);
                break;
              }
          }
        reactions.AddLast(ar);
          }
        return b;
    }
Exemplo n.º 7
0
  //FIXME : Create function that create prop with this reaction

  /*!
    \brief This function create a new Allostery reaction from an AllosteryProperties
    \param props Properties of the reaction
    \return This function return a new Allostery reaction or null if props is null
   */
  public static IReaction       buildAllosteryFromProps(AllosteryProperties props)
  {
    if (props == null)
      return null;

    Allostery reaction = new Allostery();

    reaction.setName(props.name);
    reaction.setEffector(props.effector);
    reaction.setK(props.K);
    reaction.setN(props.n);
    reaction.setProtein(props.protein);
    reaction.setProduct(props.product);
    reaction.setEnergyCost(props.energyCost);

    return reaction;
  }