コード例 #1
0
    def __construct_reaction_from_reactionlst(self, reaction, rid, reversible):
        substrates = []
        products = []
        stoichiometry = {}
        longname_map  = {}

        r = Reaction(rid)
        substrates = self.reactiondb.get_stoichiometry(rid, "_substrates_")
        products   = self.reactiondb.get_stoichiometry(rid, "_products_")
        if substrates == "None":
            return None
        for sub in substrates:
            stoichiometry[ sub ] = self.reactiondb.get_stoichiometry(rid, sub)
            longname_map[ sub ] = self.reactiondb.get_long_name(sub)

        for prod in products:
            stoichiometry[ prod ] = self.reactiondb.get_stoichiometry(rid, prod)
            longname_map[ prod ] = self.reactiondb.get_long_name( prod )

        r.substrates = substrates
        r.products = products
        r.stoichiometry = stoichiometry
        r.reversible = reversible
        r.longname_map = longname_map
        return r
コード例 #2
0
    def __construct_reaction_from_reactionlst(self, reaction, rid, reversible):
        substrates = []
        products = []
        stoichiometry = {}
        longname_map = {}

        r = Reaction(rid)
        substrates = self.reactiondb.get_stoichiometry(rid, "_substrates_")
        products = self.reactiondb.get_stoichiometry(rid, "_products_")
        # print "Get RID", rid
        # print "sub is", substrates
        if substrates == "None":
            return None
        for sub in substrates:
            stoichiometry[sub] = self.reactiondb.get_stoichiometry(rid, sub)
            longname_map[sub] = self.reactiondb.get_long_name(sub)
            # print sub, self.reactiondb.get_long_name(sub)

        # print
        for prod in products:
            # print '"' + prod + '"', '"'+ self.reactiondb.get_long_name(prod)+'"'
            stoichiometry[prod] = self.reactiondb.get_stoichiometry(rid, prod)
            longname_map[prod] = self.reactiondb.get_long_name(prod)

        # print
        # print "===="
        r.substrates = substrates
        r.products = products
        r.stoichiometry = stoichiometry
        r.reversible = reversible
        r.longname_map = longname_map
        return r
コード例 #3
0
 def __construct_reaction_from_reactionlst(self, reaction, rid, reversible):
     substrates = []
     products = []
     stoichiometry = {}
     longname_map  = {}
     
     r = Reaction(rid)
     substrates = self.reactiondb.get_stoichiometry(rid, "_substrates_")
     products   = self.reactiondb.get_stoichiometry(rid, "_products_")
     # print "Get RID", rid
     # print "sub is", substrates
     if substrates == "None":
         return None
     for sub in substrates:
         stoichiometry[ sub ] = self.reactiondb.get_stoichiometry(rid, sub)
         longname_map[ sub ] = self.reactiondb.get_long_name(sub)
         # print sub, self.reactiondb.get_long_name(sub)
         
     # print 
     for prod in products:
         # print '"' + prod + '"', '"'+ self.reactiondb.get_long_name(prod)+'"'
         stoichiometry[ prod ] = self.reactiondb.get_stoichiometry(rid, prod)
         longname_map[ prod ] = self.reactiondb.get_long_name( prod )
         
     # print
     # print "===="
     r.substrates = substrates
     r.products = products
     r.stoichiometry = stoichiometry
     r.reversible = reversible
     r.longname_map = longname_map
     return r
コード例 #4
0
    def __construct_reaction_from_kgml(self, reaction, rid, reversible):
        substrates = []
        products = []
        stoichiometry = {}

        for sub in reaction.getiterator('substrate'):
            name = remove_comma(sub.get('name'))
            substrates.append(name)
            stoichiometry[ name ] = self.reactiondb.get_stoichiometry(rid, name)

        for prod in reaction.getiterator('product'):
            name = remove_comma(prod.get('name'))
            products.append(name)
            stoichiometry[ name ] = self.reactiondb.get_stoichiometry(rid, name)

        r = Reaction(rid)
        r.substrates = substrates
        r.products = products
        r.stoichiometry = stoichiometry
        r.reversible = reversible
        return r
コード例 #5
0
    def __construct_reaction_from_kgml(self, reaction, rid, reversible):
        substrates = []
        products = []
        stoichiometry = {}

        for sub in reaction.getiterator('substrate'):
            name = remove_comma(sub.get('name'))
            substrates.append(name)
            stoichiometry[name] = self.reactiondb.get_stoichiometry(rid, name)

        for prod in reaction.getiterator('product'):
            name = remove_comma(prod.get('name'))
            products.append(name)
            stoichiometry[name] = self.reactiondb.get_stoichiometry(rid, name)

        r = Reaction(rid)
        r.substrates = substrates
        r.products = products
        r.stoichiometry = stoichiometry
        r.reversible = reversible
        return r