def test__normalize_pseudoreaction_biomass_has_gpr(): reaction = Reaction('my_biomass_2') reaction.gene_reaction_rule = 'b1779' with pytest.raises(ConflictingPseudoreaction) as excinfo: _ = _normalize_pseudoreaction(reaction.id, reaction) assert 'has a gene_reaction_rule' in str(excinfo.value) assert reaction.id == 'my_biomass_2'
def test__normalize_pseudoreaction_biomass_has_gpr(): reaction = Reaction('my_biomass_2') reaction.gene_reaction_rule = 'b1779' with pytest.raises(ConflictingPseudoreaction) as excinfo: _ = _normalize_pseudoreaction(reaction.id, reaction) assert 'has a gene_reaction_rule' in str(excinfo.value) assert reaction.id == 'my_biomass_2'
def test__normalize_pseudoreaction_exchange_error_bad_coeff(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): -2}) with pytest.raises(ConflictingPseudoreaction) as excinfo: _ = _normalize_pseudoreaction(reaction.id, reaction) assert 'with coefficient' in str(excinfo.value) assert reaction.id == 'EX_gone'
def test__normalize_pseudoreaction_exchange_error_bad_coeff(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): -2}) with pytest.raises(ConflictingPseudoreaction) as excinfo: _ = _normalize_pseudoreaction(reaction.id, reaction) assert 'with coefficient' in str(excinfo.value) assert reaction.id == 'EX_gone'
def test__normalize_pseudoreaction_sink(): reaction = Reaction('SInk_gone') reaction.add_metabolites({Metabolite('glu__L_c'): -1}) reaction.lower_bound = -1000 reaction.upper_bound = 0 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'SK_glu__L_c' assert reaction.subsystem == 'Intracellular source/sink'
def test__normalize_pseudoreaction_sink(): reaction = Reaction('SInk_gone') reaction.add_metabolites({Metabolite('glu__L_c'): -1}) reaction.lower_bound = -1000 reaction.upper_bound = 0 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'SK_glu__L_c' assert reaction.subsystem == 'Intracellular source/sink'
def test__normalize_pseudoreaction_exchange(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): -1}) reaction.lower_bound = -1000 reaction.upper_bound = 0 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'EX_glu__L_e' assert reaction.subsystem == 'Extracellular exchange'
def test__normalize_pseudoreaction_exchange(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): -1}) reaction.lower_bound = -1000 reaction.upper_bound = 0 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'EX_glu__L_e' assert reaction.subsystem == 'Extracellular exchange'
def test__normalize_pseudoreaction_exchange_error_has_gpr(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): -1}) reaction.gene_reaction_rule = 'b1779' with pytest.raises(ConflictingPseudoreaction) as excinfo: _ = _normalize_pseudoreaction(reaction.id, reaction) assert 'has a gene_reaction_rule' in str(excinfo.value) assert reaction.id == 'EX_gone'
def test__normalize_pseudoreaction_demand(): reaction = Reaction('DM_gone') reaction.add_metabolites({Metabolite('glu__L_c'): -1}) reaction.lower_bound = 0 reaction.upper_bound = 1000 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'DM_glu__L_c' assert reaction.subsystem == 'Intracellular demand'
def test__normalize_pseudoreaction_exchange_error_has_gpr(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): -1}) reaction.gene_reaction_rule = 'b1779' with pytest.raises(ConflictingPseudoreaction) as excinfo: _ = _normalize_pseudoreaction(reaction.id, reaction) assert 'has a gene_reaction_rule' in str(excinfo.value) assert reaction.id == 'EX_gone'
def test__normalize_pseudoreaction_demand(): reaction = Reaction('DM_gone') reaction.add_metabolites({Metabolite('glu__L_c'): -1}) reaction.lower_bound = 0 reaction.upper_bound = 1000 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'DM_glu__L_c' assert reaction.subsystem == 'Intracellular demand'
def test__normalize_pseudoreaction_atpm(): reaction = Reaction('notATPM') reaction.add_metabolites({Metabolite('atp_c'): -1, Metabolite('h2o_c'): -1, Metabolite('pi_c'): 1, Metabolite('h_c'): 1, Metabolite('adp_c'): 1}) pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'ATPM' assert reaction.subsystem == 'Biomass and maintenance functions'
def test__normalize_pseudoreaction_exchange_reversed(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): 1}) reaction.lower_bound = 0 reaction.upper_bound = 1000 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'EX_glu__L_e' assert reaction.lower_bound == -1000 assert reaction.upper_bound == 0 assert list(reaction.metabolites.values()) == [-1]
def test__normalize_pseudoreaction_sink_reversed(): reaction = Reaction('Sink_gone') reaction.add_metabolites({Metabolite('glu__L_c'): 1}) reaction.lower_bound = 0 reaction.upper_bound = 50 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert list(reaction.metabolites.values()) == [-1] assert reaction.lower_bound == -50 assert reaction.upper_bound == 0 assert pseudo_id == 'SK_glu__L_c'
def test__normalize_pseudoreaction_sink_reversed(): reaction = Reaction('Sink_gone') reaction.add_metabolites({Metabolite('glu__L_c'): 1}) reaction.lower_bound = 0 reaction.upper_bound = 50 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert list(reaction.metabolites.values()) == [-1] assert reaction.lower_bound == -50 assert reaction.upper_bound == 0 assert pseudo_id == 'SK_glu__L_c'
def test__normalize_pseudoreaction_demand_reversed(): reaction = Reaction('DM_gone') reaction.add_metabolites({Metabolite('glu__L_c'): 1}) reaction.lower_bound = -1000 reaction.upper_bound = 0 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert list(reaction.metabolites.values()) == [-1] assert reaction.lower_bound == 0 assert reaction.upper_bound == 1000 assert pseudo_id == 'DM_glu__L_c'
def test__normalize_pseudoreaction_exchange_reversed(): reaction = Reaction('EX_gone') reaction.add_metabolites({Metabolite('glu__L_e'): 1}) reaction.lower_bound = 0 reaction.upper_bound = 1000 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'EX_glu__L_e' assert reaction.lower_bound == -1000 assert reaction.upper_bound == 0 assert list(reaction.metabolites.values()) == [-1]
def test__normalize_pseudoreaction_demand_reversed(): reaction = Reaction('DM_gone') reaction.add_metabolites({Metabolite('glu__L_c'): 1}) reaction.lower_bound = -1000 reaction.upper_bound = 0 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert list(reaction.metabolites.values()) == [-1] assert reaction.lower_bound == 0 assert reaction.upper_bound == 1000 assert pseudo_id == 'DM_glu__L_c'
def test__normalize_pseudoreaction_atpm_has_gpr(): reaction = Reaction('NPT1') reaction.add_metabolites({Metabolite('atp_c'): -1, Metabolite('h2o_c'): -1, Metabolite('pi_c'): 1, Metabolite('h_c'): 1, Metabolite('adp_c'): 1}) reaction.gene_reaction_rule = 'b1779' pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) # should not change assert pseudo_id is None assert reaction.id == 'NPT1'
def test__normalize_pseudoreaction_atpm(): reaction = Reaction('notATPM') reaction.add_metabolites({ Metabolite('atp_c'): -1, Metabolite('h2o_c'): -1, Metabolite('pi_c'): 1, Metabolite('h_c'): 1, Metabolite('adp_c'): 1 }) pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'ATPM' assert reaction.subsystem == 'Biomass and maintenance functions'
def test__normalize_pseudoreaction_atpm_reversed(): reaction = Reaction('notATPM') reaction.add_metabolites({Metabolite('atp_c'): 1, Metabolite('h2o_c'): 1, Metabolite('pi_c'): -1, Metabolite('h_c'): -1, Metabolite('adp_c'): -1}) reaction.lower_bound = -50 reaction.upper_bound = 100 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'ATPM' assert reaction.lower_bound == -100 assert reaction.upper_bound == 50
def test__normalize_pseudoreaction_atpm_has_gpr(): reaction = Reaction('NPT1') reaction.add_metabolites({ Metabolite('atp_c'): -1, Metabolite('h2o_c'): -1, Metabolite('pi_c'): 1, Metabolite('h_c'): 1, Metabolite('adp_c'): 1 }) reaction.gene_reaction_rule = 'b1779' pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) # should not change assert pseudo_id is None assert reaction.id == 'NPT1'
def test__normalize_pseudoreaction_atpm_reversed(): reaction = Reaction('notATPM') reaction.add_metabolites({ Metabolite('atp_c'): 1, Metabolite('h2o_c'): 1, Metabolite('pi_c'): -1, Metabolite('h_c'): -1, Metabolite('adp_c'): -1 }) reaction.lower_bound = -50 reaction.upper_bound = 100 pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'ATPM' assert reaction.lower_bound == -100 assert reaction.upper_bound == 50
def test__normalize_pseudoreaction_exchange_error_bad_name(): reaction = Reaction('gone') reaction.add_metabolites({Metabolite('glu__L_e'): -1}) assert _normalize_pseudoreaction(reaction.id, reaction) == 'EX_glu__L_e'
def test__normalize_pseudoreaction_exchange_error_bad_name(): reaction = Reaction('gone') reaction.add_metabolites({Metabolite('glu__L_e'): -1}) assert _normalize_pseudoreaction(reaction.id, reaction) == 'EX_glu__L_e'
def test__normalize_pseudoreaction_biomass(): reaction = Reaction('my_biomass_2') pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'BIOMASS_my_2' assert reaction.subsystem == 'Biomass and maintenance functions'
def test__normalize_pseudoreaction_biomass(): reaction = Reaction('my_biomass_2') pseudo_id = _normalize_pseudoreaction(reaction.id, reaction) assert pseudo_id == 'BIOMASS_my_2' assert reaction.subsystem == 'Biomass and maintenance functions'