Shaozen,
?0?2?0?2?0?2 I have successfully used the solution outlined in this SO answer
...
https://stackoverflow.com/questions/2281850/timeout-function-if-it-takes-too-long-to-finish
?0?2?0?2?0?2 It uses Posix signals so it wouldn't work on older versions of
Windows (I don't know about Windows 10, what with this new
Linux-compatibility layer). It also doesn't work when running under
mod_wsgi.
?0?2?0?2?0?2 ?0?2?0?2?0?2 Francis
On 15/11/2018 04:21, ?????? wrote:
Hi:
I want to set?0?2timeout for the function named RunReactants, because
sometimes?0?2I found there needs?0?2 over 10 minutes when running this
function. For example:
>>import rdkit.Chem as Chem
>>from rdkit.Chem import AllChem
>>from rdkit.Chem import MolFromSmiles,MolFromSmarts
>>from rdkit.Chem.Fingerprints import FingerprintMols
>>reactants =
['CC(C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C)=CC=CC=C(C)C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C',
'CC(C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C)=CC=CC=C(C)C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C',
'CC(C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C)=CC=CC=C(C)C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C',
'CC(C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C)=CC=CC=C(C)C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C',
'CC(C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C)=CC=CC=C(C)C=CC=C(C)C=CC1=C(C)C(=O)C(OP(=O)(O)O)CC1(C)C',
'CC(C)=CCCC(C)=CCCC(C)=CCCC(C)=CCCC(C)=CCCC(C)=CCCC(C)=CCCC(C)=CCCC(C)=CCOP(=O)(O)OP(=O)(O)O']
>>rule =
'[O:10][P:11](=[O:12])([O:13])[O:14].[O:40][P:41](=[O:42])([O:43])[O:44].[O:30][P:31](=[O:32])([O:33])[O:34].[O:50][P:51](=[O:52])([O:53])[O:54].[O:20][P:21](=[O:22])([O:23])[O:24].[C:1]([CH3:2])=[C:3][C:4][CH2:5][C:6]([CH3:7])=[C:8][C:9][CH2:25][C:26]([CH3:27])=[C:28][C:29][CH2:35][C:36]([CH3:37])=[C:38][C:39][CH2:45][C:46]([CH3:47])=[C:48][C:49][CH2:55][C:56]([CH3:57])=[C:58][C:59][O:0]>>[C:1]([CH3:2])=[C:3][C:4][O:0].[CH2:5]=[C:6]([CH3:7])[C:8][C:9][O:10][P:11](=[O:12])([O:13])[O:14].[CH2:25]=[C:26]([CH3:27])[C:28][C:29][O:20][P:21](=[O:22])([O:23])[O:24].[CH2:45]=[C:46]([CH3:47])[C:48][C:49][O:40][P:41](=[O:42])([O:43])[O:44].[CH2:35]=[C:36]([CH3:37])[C:38][C:39][O:30][P:31](=[O:32])([O:33])[O:34].[CH2:55]=[C:56]([CH3:57])[C:58][C:59][O:50][P:51](=[O:52])([O:53])[O:54]'
>>rxnrs = [Chem.MolFromSmiles(reactant) for reactant in reactants]
>>rxn = AllChem.ReactionFromSmarts(rule)
>>outcomes = rxn.RunReactants(rxnrs)
if this functions cannnot return result within 3s, I will make it
return a empty set.
Could you help me deal with this problems?
Thanks a lot.
Yours
Shaozhen
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
--
Dr Francis L Atkinson
Chemogenomics Group
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Genome Campus
Hinxton
Cambridge CB10 1SD
United Kingdom
(01223) 494473
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss