You need to run the reaction twice (or more generally you can rerun runreactants on the products iteratively until their are no more new products, so examples like phloroglucinol to 1,3,5-trifluorobenzene will work too.) best wishes wim
On Sun, Aug 6, 2023 at 4:50 PM Andreas Luttens <andreas.lutt...@gmail.com> wrote: > Dear RDKit community, > > I'm trying to convert phenolic hydroxyls into fluorines with runReactants. > In my example below, I attempt turning resorcinol into 3-fluorophenol and > 1,3-difluorobenzene. > > #include <string> > #include <vector> > #include <GraphMol/GraphMol.h> > #include <GraphMol/SmilesParse/SmilesParse.h> > #include <GraphMol/SmilesParse/SmilesWrite.h> > #include <GraphMol/ChemReactions/Reaction.h> > #include <GraphMol/ChemReactions/ReactionParser.h> > > int main() > { > RDKit::ChemicalReaction *rxn = RDKit::RxnSmartsToChemicalReaction(" > [c:1][OH]>>[c:1][F]"); > rxn->initReactantMatchers(); > > RDKit::ROMol *mol_to_convert(RDKit::SmilesToMol("c1cc(cc(c1)O)O")); > > RDKit::MOL_SPTR_VECT reacts; > > reacts.push_back(RDKit::ROMOL_SPTR(mol_to_convert)); > > std::vector<RDKit::MOL_SPTR_VECT> converted_molecules; > > converted_molecules = rxn->runReactants(reacts,1); > > for (const auto& product_vector : converted_molecules) > { > for (const auto& product : product_vector) > { > std::string converted_smiles = RDKit::MolToSmiles(*product); > std::cout << "Converted smiles: " << converted_smiles << std::endl; > } > } > return 0; > } > > No matter what *unsigned int* I choose for the number of products, I get > a single molecule (3-fluorophenol) as output. Resorcinol has two hydroxyls > that can turn into fluorines, why is 1,3-difluorobenzene not listed as a > product? > > Thanks in advance! > > Best regards, > Andreas > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss