Hi James, some time ago I implemented a filter function during a pdb mining campaign. The Idea was to exclude compounds to far away from drug like chemical matter. The function I wrote is not the prettiest one, but it is somehow complementary to your substructure matching. The filter function uses typical descriptors you might want to have in a filter routine, so maybe this can give some inspiration. I added the import statement and some print statements in order to make cut and paste play-arounds easier: ----Snip------------------------ from Chem import Descriptors, Crippen, Lipinski, AvailDescriptors #For more Descriptors try AvailDescriptors.descList def DLfilter(mol): try: if Descriptors.MolWt(mol) <= 100 or Descriptors.MolWt(mol) >=800: print 'Failed in filter function MolWt:',Descriptors.MolWt(mol) return False if Lipinski.NumHDonors(mol) >= 5: print 'Failed in filter function NumHDonors:',Lipinski.NumHDonors(mol) return False if Lipinski.NumHAcceptors(mol) >= 10: print 'Failed in filter function NumHAcceptors:',Lipinski.NumHAcceptors(mol) return False if Crippen.MolLogP(mol) <= -4 or Crippen.MolLogP(mol) >= 6: print 'Failed in filter function LogP:',Crippen.MolLogP(mol) return False if Lipinski.NumRotatableBonds(mol) >= 15: print 'Failed in filter function NumRotatableBonds:',Lipinski.NumRotatableBonds(mol) return False else: return True except: print "D'oh" return False ----Snip------------------------ Kind regards, Markus James Davidson wrote: Hi Greg, Thanks for the reply.1. In RDKit, has the 'cleaning / washing / salt-stripping' of molecules already been formalised based on a set of rules, etc?Not that I'm aware of on the open-source side of things. All of the functionality required to do this is, I believe, present in the RDKit though.Great - I certainly found all the functionality I was looking for, but just wanted to make sure I wasn't missing any short-cuts!2. When identifying compounds that contain a non-allowedatom-type,why do I find the SMARTS def [!H;!C;!N;!O;!F;!S;!Cl;!Br;!I] gives unexpected results, but [!#1;!#6;!#7;!#8;!#9;!#16;!#17;!#35;!#53] works as I would expect?This is a fairly common SMARTS "gotcha": in SMARTS the query "[C]" means "aliphatic C". This leads to the following behavior: [3]>>> Chem.MolFromSmiles('c1ccccc1').GetSubstructMatches(Chem.MolFro mSmarts('[!C]')) Out[3] ((0,), (1,), (2,), (3,), (4,), (5,)) If you want to be sure that your SMARTS will capture aliphatic or aromatic atoms, you need to provide the atomic numbers, as in your second query: [4]>>> Chem.MolFromSmiles('c1ccccc1').GetSubstructMatches(Chem.MolFro mSmarts('[!#6]')) Out[4] ()Wow - I really was having some sort of mental block yesterday! (goes-off to look for some sort of embarrassed + dunce smiley...) Kind regards James ______________________________________________________________________ PLEASE READ: This email is confidential and may be privileged. It is intended for the named addressee(s) only and access to it by anyone else is unauthorised. If you are not an addressee, any disclosure or copying of the contents of this email or any action taken (or not taken) in reliance on it is unauthorised and may be unlawful. If you have received this email in error, please notify the sender or postmas...@vernalis.com. Email is not a secure method of communication and the Company cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please check this email for virus infection for which the Company accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated, any views or opinions presented are solely those of the author and do not represent those of the Company. The Vernalis Group of Companies Oakdene Court 613 Reading Road Winnersh, Berkshire RG41 5UA. Tel: +44 118 977 3133 To access trading company registration and address details, please go to the Vernalis website at www.vernalis.com and click on the "Company address and registration details" link at the bottom of the page.. ______________________________________________________________________ ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss |
------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss