def CheckCNS(mol, detail=False, showSMILES=False): """ Check mol under CNS Reference: Jeffrey, Phil, and Scott Summerfield. Neurobiol Dis, 37.1 (2010): 33-37. Rule details: 135 <= weight <= 582 -0.2 <= logP <= 6.1 nha <= 5 nhd <= 3 3 <= TPSA <= 118 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of REOS MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) tPSA = molproperty.CalculateTPSA(mol) #Determine whether the molecular match each rule aMW = (135 <= MW <= 582) alogP = (-0.2 <= logP <= 6.1) anHD = (nHD <= 3) anHA = (nHA <= 5) atPSA = (3 <= tPSA <= 118) #Give the advice if (aMW & alogP & anHD & anHA & atPSA): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 5 - (aMW + alogP + anHD + anHA + atPSA) #res if detail: items = ['MW', 'logP', 'nHD', 'nHA', 'tPSA', 'Disposed', 'nViolate'] vals = (MW, logP, nHD, nHA, tPSA, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckXuRule(mol, detail=False, showSMILES=False): """ Check molecular under Xu's rule Reference: Rule details: nhd <= 5 nha <= 10 3 <= rot <= 35 1 <= nring <= 7 10 <= nhev <= 50 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of Xu's rule nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) nRot = molproperty.CalculateNumRotatableBonds(mol) nRing = molproperty.CalculateNumRing(mol) nHev = molproperty.CalculateNumHeavyAtom(mol) #Determine whether the molecular match each rule anHD = (nHD <= 5) anHA = (nHA <= 10) anRot = (3 <= nRot <= 35) anRing = (1 <= nRing <= 7) anHev = (10 <= nHev <= 50) #Give the advice if (anHD & anHA & anRot & anRing & anHev): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 5 - (anHD + anHA + anRot + anRing + anHev) #res if detail: items = ['nHD', 'nHA', 'nRot', 'nRing', 'nHev', 'Disposed', 'nViolate'] vals = (nHD, nHA, nRot, nRing, nHev, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckRo2(mol, detail=False, showSMILES=False): """ Check molecular under RO2 Ref.: Goldberg, Frederick W., et al. Drug Discovery Today 20.1 (2015): 11-17. Rule details: MW <= 200 Logp <= 2 NHD <= 2 NHA <= 4 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of REOS MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) #Determine whether the molecular match each rule aMW = (MW <= 200) alogP = (logP <= 2) anHD = (nHD <= 2) anHA = (nHA <= 4) #Give the advice if (aMW & alogP & anHD & anHA): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 4 - (aMW + alogP + anHD + anHA) #res if detail: items = ['MW', 'logP', 'nHD', 'nHA', 'Disposed', 'nViolate'] vals = (MW, logP, nHD, nHA, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckLipinskiRule(mol, detail=False, showSMILES=False): """ Check molecular under Lipinski's rule Reference: Lipinski, Christopher A., et al. Advanced drug delivery reviews 23.1-3 (1997): 3-25. Rule details: MW <= 500(Da) logP <= 5 nHD <= 5 nHA <= 10 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of Lipinskin's rule MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) #Determine whether the molecular match each rule aw = (MW <= 500) alogp = (logP <= 5) anhd = (nHD <= 5) anha = (nHA <= 10) #Count the number of matched rules nviolate = 4 - (aw + alogp + anhd + anha) #Give the disposed if nviolate >= 2: disposed = 'Rejected' else: disposed = 'Accepted' if detail: items = ['MW', 'logP', 'nHD', 'nHA', 'Disposed', 'nViolate'] vals = [MW, logP, nHD, nHA, disposed, nviolate] else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckRo4(mol, detail=False, showSMILES=False): """ Referenece: Rule details: MW <= 400 logP <= 4 nHD <= 4 nHA <= 8 TPSA <= 120 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of REOS MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) tPSA = molproperty.CalculateTPSA(mol) #Determine whether the molecular match each rule aMW = (MW <= 400) alogP = (logP <= 4) anHD = (nHD <= 4) anHA = (nHA <= 8) atPSA = (tPSA <= 120) #Give the advice if (aMW & alogP & anHD & anHA & atPSA): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 5 - (anHD + anHA + aMW + alogP + atPSA) #res if detail: items = ['MW', 'logP', 'nHD', 'nHA', 'tPSA', 'Disposed', 'nViolate'] vals = (MW, logP, nHD, nHA, tPSA, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckRo3(mol, detail=False, showSMILES=False): """ Check molecular under Ro3 Ref.: Congreve, Miles, et al. Drug discovery today 19.8 (2003): 876-877. Rule details: MW <= 300 -3 <= logP <= 3 NHD <= 3 NHA <= 6 PSA <= 60 nRot <= 3 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of REOS MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) tPSA = molproperty.CalculateTPSA(mol) nRot = molproperty.CalculateNumRotatableBonds(mol) #Determine whether the molecular match each rule aMW = (MW <= 300) alogP = (-3 <= logP <= 3) anHD = (nHD <= 3) anHA = (nHA <= 6) atPSA = (tPSA <= 60) aRot = (nRot <= 3) #Give the advice if (aMW & alogP & anHD & anHA & atPSA & anRot): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 6 - (aMW + alogP + anHD + anHA + atPSA + anRot) #res if detail: items = [ 'MW', 'logP', 'nHD', 'nHA', 'tPSA', 'nRot', 'Disposed', 'nViolate' ] vals = (MW, logP, nHD, nHA, tPSA, nRot, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckREOS(mol, detail=False, showSMILES=False): """ Check molecular under REOS program Reference: Walters, W. Patrick, and Mark Namchuk. Nat Rev Drug Discov, 2.4 (2003): 259. Rule details: 200 <= MW <= 500 -5 <= logP <= 5 nHD <= 5 nHA <= 10 nRot <= 8 TPSA <= 150 -4 <= fChar <= 4 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of REOS MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) nRot = molproperty.CalculateNumRotatableBonds(mol) TPSA = molproperty.CalculateTPSA(mol) fChar = molproperty.CalculateMolFCharge(mol) #Determine whether the molecular match each rule amw = (200 <= MW <= 500) alogP = (-5 <= logP <= 5) anhd = (nHD <= 5) anha = (nHA <= 10) anrot = (nRot <= 8) atpsa = (TPSA <= 150) afchar = (-4 <= fChar <= 4) #Give the advice if (amw & alogP & anhd & anha & anrot & atpsa & afchar): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 7 - (amw + alogP + anhd + anha + anrot + atpsa + afchar) #Res if detail: items = [ 'MW', 'logP', 'nHD', 'nHA', 'nRot', 'TPSA', 'fChar', 'Disposed', 'nViolate' ] vals = (MW, logP, nHD, nHA, nRot, TPSA, fChar, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic
def CheckBeyondRo5(mol, detail=False, showSMILES=False): """ Check molecular under beyond Ro5 Reference: Doak, Bradley C., et al. journal of medicinal chemistry 59.6 (2015): 2312-2327. Rule details: MW <= 1000 -2 <= logP <= 10 nHD <= 6 nHA <= 15 PSA <= 250 nRot <= 20 :param mol: molecule :type mol: rdkit.Chem.rdchem.Mol :param detail: Control returning specific infomation or not, defaults to False :type detail: bool, optional :param showSMILES: Control returning SMILES or not, defaults to False :type showSMILES: bool, optional :return: Result after scanning. If detail has been set to False, only return 'Disposed' and 'nViolate', otherwise exrta returning each property :rtype: `dict` """ #Calculate required properties of Lipinskin's rule MW = molproperty.CalculateMolWeight(mol) logP = molproperty.CalculateLogP(mol) nHD = molproperty.CalculateNumHDonors(mol) nHA = molproperty.CalculateNumHAcceptors(mol) PSA = molproperty.CalculateTPSA(mol) nRot = molproperty.CalculateNumRotatableBonds(mol) #Determine whether the molecular match each rule aMW = (MW <= 1000) alogP = (-2 <= logP <= 10) anHD = (nHD <= 6) anHA = (nHA <= 15) aPSA = (PSA <= 250) aRot = (nRot <= 20) #Check whether mol pass the whole rules if (aMW & alogP & anHD & anHA & aRot & aPSA): disposed = 'Accepted' else: disposed = 'Rejected' #Count the number of violated rules nviolate = 6 - (aMW + alogP + anHD + anHA + aRot + aPSA) if detail: items = [ 'MW', 'logP', 'nHD', 'nHA', 'PSA', 'nRot', 'Disposed', 'nViolate' ] vals = (MW, logP, nHD, nHA, PSA, nRot, disposed, nviolate) else: items = ['Disposed', 'nViolate'] vals = (disposed, nviolate) dic = {'SMILES': Chem.MolToSmiles(mol)} if showSMILES else {} dic.update(dict(zip(items, vals))) return dic