Exemple #1
0
def _CalculateGearyAutocorrelation(mol, lag=1, propertylabel="m"):
    """
    #################################################################
    **Internal used only**

    Calculation of Geary autocorrelation descriptors based on

    different property weights.

    Usage:

    res=_CalculateGearyAutocorrelation(mol,lag=1,propertylabel='m')

    Input: mol is a molecule object.

    lag is the topological distance between atom i and atom j.

    propertylabel is the weighted property.

    Output: res is a numeric value.
    #################################################################
    """

    Natom = mol.GetNumAtoms()

    prolist = []
    for i in mol.GetAtoms():
        temp = GetRelativeAtomicProperty(i.GetSymbol(),
                                         propertyname=propertylabel)
        prolist.append(temp)

    aveweight = sum(prolist) / Natom

    tempp = [numpy.square(x - aveweight) for x in prolist]

    GetDistanceMatrix = Chem.GetDistanceMatrix(mol)
    res = 0.0
    index = 0
    for i in range(Natom):
        for j in range(Natom):
            if GetDistanceMatrix[i, j] == lag:
                atom1 = mol.GetAtomWithIdx(i)
                atom2 = mol.GetAtomWithIdx(j)
                temp1 = GetRelativeAtomicProperty(element=atom1.GetSymbol(),
                                                  propertyname=propertylabel)
                temp2 = GetRelativeAtomicProperty(element=atom2.GetSymbol(),
                                                  propertyname=propertylabel)
                res = res + numpy.square(temp1 - temp2)
                index = index + 1
            else:
                res = res + 0.0

    if sum(tempp) == 0 or index == 0:
        result = 0
    else:
        result = (res / index / 2) / (sum(tempp) / (Natom - 1))

    return round(result, 3)
Exemple #2
0
def _CalculateMoreauBrotoAutocorrelation(mol, lag=1, propertylabel="m"):
    """
    #################################################################
    **Internal used only**

    Calculation of Moreau-Broto autocorrelation descriptors based on

    different property weights.

    Usage:

    res=_CalculateMoreauBrotoAutocorrelation(mol, lag=1,propertylabel='m')

    Input: mol is a molecule object.

    lag is the topological distance between atom i and atom j.

    propertylabel is the weighted property.

    Output: res is a numeric value.
    #################################################################
    """

    Natom = mol.GetNumAtoms()

    GetDistanceMatrix = Chem.GetDistanceMatrix(mol)
    res = 0.0
    for i in range(Natom):
        for j in range(Natom):
            if GetDistanceMatrix[i, j] == lag:
                atom1 = mol.GetAtomWithIdx(i)
                atom2 = mol.GetAtomWithIdx(j)
                temp1 = GetRelativeAtomicProperty(element=atom1.GetSymbol(),
                                                  propertyname=propertylabel)
                temp2 = GetRelativeAtomicProperty(element=atom2.GetSymbol(),
                                                  propertyname=propertylabel)
                res = res + temp1 * temp2
            else:
                res = res + 0.0

    return round(numpy.log(res / 2 + 1), 3)
Exemple #3
0
def _GetBurdenMatrix(mol, propertylabel="m"):
    """
    #################################################################
    *Internal used only**

    Calculate Burden matrix and their eigenvalues.
    #################################################################
    """
    mol = Chem.AddHs(mol)
    Natom = mol.GetNumAtoms()

    AdMatrix = Chem.GetAdjacencyMatrix(mol)
    bondindex = numpy.argwhere(AdMatrix)
    AdMatrix1 = numpy.array(AdMatrix, dtype=numpy.float32)

    # The diagonal elements of B, Bii, are either given by
    # the carbon normalized atomic mass,
    # van der Waals volume, Sanderson electronegativity,
    # and polarizability of atom i.

    for i in range(Natom):
        atom = mol.GetAtomWithIdx(i)
        temp = GetRelativeAtomicProperty(element=atom.GetSymbol(),
                                         propertyname=propertylabel)
        AdMatrix1[i, i] = round(temp, 3)

    # The element of B connecting atoms i and j, Bij,
    # is equal to the square root of the bond
    # order between atoms i and j.

    for i in bondindex:
        bond = mol.GetBondBetweenAtoms(int(i[0]), int(i[1]))
        if bond.GetBondType().name == "SINGLE":
            AdMatrix1[i[0], i[1]] = round(numpy.sqrt(1), 3)
        if bond.GetBondType().name == "DOUBLE":
            AdMatrix1[i[0], i[1]] = round(numpy.sqrt(2), 3)
        if bond.GetBondType().name == "TRIPLE":
            AdMatrix1[i[0], i[1]] = round(numpy.sqrt(3), 3)
        if bond.GetBondType().name == "AROMATIC":
            AdMatrix1[i[0], i[1]] = round(numpy.sqrt(1.5), 3)

    ##All other elements of B (corresponding non bonded
    # atom pairs) are set to 0.001
    bondnonindex = numpy.argwhere(AdMatrix == 0)

    for i in bondnonindex:
        if i[0] != i[1]:

            AdMatrix1[i[0], i[1]] = 0.001

    return numpy.real(numpy.linalg.eigvals(AdMatrix1))
Exemple #4
0
def test_pymolecule():

    from rdkit import Chem
    from openbabel import pybel
    from PyBioMed.PyMolecule.AtomProperty import (
        AtomProperty,
        GetAbsoluteAtomicProperty,
        GetRelativeAtomicProperty,
    )

    from PyBioMed.PyMolecule.estate import GetEstate
    from PyBioMed.PyMolecule.constitution import GetConstitutional
    from PyBioMed.PyMolecule.fingerprint import CalculateECFP4Fingerprint
    from PyBioMed.PyMolecule.connectivity import GetConnectivity
    from PyBioMed.PyMolecule.charge import GetCharge
    from PyBioMed.PyMolecule.bcut import GetBurden
    from PyBioMed.PyMolecule.basak import Getbasak
    from PyBioMed.PyMolecule.geary import GetGearyAuto
    from PyBioMed.PyMolecule.kappa import GetKappa
    from PyBioMed.PyMolecule.moe import GetMOE
    from PyBioMed.PyMolecule.molproperty import GetMolecularProperty
    from PyBioMed.PyMolecule.moran import GetMoranAuto
    from PyBioMed.PyMolecule.moreaubroto import GetMoreauBrotoAuto
    from PyBioMed.PyMolecule.topology import GetTopology
    from PyBioMed.PyMolecule.ghosecrippen import GhoseCrippenFingerprint
    from PyBioMed.PyMolecule.cats2d import CATS2D

    print("...............................................................")
    print("testing the AtomProperty module")

    for i, j in AtomProperty.items():
        print(j)
    print(GetAbsoluteAtomicProperty(element="S", propertyname="En"))
    print(GetRelativeAtomicProperty(element="S", propertyname="En"))
    # ==============================================================================
    # Getbasak
    # ==============================================================================
    print("...............................................................")
    print("testing the Getbasak module")

    smi5 = [
        "CCCCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCCCCN", "c1ccccc1N"
    ]
    for index, smi in enumerate(smi5):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", Getbasak(m))
        print(len(Getbasak(m)))
    # ==============================================================================
    # GetBurden, bcut model
    # ==============================================================================
    print("...............................................................")
    print("testing the bcut module")

    smi5 = [
        "CCOCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCCCCN", "c1ccccc1N",
        "C"
    ]
    for index, smi in enumerate(smi5):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi, "\n")
        print(GetBurden(m))
        print(len(GetBurden(m)))
    # ==============================================================================
    # GetCharge
    # ==============================================================================
    print("...............................................................")
    print("testing the GetCharge module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    smi5 = [
        "CCCCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCCCCN", "c1ccccc1N"
    ]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetCharge(m))
        print(len(GetCharge(m)))
    # ==============================================================================
    # GetConnectivity
    # ==============================================================================
    print("...............................................................")
    print("testing the GetConnectivity module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    smi5 = [
        "CCCCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCCCCN", "c1ccccc1N"
    ]

    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetConnectivity(m))
        print("\t", len(GetConnectivity(m)))

    # ==============================================================================
    # GetConstitutional
    # ==============================================================================
    print("...............................................................")
    print("testing the GetConstitutional module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    smi5 = [
        "CCCCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCCCCN", "c1ccccc1N"
    ]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetConstitutional(m))
        print(len(GetConstitutional(m)))
    # ==============================================================================
    # GetEstate
    # ==============================================================================
    print("...............................................................")
    print("testing the GetEstate module")

    smi5 = [
        "COCCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCOCCN", "c1ccccc1N"
    ]
    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        #        print '\t',CalculateEstateFingerprint(m)
        #        print '\t',CalculateEstateValue(m)
        #        print '\t',CalculateMaxAtomTypeEState(m)
        #        print '\t', CalculateMinAtomTypeEState(m)

        print(GetEstate(m))
    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("fingerprint......")

    ms = [
        Chem.MolFromSmiles("CCOC=N"),
        Chem.MolFromSmiles("NC1=NC(=CC=N1)N1C=CC2=C1C=C(O)C=C2"),
    ]
    m2 = [pybel.readstring("smi", "CCOC=N"), pybel.readstring("smi", "CCO")]
    res1 = CalculateECFP4Fingerprint(ms[0])
    print(res1)
    res2 = CalculateECFP4Fingerprint(ms[1])
    print(res2)
    #    print CalculateSimilarityRdkit(res1[2],res2[2])
    #    print CalculateSimilarityPybel(res1,res2)

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetGearyAuto module")

    smi5 = [
        "COCCCC", "CCC(C)CC", "CC(C)CCC", "CC(C)C(C)C", "CCOCCN", "c1ccccc1N"
    ]
    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        ##        print '\t',CalculateEstateFingerprint(m)
        ##        print '\t',CalculateEstateValue(m)
        ##        print '\t',CalculateMaxAtomTypeEState(m)
        ##        print '\t', CalculateMinAtomTypeEState(m)

        print(GetGearyAuto(m))

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetKappa module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetKappa(m))
        print("\t", len(GetKappa(m)))

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetMOE module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetMOE(m))
        print("\t", len(GetMOE(m)))
    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetMolecularProperty module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetMolecularProperty(m))

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetMoranAuto module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        ##        print '\t',CalculateEstateFingerprint(m)
        ##        print '\t',CalculateEstateValue(m)
        ##        print '\t',CalculateMaxAtomTypeEState(m)
        ##        print '\t', CalculateMinAtomTypeEState(m)

        print(GetMoranAuto(m))

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetMoreauBrotoAuto module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-].[Na+]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        ##        print '\t',CalculateEstateFingerprint(m)
        ##        print '\t',CalculateEstateValue(m)
        ##        print '\t',CalculateMaxAtomTypeEState(m)
        ##        print '\t', CalculateMinAtomTypeEState(m)

        print(len(GetMoreauBrotoAuto(m)))
    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the GetTopology module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-]"]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print(index + 1)
        print(smi)
        print("\t", GetTopology(m))
        print("\t", len(GetTopology(m)))

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the CATS2D module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-]"]

    for i in smis:
        mol = Chem.MolFromSmiles(i)
        cats = CATS2D(mol, PathLength=10, scale=3)
        print("\t", cats)
        print("\t", len(cats))

    # ==============================================================================
    #
    # ==============================================================================
    print("...............................................................")
    print("testing the ghoseFP module")

    smis = ["CCCC", "CCCCC", "CCCCCC", "CC(N)C(=O)O", "CC(N)C(=O)[O-]"]

    for i in smis:
        mol = Chem.MolFromSmiles(i)
        ghoseFP = GhoseCrippenFingerprint(mol)
        print("\t", ghoseFP)
        print("\t", len(ghoseFP))

    print("testing the ghose_count module")

    for i in smis:
        mol = Chem.MolFromSmiles(i)
        ghose_count = GhoseCrippenFingerprint(mol, count=True)
        print("\t", ghose_count)
        print("\t", len(ghose_count))
Exemple #5
0
def test_pymolecule():

    from rdkit import Chem
    import pybel
    from PyBioMed.PyMolecule.AtomProperty import AtomProperty, GetAbsoluteAtomicProperty, GetRelativeAtomicProperty

    from PyBioMed.PyMolecule.estate import GetEstate
    from PyBioMed.PyMolecule.constitution import GetConstitutional
    from PyBioMed.PyMolecule.fingerprint import CalculateECFP4Fingerprint
    from PyBioMed.PyMolecule.connectivity import GetConnectivity
    from PyBioMed.PyMolecule.charge import GetCharge
    from PyBioMed.PyMolecule.bcut import GetBurden
    from PyBioMed.PyMolecule.basak import Getbasak
    from PyBioMed.PyMolecule.geary import GetGearyAuto
    from PyBioMed.PyMolecule.kappa import GetKappa
    from PyBioMed.PyMolecule.moe import GetMOE
    from PyBioMed.PyMolecule.molproperty import GetMolecularProperty
    from PyBioMed.PyMolecule.moran import GetMoranAuto
    from PyBioMed.PyMolecule.moreaubroto import GetMoreauBrotoAuto
    from PyBioMed.PyMolecule.topology import GetTopology
    from PyBioMed.PyMolecule.ghosecrippen import GhoseCrippenFingerprint
    from PyBioMed.PyMolecule.cats2d import CATS2D

    print '...............................................................'
    print 'testing the AtomProperty module'

    for i, j in AtomProperty.items():
        print j
    print GetAbsoluteAtomicProperty(element='S', propertyname='En')
    print GetRelativeAtomicProperty(element='S', propertyname='En')
    #==============================================================================
    # Getbasak
    #==============================================================================
    print '...............................................................'
    print 'testing the Getbasak module'

    smi5 = [
        'CCCCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCCCCN', 'c1ccccc1N'
    ]
    for index, smi in enumerate(smi5):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', Getbasak(m)
        print len(Getbasak(m))
    #==============================================================================
    # GetBurden, bcut model
    #==============================================================================
    print '...............................................................'
    print 'testing the bcut module'

    smi5 = [
        'CCOCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCCCCN', 'c1ccccc1N',
        'C'
    ]
    for index, smi in enumerate(smi5):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi, '\n'
        print GetBurden(m)
        print len(GetBurden(m))
    #==============================================================================
    # GetCharge
    #==============================================================================
    print '...............................................................'
    print 'testing the GetCharge module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    smi5 = [
        'CCCCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCCCCN', 'c1ccccc1N'
    ]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetCharge(m)
        print len(GetCharge(m))
    #==============================================================================
    # GetConnectivity
    #==============================================================================
    print '...............................................................'
    print 'testing the GetConnectivity module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    smi5 = [
        'CCCCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCCCCN', 'c1ccccc1N'
    ]

    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetConnectivity(m)
        print '\t', len(GetConnectivity(m))

    #==============================================================================
    # GetConstitutional
    #==============================================================================
    print '...............................................................'
    print 'testing the GetConstitutional module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    smi5 = [
        'CCCCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCCCCN', 'c1ccccc1N'
    ]
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetConstitutional(m)
        print len(GetConstitutional(m))
    #==============================================================================
    # GetEstate
    #==============================================================================
    print '...............................................................'
    print 'testing the GetEstate module'

    smi5 = [
        'COCCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCOCCN', 'c1ccccc1N'
    ]
    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        #        print '\t',CalculateEstateFingerprint(m)
        #        print '\t',CalculateEstateValue(m)
        #        print '\t',CalculateMaxAtomTypeEState(m)
        #        print '\t', CalculateMinAtomTypeEState(m)

        print GetEstate(m)
    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print "fingerprint......"

    ms = [
        Chem.MolFromSmiles('CCOC=N'),
        Chem.MolFromSmiles('NC1=NC(=CC=N1)N1C=CC2=C1C=C(O)C=C2')
    ]
    m2 = [pybel.readstring("smi", 'CCOC=N'), pybel.readstring("smi", 'CCO')]
    res1 = CalculateECFP4Fingerprint(ms[0])
    print res1
    res2 = CalculateECFP4Fingerprint(ms[1])
    print res2
    #    print CalculateSimilarityRdkit(res1[2],res2[2])
    #    print CalculateSimilarityPybel(res1,res2)

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetGearyAuto module'

    smi5 = [
        'COCCCC', 'CCC(C)CC', 'CC(C)CCC', 'CC(C)C(C)C', 'CCOCCN', 'c1ccccc1N'
    ]
    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        ##        print '\t',CalculateEstateFingerprint(m)
        ##        print '\t',CalculateEstateValue(m)
        ##        print '\t',CalculateMaxAtomTypeEState(m)
        ##        print '\t', CalculateMinAtomTypeEState(m)

        print GetGearyAuto(m)

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetKappa module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetKappa(m)
        print '\t', len(GetKappa(m))

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetMOE module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetMOE(m)
        print '\t', len(GetMOE(m))
    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetMolecularProperty module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetMolecularProperty(m)

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetMoranAuto module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        ##        print '\t',CalculateEstateFingerprint(m)
        ##        print '\t',CalculateEstateValue(m)
        ##        print '\t',CalculateMaxAtomTypeEState(m)
        ##        print '\t', CalculateMinAtomTypeEState(m)

        print GetMoranAuto(m)

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetMoreauBrotoAuto module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-].[Na+]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        ##        print '\t',CalculateEstateFingerprint(m)
        ##        print '\t',CalculateEstateValue(m)
        ##        print '\t',CalculateMaxAtomTypeEState(m)
        ##        print '\t', CalculateMinAtomTypeEState(m)

        print len(GetMoreauBrotoAuto(m))
    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the GetTopology module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-]']
    for index, smi in enumerate(smis):
        m = Chem.MolFromSmiles(smi)
        print index + 1
        print smi
        print '\t', GetTopology(m)
        print '\t', len(GetTopology(m))

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the CATS2D module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-]']

    for i in smis:
        mol = Chem.MolFromSmiles(i)
        cats = CATS2D(mol, PathLength=10, scale=3)
        print '\t', cats
        print '\t', len(cats)

    #==============================================================================
    #
    #==============================================================================
    print '...............................................................'
    print 'testing the ghoseFP module'

    smis = ['CCCC', 'CCCCC', 'CCCCCC', 'CC(N)C(=O)O', 'CC(N)C(=O)[O-]']

    for i in smis:
        mol = Chem.MolFromSmiles(i)
        ghoseFP = GhoseCrippenFingerprint(mol)
        print '\t', ghoseFP
        print '\t', len(ghoseFP)

    print 'testing the ghose_count module'

    for i in smis:
        mol = Chem.MolFromSmiles(i)
        ghose_count = GhoseCrippenFingerprint(mol, count=True)
        print '\t', ghose_count
        print '\t', len(ghose_count)