コード例 #1
0
        private void RunBakerCluster(string name, string dirName, string alignFile = null, DCDFile dcd = null)
        {
            DateTime        cpuPart1 = DateTime.Now;
            ClusterOutput   output   = null;
            DistanceMeasure distance = null;

            if (dcd == null)
            {
                distance = CreateMeasure(name, dirName, opt.threshold.hDistance, opt.threshold.hAtoms, opt.threshold.reference1Djury,
                                         alignFile, opt.threshold.hammingProfile, null);
            }
            else
            {
                distance = CreateMeasureForDCD(dcd, opt.threshold.hDistance, opt.threshold.hAtoms, opt.threshold.reference1Djury,
                                               opt.threshold.alignmentFileName, opt.threshold.hammingProfile, null);
            }

            ThresholdCluster bk = new ThresholdCluster(distance, opt.threshold.distThresh, opt.threshold.bakerNumberofStruct);

            if (beginJob != null)
            {
                beginJob(currentProcessName, bk.ToString(), dirName, distance.ToString());
            }


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

            clType = bk.ToString();
            output = bk.OrgClustering();
            UpdateOutput(name, dirName, alignFile, output, distance.ToString(), cpuPart1, cpuPart2, bk);
        }
コード例 #2
0
        private void RunFastHCluster(string name, string dirName, string alignFile = null, DCDFile dcd = null)
        {
            DateTime        cpuPart1 = DateTime.Now;
            ClusterOutput   clustOut = null;
            DistanceMeasure distance = null;

            if (dcd == null)
            {
                distance = CreateMeasure(name, dirName, opt.hierarchical.distance, opt.hierarchical.atoms, opt.hierarchical.reference1DjuryFast,
                                         alignFile, opt.hierarchical.hammingProfile, opt.hierarchical.jury1DProfileFast);
            }
            else
            {
                distance = CreateMeasureForDCD(dcd, opt.hierarchical.distance, opt.hierarchical.atoms, opt.hierarchical.reference1DjuryFast,
                                               opt.hierarchical.alignmentFileName, opt.hierarchical.hammingProfile, opt.hierarchical.jury1DProfileFast);
            }

            FastDendrog km;

            km = new FastDendrog(distance, opt.hierarchical, dirName);
            if (beginJob != null)
            {
                beginJob(currentProcessName, km.ToString(), dirName, distance.ToString());
            }

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

            clType   = km.ToString();
            clustOut = km.Run(new List <string>(distance.structNames.Keys));
            UpdateOutput(name, dirName, alignFile, clustOut, distance.ToString(), cpuPart1, cpuPart2, km);
        }
コード例 #3
0
        private void RunHierarchicalCluster(string name, string dirName, string alignFile = null, DCDFile dcd = null)
        {
            DateTime        cpuPart1 = DateTime.Now;
            DistanceMeasure distance = null;

            //distance.CalcDistMatrix(distance.structNames);
            // opt.hierarchical.atoms = PDB.PDBMODE.ALL_ATOMS;
            if (dcd != null)
            {
                distance = CreateMeasureForDCD(dcd, opt.hierarchical.distance, opt.hierarchical.atoms, opt.hierarchical.reference1DjuryAglom,
                                               opt.hierarchical.alignmentFileName, opt.hierarchical.hammingProfile, opt.hierarchical.jury1DProfileAglom);
            }
            else
            {
                distance = CreateMeasure(name, dirName, opt.hierarchical.distance, opt.hierarchical.atoms, opt.hierarchical.reference1DjuryAglom,
                                         alignFile, opt.hierarchical.hammingProfile, opt.hierarchical.jury1DProfileAglom);
            }

            DebugClass.WriteMessage("Measure Created");
            hierarchicalCluster hk = new hierarchicalCluster(distance, opt.hierarchical, dirName);

            if (beginJob != null)
            {
                beginJob(currentProcessName, hk.ToString(), dirName, distance.ToString());
            }
            clType = hk.ToString();
            ClusterOutput output;

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

            output = hk.HierarchicalClustering(new List <string>(distance.structNames.Keys));
            UpdateOutput(name, dirName, alignFile, output, distance.ToString(), cpuPart1, cpuPart2, hk);
        }
コード例 #4
0
        public string UsedMeasure()
        {
            if (dist != null)
            {
                return(dist.ToString());
            }

            return("NONE");
        }
コード例 #5
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);
        }
コード例 #6
0
        private void RunHKMeans(string name, string dirName, string alignFile = null, DCDFile dcd = null)
        {
            DateTime        cpuPart1 = DateTime.Now;
            ClusterOutput   clustOut = null;
            DistanceMeasure distance = null;

            if (dcd == null)
            {
                distance = CreateMeasure(name, dirName, opt.hierarchical.distance, opt.hierarchical.atoms, opt.hierarchical.reference1DjuryKmeans,
                                         alignFile, opt.hierarchical.hammingProfile, opt.hierarchical.jury1DProfileKmeans);
            }
            else
            {
                distance = CreateMeasureForDCD(dcd, opt.hierarchical.distance, opt.hierarchical.atoms, opt.hierarchical.reference1DjuryKmeans,
                                               opt.hierarchical.alignmentFileName, opt.hierarchical.hammingProfile, opt.hierarchical.jury1DProfileKmeans);
            }

            kMeans km;

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

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

            distance.InitMeasure();



            clType       = km.ToString();
            km.BMIndex   = opt.hierarchical.indexDB;
            km.threshold = opt.hierarchical.numberOfStruct;
            km.maxRepeat = opt.hierarchical.repeatTime;
            km.maxK      = opt.hierarchical.maxK;
            clustOut     = km.HierarchicalKMeans();
            UpdateOutput(name, dirName, alignFile, clustOut, distance.ToString(), cpuPart1, cpuPart2, km);
        }
コード例 #7
0
        private void Run3DJury(string name, string dirName, string alignFile = null, DCDFile dcd = null)
        {
            DateTime        cpuStart = DateTime.Now;
            ClusterOutput   output;
            DistanceMeasure distance = null;

            if (alignFile != null)
            {
                distance = CreateMeasure(name, null, opt.other.oDistance, opt.other.oAtoms, opt.other.reference1Djury,
                                         alignFile, opt.other.hammingProfile, opt.other.referenceProfile);
            }
            else
            if (dirName != null)
            {
                distance = CreateMeasure(name, dirName, opt.other.oDistance, opt.other.oAtoms, opt.other.reference1Djury,
                                         alignFile, opt.other.hammingProfile, opt.other.referenceProfile);
            }
            else
            {
                distance = CreateMeasureForDCD(dcd, opt.other.oDistance, opt.other.oAtoms, opt.other.reference1Djury,
                                               opt.other.alignFileName, opt.other.hammingProfile, opt.other.referenceProfile);
            }
            Jury3D ju = new Jury3D(distance);

            if (beginJob != null)
            {
                beginJob(currentProcessName, ju.ToString(), dirName, distance.ToString());
            }

            progressDic.Add(name, ju);
            distance.InitMeasure();
            clType = ju.ToString();
            output = ju.Run3DJury();
            UpdateOutput(name, dirName, alignFile, output, distance.ToString(), cpuStart, DateTime.Now, ju);
            progressDic.Remove(name);
        }