示例#1
0
    def test_cluster_shape(self):
        sdffile = os.path.join(self.dataDir, 'fda_drugs_light.sdf')
        lib = SmallMolLib(sdffile)
        mols = lib._mols

        cl, det = cluster(mols, 'shape', returnDetails=True)

        n_clusters = det['numClusters']

        self.assertIsInstance(n_clusters, np.int64, msg="None valid number of clusters")
示例#2
0
    def test_cluster_pathFingerprints(self):
        sdffile = os.path.join(self.dataDir, 'fda_drugs_light.sdf')
        lib = SmallMolLib(sdffile)
        mols = lib._mols

        cl, det = cluster(mols, 'pathFingerprints', returnDetails=True)

        ref_ncluster = PATHFINGERPRINTS_N_CLUSTER
        ref_populations = PATHFINGERPRINTS_POPULATION_CLUSTER

        ncluster = det['numClusters']
        population = det['populations'].tolist()

        self.assertEqual(ncluster, ref_ncluster, msg="The number of cluster identified are not as expected")
        self.assertEqual(population, ref_populations, msg="The population fo the cluster are not the expected one")
示例#3
0
    def test_cluster_mcs(self):
        sdffile = os.path.join(self.dataDir, "fda_drugs_light.sdf")
        lib = SmallMolLib(sdffile)
        mols = lib._mols

        _, det = cluster(mols, "mcs", returnDetails=True)

        ref_ncluster = MCS_N_CLUSTER
        ref_populations = MCS_POPULATION_CLUSTER

        ncluster = det["numClusters"]
        population = det["populations"].tolist()

        self.assertEqual(
            ncluster,
            ref_ncluster,
            msg="The number of cluster identified are not as expected",
        )
        self.assertEqual(
            population,
            ref_populations,
            msg="The population fo the cluster are not the expected one",
        )