當前位置: 首頁>>代碼示例>>Python>>正文


Python MetabolicModel.load_model方法代碼示例

本文整理匯總了Python中psamm.metabolicmodel.MetabolicModel.load_model方法的典型用法代碼示例。如果您正苦於以下問題:Python MetabolicModel.load_model方法的具體用法?Python MetabolicModel.load_model怎麽用?Python MetabolicModel.load_model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在psamm.metabolicmodel.MetabolicModel的用法示例。


在下文中一共展示了MetabolicModel.load_model方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
 def setUp(self):
     # TODO use mock model instead of actual model
     self.database = DictDatabase()
     self.database.set_reaction("rxn_1", parse_reaction("=> |A|"))
     self.database.set_reaction("rxn_2", parse_reaction("(0.000001) |A| =>"))
     self.model = MetabolicModel.load_model(self.database, self.database.reactions)
     self.solver = cplex.Solver()
開發者ID:gitter-badger,項目名稱:psamm,代碼行數:9,代碼來源:test_fastcore.py

示例2: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        self._database = DictDatabase()
        self._database.set_reaction('rxn_1', parse_reaction('A[e] => B[e]'))
        self._database.set_reaction('rxn_2', parse_reaction('B[e] => C[e]'))
        self._database.set_reaction('rxn_3', parse_reaction('B[e] => D[e]'))
        self._database.set_reaction('rxn_4', parse_reaction('C[e] => E[e]'))
        self._database.set_reaction('rxn_5', parse_reaction('D[e] => E[e]'))
        self._database.set_reaction('rxn_6', parse_reaction('E[e] =>'))
        self._database.set_reaction('ex_A', parse_reaction('A[e] <=>'))

        self._mm = MetabolicModel.load_model(
            self._database, self._database.reactions)
        self._assoc = {
            'rxn_1': boolean.Expression('gene_1'),
            'rxn_2': boolean.Expression('gene_2 or gene_3'),
            'rxn_5': boolean.Expression('gene_3 and gene_4')
        }
        self._obj_reaction = 'rxn_6'

        try:
            self._solver = generic.Solver()
        except generic.RequirementsError:
            self.skipTest('Unable to find an LP solver for tests')

        self._prob = fluxanalysis.FluxBalanceProblem(self._mm, self._solver)
開發者ID:spikeliu,項目名稱:psamm,代碼行數:27,代碼來源:test_randomsparse.py

示例3: test_load_model_with_reaction_subset

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def test_load_model_with_reaction_subset(self):
        database = DictDatabase()
        database.set_reaction('rxn_1', parse_reaction('|A| => |B|'))
        database.set_reaction('rxn_2', parse_reaction('|B| => |C|'))
        database.set_reaction('rxn_3', parse_reaction('|C| => |D|'))
        model = MetabolicModel.load_model(database, {'rxn_1'})

        self.assertEqual(set(model.reactions), {'rxn_1'})
開發者ID:amenge,項目名稱:psamm,代碼行數:10,代碼來源:test_metabolicmodel.py

示例4: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
 def setUp(self):
     # TODO use mock database instead of actual database
     self.database = DictDatabase()
     self.database.set_reaction("rxn_1", parse_reaction("=> (2) |A|"))
     self.database.set_reaction("rxn_2", parse_reaction("|A| <=> |B|"))
     self.database.set_reaction("rxn_3", parse_reaction("|A| => |D[e]|"))
     self.database.set_reaction("rxn_4", parse_reaction("|A| => |C|"))
     self.database.set_reaction("rxn_5", parse_reaction("|C| => |D[e]|"))
     self.database.set_reaction("rxn_6", parse_reaction("|D[e]| =>"))
     self.model = MetabolicModel.load_model(self.database, self.database.reactions)
開發者ID:gitter-badger,項目名稱:psamm,代碼行數:12,代碼來源:test_metabolicmodel.py

示例5: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
 def setUp(self):
     self.database = DictDatabase()
     self.database.set_reaction('rxn_1', parse_reaction('=> (2) A[c]'))
     self.database.set_reaction('rxn_2', parse_reaction('A[c] <=> B[c]'))
     self.database.set_reaction('rxn_3', parse_reaction('A[c] => D[e]'))
     self.database.set_reaction('rxn_4', parse_reaction('A[c] => C[c]'))
     self.database.set_reaction('rxn_5', parse_reaction('C[c] => D[e]'))
     self.database.set_reaction('rxn_6', parse_reaction('D[e] =>'))
     self.model = MetabolicModel.load_model(
         self.database, self.database.reactions)
開發者ID:keitht547,項目名稱:psamm,代碼行數:12,代碼來源:test_gapfilling.py

示例6: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        self.database = DictDatabase()
        self.database.set_reaction('rxn_1', parse_reaction('=> (2) |A|'))
        self.database.set_reaction('rxn_2', parse_reaction('|A| <=> |B|'))
        self.database.set_reaction('rxn_3', parse_reaction('|A| => |D|'))
        self.database.set_reaction('rxn_4', parse_reaction('|A| => |C|'))
        self.database.set_reaction('rxn_5', parse_reaction('|C| => |D|'))
        self.database.set_reaction('rxn_6', parse_reaction('|D| =>'))

        model = MetabolicModel.load_model(self.database, self.database.reactions)
        self.model = FlipableModelView(model)
開發者ID:keitht547,項目名稱:psamm,代碼行數:13,代碼來源:test_metabolicmodel.py

示例7: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
 def setUp(self):
     self.database = DictDatabase()
     self.database.set_reaction('rxn_1', parse_reaction('=> (2) |A|'))
     self.database.set_reaction('rxn_2', parse_reaction('|A| <=> |B|'))
     self.database.set_reaction('rxn_3', parse_reaction('|A| => |D|'))
     self.database.set_reaction('rxn_4', parse_reaction('|A| => |C|'))
     self.database.set_reaction('rxn_5', parse_reaction('|C| => |D|'))
     self.database.set_reaction('rxn_6', parse_reaction('|D| =>'))
     self.model = MetabolicModel.load_model(
         self.database, self.database.reactions)
     self.solver = cplex.Solver()
開發者ID:gitter-badger,項目名稱:psamm,代碼行數:13,代碼來源:test_fluxanalysis.py

示例8: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        # TODO use mock model instead of actual model
        self.database = DictDatabase()
        self.database.set_reaction('rxn_1', parse_reaction(
            '|A| + |B| => |C|'))
        self.database.set_reaction('rxn_2', parse_reaction(
            '|C| + |Z| => |A| + |B|'))
        self.model = MetabolicModel.load_model(
            self.database, self.database.reactions)

        self.solver = cplex.Solver()
開發者ID:gitter-badger,項目名稱:psamm,代碼行數:13,代碼來源:test_massconsistency.py

示例9: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        self.database = DictDatabase()
        self.database.set_reaction('rxn_1', parse_reaction('|A| <=>'))
        self.database.set_reaction('rxn_2', parse_reaction('|A| <=> |B|'))
        self.database.set_reaction('rxn_3', parse_reaction('|C| <=> |B|'))
        self.database.set_reaction('rxn_4', parse_reaction('|C| <=>'))
        self.model = MetabolicModel.load_model(
            self.database, self.database.reactions)

        try:
            self.solver = generic.Solver()
        except generic.RequirementsError:
            self.skipTest('Unable to find an LP solver for tests')
開發者ID:keitht547,項目名稱:psamm,代碼行數:15,代碼來源:test_fastcore.py

示例10: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        # TODO use mock model instead of actual model
        self.database = DictDatabase()
        self.database.set_reaction('rxn_1', parse_reaction('=> |A|'))
        self.database.set_reaction('rxn_2',
            parse_reaction('(0.000001) |A| =>'))
        self.model = MetabolicModel.load_model(
            self.database, self.database.reactions)

        try:
            self.solver = generic.Solver()
        except generic.RequirementsError:
            self.skipTest('Unable to find an LP solver for tests')
開發者ID:amenge,項目名稱:psamm,代碼行數:15,代碼來源:test_fastcore.py

示例11: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        self.database = DictDatabase()
        self.database.set_reaction('rxn_1', parse_reaction('=> (2) |A|'))
        self.database.set_reaction('rxn_2', parse_reaction('|A| <=> |B|'))
        self.database.set_reaction('rxn_3', parse_reaction('|A| => |D|'))
        self.database.set_reaction('rxn_4', parse_reaction('|A| => |C|'))
        self.database.set_reaction('rxn_5', parse_reaction('|C| => |D|'))
        self.database.set_reaction('rxn_6', parse_reaction('|D| =>'))
        self.database.set_reaction('rxn_7', parse_reaction('|E| => |F|'))
        self.database.set_reaction('rxn_8', parse_reaction('|F| => |E|'))
        self.model = MetabolicModel.load_model(
            self.database, self.database.reactions)

        try:
            self.solver = generic.Solver(integer=True)
        except generic.RequirementsError:
            self.skipTest('Unable to find an MILP solver for tests')
開發者ID:ForkBackups,項目名稱:psamm,代碼行數:19,代碼來源:test_fluxanalysis.py

示例12: setUp

# 需要導入模塊: from psamm.metabolicmodel import MetabolicModel [as 別名]
# 或者: from psamm.metabolicmodel.MetabolicModel import load_model [as 別名]
    def setUp(self):
        self.database = DictDatabase()
        self.database.set_reaction('rxn_1', parse_reaction('|A| => |B|'))
        self.database.set_reaction('rxn_2', parse_reaction('|B| => |G|'))
        self.database.set_reaction('rxn_3', parse_reaction('|A| => |G|'))
        self.database.set_reaction('rxn_4', parse_reaction('|B| => |H|'))
        self.database.set_reaction('rxn_5', parse_reaction('|B| => |C| + |F|'))
        self.database.set_reaction('rxn_6', parse_reaction('|C| => |D|'))
        self.database.set_reaction('rxn_7', parse_reaction('|E| <=> |D|'))
        self.database.set_reaction('rxn_9', parse_reaction('|I| => |J|'))
        self.database.set_reaction('rxn_10', parse_reaction('|J| => |K|'))
        self.database.set_reaction('rxn_A', parse_reaction('=> |A|'))
        self.database.set_reaction('rxn_G', parse_reaction('|G| =>'))
        self.database.set_reaction('rxn_E', parse_reaction('|E| =>'))
        self.database.set_reaction(
            'rxn_bio', parse_reaction('|D| + (2.5) |F| =>'))
        self.model = MetabolicModel.load_model(
            self.database, self.database.reactions)

        try:
            self.solver = generic.Solver()
        except generic.RequirementsError:
            self.skipTest('Unable to find an LP solver for tests')
開發者ID:ForkBackups,項目名稱:psamm,代碼行數:25,代碼來源:test_fluxcoupling.py


注:本文中的psamm.metabolicmodel.MetabolicModel.load_model方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。