def test_remove_cmps(self): chassis_1_smile = "[H+]" chassis_2_smile = "[H][O][C](=[O])[C](=[O])[C]([H])([H])[C]([H])([O][H])[C]([H])([O][H])[C]([H])([H])[H]" chassis_1 = Compound(chassis_1_smile) chassis_2 = Compound(chassis_2_smile) state_chassis = ChemicalCompoundState([chassis_1, chassis_2], organism=Test_organism_H) present_in_state = state_chassis.compound_in_state(chassis_1) state_chassis.remove_cmpd_from_state(chassis_1) present_in_state_after = state_chassis.compound_in_state(chassis_1) assert present_in_state and not present_in_state_after
def test_compound_in_state_yes(self): csmile = "[H][C](=[O])[C]([H])([H])[C]([H])([H])[H]" unstandardised = "C(=O)CC" compound = Compound(csmile) compound_ns = Compound(unstandardised) state = ChemicalCompoundState( [compound], organism=Test_organism_H) # state is not sanitised assert state.compound_in_state(compound_ns)
def test_compound_in_state_no(self): csmile = "[H][C](=[O])[C]([H])([H])[C]([H])([H])[H]" csmile_2 = "[H][O][C]([H])([H])[C]([H])([O][H])[C]([H])([H])[H]" compound = Compound(csmile) compound_2 = Compound(csmile_2) state = ChemicalCompoundState( [compound], organism=Test_organism_H) # state is not sanitised assert not state.compound_in_state(compound_2)
def test_compound_in_chassis_state(self): compound_1 = Compound("[H+]") compound_6 = Compound( "[H][N]=[C]([O][H])[C]1=[C]([H])[N]([C]2([H])[O][C]([H])([C]([H])([H])[O][P](=[O])([O][H])[O][P](=[O])([O][H])[O][C]([H])([H])[C]3([H])[O][C]([H])([n]4[c]([H])[n][c]5[c]([N]([H])[H])[n][c]([H])[n][c]54)[C]([H])([O][P](=[O])([O][H])[O][H])[C]3([H])[O][H])[C]([H])([O][H])[C]2([H])[O][H])[C]([H])=[C]([H])[C]1([H])[H]" ) compound_3459 = Compound( "[H][O][C](=[O])[C](=[O])[C]([H])([H])[C]([H])([O][H])[C]([H])([O][H])[C]([H])([H])[H]" ) chassis_metabolites = ChemicalCompoundState( [compound_1, compound_6, compound_3459], organism=Test_organism_H) assert chassis_metabolites.compound_in_state(compound_1)