I have a branched molecule just like in the Image (left one).
I want to add COOH at the end of each branch like Image (right one)
Here is the SMILES format of my molecule in a simplified form with 4 branches.
[N:1]([CH2:2][CH2:3][N:4]([CH2:47][CH2:48][CH:49]([NH:50][CH2:51][CH2:52][NH2:53])[O-:55])[CH2:66][CH2:67][CH:68]([NH:69][CH2:70][CH2:71][NH2:72])[O-:74])([CH2:9][CH2:10][CH:11]([NH:12][CH2:13][CH2:14][NH2:15])[O-:17])[CH2:28][CH2:29][CH:30]([NH:31][CH2:32][CH2:33][NH2:34])[O-:36]
I actually have a much bigger molecule but if i can find a way to do it with the simple one, i think i can extend the solution to the bigger one.
Here is a code example
mod_mol = Chem.ReplaceSubstructs(m,
Chem.MolFromSmiles('[NH2:34]'),
Chem.MolFromSmiles('[CH2:99]'),
replaceAll=True)
mod_mol[0]
for example i tried to change NH2 to CH2 but nothing happens.