Hello Ken,
I think that such complex conditions can be archived in SMARTS, because there is a way to specify that an atoms doesn't belong to a specific fragment using !$(...) notation. I can help you to create such a query, but I didn't fully understand your case with tetracycline, because I'm not a chemist... Could you give me the input structure (for example is SMILES notation) and the desired structure? As I understand the input is CN(C)[C@H]1C2CC3C(=C(O)[C@]2(O)C(=O)C(C(N)=O)=C1O)C(=O)C1=C(O)C=CC=C1[C@@]3(C)O
And in addition I see that we have to care about aromaticity when specified SMARTS query for this structure.
As an alternative, and can propose another solution, which is not currently available in Indigo:
1. You can highlight all the atoms that you are interested in, or not interested. For example, you can specify a template, find all substructure matches, and highlight corresponding atoms.
2. And you can add a constraint on the all query atoms in the transformation reaction that they match only highlighted atoms (or not highlighted). Even now there is a method called addConstraint that works for query atoms and bonds, but we do not support highlighting constraing now.
3. As a result your transformation will be applied only to a specific parts of a molecule specified with highlighting.
Will it work for you? It is not hard to add such functionality, if it would be useful.
Best regards,
Mikhail