Exemple #1
0
        private void RunKMeans(string name, string dirName, string alignFile = null, DCDFile dcd = null)
        {
            DateTime        cpuPart1 = DateTime.Now;
            ClusterOutput   clustOut;
            DistanceMeasure distance = null;

            if (dcd == null)
            {
                distance = CreateMeasure(name, dirName, opt.kmeans.kDistance, opt.kmeans.kAtoms, opt.kmeans.reference1Djury,
                                         alignFile, opt.kmeans.hammingProfile, opt.kmeans.jury1DProfile);
            }
            else
            {
                distance = CreateMeasureForDCD(dcd, opt.kmeans.kDistance, opt.kmeans.kAtoms, opt.kmeans.reference1Djury,
                                               opt.kmeans.alignmentFileName, opt.kmeans.hammingProfile, opt.kmeans.jury1DProfile);
            }

            kMeans km;

            km = new kMeans(distance, opt.kmeans.kMeans_init);
            if (beginJob != null)
            {
                beginJob(currentProcessName, km.ToString(), dirName, distance.ToString());
            }

            progressDic.Add(name, km);
            distance.InitMeasure();
            DateTime cpuPart2 = DateTime.Now;

            clType = km.ToString();
            if ((int)opt.kmeans.maxK <= 1)
            {
                throw new Exception("k in k-Means must be bigger then 1, right now is: " + (int)opt.kmeans.maxK);
            }
            if (distance.structNames.Count < 10)
            {
                throw new Exception("Number of structures to cluster must be bigger then 10 right now is: " + distance.structNames.Count);
            }

            clustOut = km.kMeansLevel((int)opt.kmeans.maxK, opt.kmeans.maxIter, new List <string>(distance.structNames.Keys));
            UpdateOutput(name, dirName, alignFile, clustOut, distance.ToString(), cpuPart1, cpuPart2, km);
            GC.SuppressFinalize(distance);
        }
Exemple #2
0
        private void RunKMeans(string name, string dirName, string alignFile=null, DCDFile dcd = null)
        {
            DateTime cpuPart1 = DateTime.Now;
            ClusterOutput clustOut;
            DistanceMeasure distance = null;

            if(dcd==null)
                distance = CreateMeasure(name,dirName,opt.kmeans.kDistance, opt.kmeans.kAtoms, opt.kmeans.reference1Djury,
                    alignFile, opt.kmeans.hammingProfile, opt.kmeans.jury1DProfile);
            else
                distance =CreateMeasureForDCD(dcd, opt.kmeans.kDistance, opt.kmeans.kAtoms, opt.kmeans.reference1Djury,
                    opt.kmeans.alignmentFileName, opt.kmeans.hammingProfile, opt.kmeans.jury1DProfile);

            kMeans km;            
            km = new kMeans(distance, opt.kmeans.kMeans_init);

            progressDic.Add(name, km);
            distance.InitMeasure();
            DateTime cpuPart2 = DateTime.Now;
            clType = km.ToString();
            if ((int)opt.kmeans.maxK <= 1)
                throw new Exception("k in k-Means must be bigger then 1, right now is: " + (int)opt.kmeans.maxK);
            if (distance.structNames.Count < 10)
                throw new Exception("Number of structures to cluster must be bigger then 10 right now is: " + distance.structNames.Count);

            clustOut = km.kMeansLevel((int)opt.kmeans.maxK, opt.kmeans.maxIter,new List <string>(distance.structNames.Keys));
            UpdateOutput(name, dirName,alignFile, clustOut, distance.ToString(), cpuPart1, cpuPart2,km);
            GC.SuppressFinalize(distance);                        
        }
Exemple #3
0
        ClusterOutput DivideSpaceKmeans(List <string> list)
        {
            kMeans km = new kMeans(dMeasure);

            return(km.kMeansLevel(2, 30, list));
        }
Exemple #4
0
 ClusterOutput DivideSpaceKmeans(List<string> list)
 {
      kMeans km = new kMeans(dMeasure);
      return km.kMeansLevel(2,30, list);
 }