Dear all, Guillaume and I had an off-list conversation about this and I'll be adding a small function to the RDKit Python interface that allows client code to provide a seed to the C random number generator. This provides a relatively simple way of solving this particular problem without adding additional complexity to the SMILES writing API.
-greg On Tue, Feb 19, 2019 at 9:25 PM Guillaume GODIN < guillaume.go...@firmenich.com> wrote: > Dear All, > > > > How to include a seed in order to change the output of MolToSmiles using > doRandom=True ? > > > > For example in this case each time I run this script I got same result so > random.seed only works at python level not c++: > > > > from rdkit import Chem > > import random > > import time > > > > def randseed(): > > randomSeed=random.randint(0,1e6) > > return randomSeed > > > > m = Chem.MolFromSmiles('C[C@H]1[C@@H]2CC[C@]3([C@@H](CCC(=C3[C@H > ]2OC1=O)C)O)C') > > random.seed( randseed() ) > > k =[] > > for i in range(3): > > k.append(Chem.MolToSmiles(m, doRandom=True)) > > print(k) > > > > random.seed( randseed() ) > > k =[] > > for i in range(3): > > k.append(Chem.MolToSmiles(m, doRandom=True)) > > print(k) > > > > > > *********************************************************************************** > DISCLAIMER > This email and any files transmitted with it, including replies and > forwarded copies (which may contain alterations) subsequently transmitted > from Firmenich, are confidential and solely for the use of the intended > recipient. The contents do not represent the opinion of Firmenich except to > the extent that it relates to their official business. > > *********************************************************************************** > _______________________________________________ > 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