Example #1
0
    /*!
     * \brief This reaction build a PromoterReaction reaction from a PromoterProperties class
     * \param props The PromoterProperties which will serve to create the reaction
     * \return Return the new reaction or null if it fail.
     */
    public static IReaction       buildPromoterFromProps(PromoterProperties props)
    {
        if (props == null)
        {
            return(null);
        }

        PromoterParser   parser   = new PromoterParser();
        PromoterReaction reaction = new PromoterReaction();

        reaction.setName(props.name);
        reaction.setBeta(props.beta);
        reaction.setTerminatorFactor(props.terminatorFactor);
        reaction.setEnergyCost(props.energyCost);
        TreeNode <PromoterNodeData> formula = parser.Parse(props.formula);

        reaction.setFormula(formula);
        Product newProd;

        foreach (Product p in props.products)
        {
            newProd = new Product(p);
            reaction.addProduct(newProd);
        }

        return(reaction);
    }
Example #2
0
    private PromoterProperties getPromoterReaction(ExpressionModule em, int id)
    {
        Logger.Log("Device::getPromoterReaction(" + em.ToString() + ", " + id + ")", Logger.Level.TRACE);
        PromoterProperties prom = new PromoterProperties();

        prom.energyCost = _energyPerBasePair * em.getSize();
        //promoter only
        //prom.energyCost = _energyPerBasePair*em.getBioBricks().First.Value.getSize();

        LinkedList <BioBrick> bricks = em.getBioBricks();

        //TODO fix this: create good properties' name
        prom.name = _internalName + id;
        PromoterBrick p = bricks.First.Value as PromoterBrick;

        prom.formula = p.getFormula();
        prom.beta    = p.getBeta();
        bricks.RemoveFirst();

        prom.products = getProductsFromBiobricks(bricks);

        TerminatorBrick tb = bricks.First.Value as TerminatorBrick;

        prom.terminatorFactor = tb.getTerminatorFactor();
        bricks.RemoveFirst();

        if (bricks.Count != 0)
        {
            Logger.Log("Device::getPromoterReaction Warning: bricks.Count =" + bricks.Count, Logger.Level.TRACE);
        }
        return(prom);
    }
Example #3
0
  private PromoterProperties getPromoterReaction(ExpressionModule em, int id)
  {
    Logger.Log("Device::getPromoterReaction("+em.ToString()+", "+id+")", Logger.Level.TRACE);
    PromoterProperties prom = new PromoterProperties();

    prom.energyCost = _energyPerBasePair*em.getSize();
    //promoter only
    //prom.energyCost = _energyPerBasePair*em.getBioBricks().First.Value.getSize();

    LinkedList<BioBrick> bricks = em.getBioBricks();

        //TODO fix this: create good properties' name
    prom.name = _internalName + id;
    PromoterBrick p = bricks.First.Value as PromoterBrick;
    prom.formula = p.getFormula();
    prom.beta = p.getBeta();
    bricks.RemoveFirst();

    prom.products = getProductsFromBiobricks(bricks);

    TerminatorBrick tb = bricks.First.Value as TerminatorBrick;
    prom.terminatorFactor = tb.getTerminatorFactor();
    bricks.RemoveFirst();

    if(bricks.Count != 0) {
      Logger.Log("Device::getPromoterReaction Warning: bricks.Count ="+bricks.Count, Logger.Level.TRACE);
    }
    return prom;
  }
Example #4
0
  /*!
    \brief This reaction build a PromoterReaction reaction from a PromoterProperties class
    \param props The PromoterProperties which will serve to create the reaction
    \return Return the new reaction or null if it fail.
   */
  public static IReaction       buildPromoterFromProps(PromoterProperties props)
  {
    if (props == null)
      return null;

    PromoterParser parser = new PromoterParser();
    PromoterReaction reaction = new PromoterReaction();

    reaction.setName(props.name);
    reaction.setBeta(props.beta);
    reaction.setTerminatorFactor(props.terminatorFactor);
    reaction.setEnergyCost(props.energyCost);
    TreeNode<PromoterNodeData> formula = parser.Parse(props.formula);
    reaction.setFormula(formula);
    Product newProd;
    foreach (Product p in props.products)
      {
        newProd = new Product(p);
        reaction.addProduct(newProd);
      }
		
    return reaction;
  }