Example #1
0
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
Example #2
0
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
Example #3
0
def CheckGhoseRule(mol, detail=False, showSMILES=False):
    """
    Check molecular under Ghose rule
    
    Reference.:
        Ghose, Arup K., Vellarkad N. Viswanadhan, and John J. Wendoloski. 
        Journal of combinatorial chemistry 1.1 (1999): 55-68.
    
    Rules details:
        -0.4 < logP < 5.6
        160 < MW < 480
        40 < MR< 130
        20 < nAtom < 70
    
    :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 Oprea
    logP = molproperty.CalculateLogP(mol)
    MW = molproperty.CalculateMolWeight(mol)
    MR = molproperty.CalculateMolMR(mol)
    nAtom = molproperty.CalculateNumAtoms(mol)
    #Determine whether the molecular match each rule
    alogP = (-0.4 < logP < 5.6)
    aMW = (160 < MW < 480)
    aMR = (40 < MR < 130)
    anAtom = (20 < nAtom < 70)
    #Give the advice
    if (alogP & aMW & aMR & anAtom):
        disposed = 'Accepted'
    else:
        disposed = 'Rejected'
    #Count the number of violated rules
    nviolate = 4 - (alogP + aMW + aMR + anAtom)
    #Res
    if detail:
        items = ['logP', 'MW', 'MR', 'nAtom', 'Disposed', 'nViolate']
        vals = (logP, MW, MR, nAtom, 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
Example #4
0
def CheckOralMacrocycles(mol, detail=False, showSMILES=False):
    """
    Check molecular under oral macrocycles rules
    
    Reference:
        Giordanetto, Fabrizio, and Jan Kihlberg.
        Journal of medicinal chemistry 57.2 (2013): 278-295.        

    Rule details:
        MW < 1000
        logP < 10
        nHD < 5
        TPSA < 250
    
    :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)
    tPSA = molproperty.CalculateTPSA(mol)
    #Determine whether the molecular match each rule
    aMW = (MW < 1000)
    alogP = (logP < 10)
    anHD = (nHD < 5)
    aPSA = (tPSA < 250)
    #Give the advice
    if (aMW & alogP & anHD & aPSA):
        disposed = 'Accepted'
    else:
        disposed = 'Rejected'
    #Count the number of violate rules
    nviolate = 4 - (aMW + alogP + anHD + aPSA)
    #res
    if detail:
        items = ['MW', 'logP', 'nHD', 'tPSA', 'Disposed', 'nViolate']
        vals = (MW, logP, nHD, 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
Example #5
0
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
Example #6
0
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
Example #7
0
def CheckGoldenTriangle(mol, detail=False, showSMILES=False):
    """
    Check molecular under 'Golden Triangle'
    
    Reference:
        Johnson, Ted W., Klaus R. Dress, and Martin Edwards.
        Bioorg Med Chem Lett, 19.19 (2009): 5560-5564.
        
    Rule details:
        200 <= MW <= 500
        -2 <= logD <= 5
    
    :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)
    logD = molproperty.CalculateLogD(mol)
    #Determine whether the molecular match each rule
    amw = (200 <= MW <= 500)
    alogd = (-2 <= logD <= 5)
    #Give the advice
    if (amw & alogd):
        disposed = 'Accepted'
    else:
        disposed = 'Rejected'
    #Count the number of violated rules
    nviolate = 2 - (amw + alogd)
    #Res
    if detail:
        items = ['MW', 'logD', 'Disposed', 'nViolate']
        vals = (MW, logD, 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
Example #8
0
def CheckGSKRule(mol, detail=False, showSMILES=False):
    """
    Check molecular under GSK rule(4/400 Rule)
    
    Reference:
        Gleeson, M. Paul.
        Journal of medicinal chemistry 51.4 (2008): 817-834.
        
    Rule details:
        MW <= 400
        logP <= 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
    MW = molproperty.CalculateMolWeight(mol)
    logP = molproperty.CalculateLogP(mol)
    #Determine whether the molecular match each rule
    aMW = (MW <= 400)
    alogP = (logP <= 4)
    #Give the advice
    if aMW & alogP:
        disposed = 'Accepted'
    else:
        disposed = 'Rejected'
    #Count the number of violated rules
    nviolate = 2 - (aMW + alogP)
    #res
    if detail:
        items = ['MW', 'logP', 'Disposed', 'nViolate']
        vals = (MW, logP, 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
Example #9
0
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
Example #10
0
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
Example #11
0
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
Example #12
0
def CheckRespiratory(mol, detail=False, showSMILES=False):
    """
    Check mol under Respiratory
    
    Reference:
        Ritchie, Timothy J., Christopher N. Luscombe, and Simon JF Macdonald. 
        J Chem Inf Model, 49.4 (2009): 1025-1032.
        
    Rule details:
        240<=MW<= 520
        -2.0<=logP<=4.7
        6<=nHB<=12
        51<=tPSA<=135
        3<=nRot<=8
        1<=nRing<=5
    
    :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)
    nHB = molproperty.CalculateNumHyBond(mol)
    tPSA = molproperty.CalculateTPSA(mol)
    nRot = molproperty.CalculateNumRotatableBonds(mol)
    nRing = molproperty.CalculateNumRing(mol)
    #Determine whether the molecular match each rule
    aMW = (240 <= MW <= 520)
    alogP = (-0.2 <= logP <= 4.7)
    anHB = (6 <= nHB <= 12)
    atPSA = (51 <= tPSA <= 135)
    anRot = (3 <= nRot <= 8)
    anRing = (1 <= nRing <= 5)
    #Give the advice
    if (aMW & alogP & anHB & atPSA & anRot & anRing):
        disposed = 'Accepted'
    else:
        disposed = 'Rejected'
    #Count the number of violated rules
    nviolate = 6 - (aMW + alogP + anHB + atPSA + anRot + anRing)
    #res
    if detail:
        items = [
            'MW', 'logP', 'nHB', 'tPSA', 'nRot', 'nRing', 'Disposed',
            'nViolate'
        ]
        vals = (MW, logP, nHB, tPSA, nRot, nRing, 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