The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 34: | Line 34: | ||
If the toolkit can do this with SMIRKS then feel free to show how that works, in addition to a solution which manipulates the graph directly. (Frankly, I haven't figured out how to do it with SMIRKS in OEChem.) |
If the toolkit can do this with SMIRKS then feel free to show how that works, in addition to a solution which manipulates the graph directly. (Frankly, I haven't figured out how to do it with SMIRKS in OEChem.) |
||
− | |||
− | ==OpenBabel/Rubabel== |
||
− | <source lang='ruby'> |
||
− | require 'rubabel' |
||
− | smarts = "[!$([NH]!@C(=O))&!D1&!$(*#*)]-&!@[!$([NH]!@C(=O))&!D1&!$(*#*)]" |
||
− | mol = Rubabel["c1ccc2c(c1)C(=NC(C(=O)N2CC(=O)O)Cc3ccc(cc3)O)c4cccc(c4)O"] |
||
− | mol.matches(smarts).each do |atom1, atom2| |
||
− | mol.delete(atom1.get_bond(atom2)) |
||
− | [atom1, atom2].each do |old_a| |
||
− | mol.add_bond!(old_a, mol.add_atom!(0)) |
||
− | end |
||
− | end |
||
− | </source> |
||
==OpenEye/Python== |
==OpenEye/Python== |