Exemple #1
0
        public ClusterOutput Run(List <string> structs)
        {
            maxProgress     = 5;
            currentProgress = 0;
            if (hConcensus)
            {
                maxProgress++;
                consensus      = new HammingConsensus(dMeasure.dirName, null, false, input.consensusProfile);
                progressObject = consensus;
                consensus.InitMeasure();
                currentProgress += 1.0 / maxProgress;
            }
            jury             = new jury1D();
            progressObject   = jury;
            currentProgress += 1.0 / maxProgress;
            progressObject   = null;
            jury.PrepareJury(dMeasure.dirName, dMeasure.alignFile, input.jury1DProfileFast);
            currentProgress += 1.0 / maxProgress;
            ClusterOutput clOut = new ClusterOutput();



            root.setStruct = structs;
//            if(hConcensus)
//                consensus.ToConsensusStates(structs);

            FastCluster(root);
            maxV = initNodesNum;
            while (st.Count > 0 && (leaves.Count + st.Count) < initNodesNum)
            {
                st.Sort(
                    delegate(HClusterNode p1, HClusterNode p2)
                {
                    return(p2.setStruct.Count.CompareTo(p1.setStruct.Count));
                }
                    );

                HClusterNode node = st[0];
                st.RemoveAt(0);
                FastCluster(node);
                currentV += leaves.Count + st.Count;
            }
            currentV         = maxV;
            currentProgress += 1.0 / maxProgress;
            while (st.Count > 0)
            {
                HClusterNode node = st[0];
                st.RemoveAt(0);
                leaves.Add(node);
            }
            MakeDendrogs(linkage);
            currentProgress += 1.0 / maxProgress;
            PrepareList();
            root           = ConnectDendrogs(linkage);
            root.levelDist = root.SearchMaxDist();
            root.realDist  = dMeasure.GetRealValue(root.levelDist);
            //CheckRefDistances();
            //dendrogList = RearangeDendrogram(root);
            //root = ConnectDendrogs();
            clOut.hNode      = root;
            currentProgress += 1.0 / maxProgress;
            return(clOut);
        }
Exemple #2
0
        public ClusterOutput Run(List<string> structs)
        {
            maxProgress=5;
            currentProgress=0;
            if (hConcensus)
            {
                maxProgress++;
                consensus = new HammingConsensus(dMeasure.dirName, null, false, input.consensusProfile);
                progressObject = consensus;
                consensus.InitMeasure();
                currentProgress += 1.0 / maxProgress;
            }
            jury = new jury1D();
            progressObject = jury;
            currentProgress += 1.0 / maxProgress;
            progressObject = null;
            jury.PrepareJury(dMeasure.dirName, dMeasure.alignFile, input.jury1DProfileFast);
            currentProgress += 1.0 / maxProgress;
            ClusterOutput clOut = new ClusterOutput();



            root.setStruct = structs;
//            if(hConcensus)
//                consensus.ToConsensusStates(structs);
                     
            FastCluster(root);
            maxV = initNodesNum;
            while (st.Count>0 && (leaves.Count+st.Count)<initNodesNum)
            {
                st.Sort(
                        delegate(HClusterNode p1, HClusterNode p2)
                        {                                        
                            return p2.setStruct.Count.CompareTo(p1.setStruct.Count);
                        }             
                );

                HClusterNode node = st[0];
                st.RemoveAt(0);
                FastCluster(node);
                currentV += leaves.Count + st.Count;
            }
            currentV = maxV;
            currentProgress+=1.0/maxProgress;
            while (st.Count > 0)
            {
                HClusterNode node = st[0];
                st.RemoveAt(0);
                leaves.Add(node);
            }
            MakeDendrogs(linkage);
            currentProgress+=1.0/maxProgress;
            PrepareList();
            root = ConnectDendrogs(linkage);
            root.levelDist = root.SearchMaxDist();
            root.realDist = dMeasure.GetRealValue(root.levelDist);
            //CheckRefDistances();
            //dendrogList = RearangeDendrogram(root);
            //root = ConnectDendrogs();
            clOut.hNode = root;
            currentProgress+=1.0/maxProgress;
            return clOut;
        }