public hierarchicalCluster(DistanceMeasure dMeasure, HierarchicalCInput hier, string dirName)
 {
     this.dMeasure    = dMeasure;
     this.linkageType = hier.linkageType;
     this.dirName     = dirName;
     progressRead     = 0;
     hierOpt          = hier;
 }
 public HashClusterDendrog(DCDFile dcd, HashCInput input, HierarchicalCInput dendrogOpt) : base(dcd, input)
 {
     this.dMeasure       = dendrogOpt.distance;
     this.linkageType    = dendrogOpt.linkageType;
     this.atoms          = dendrogOpt.atoms;
     this.jury1d         = dendrogOpt.reference1DjuryH;
     this.profileName    = dendrogOpt.hammingProfile;
     this.refJuryProfile = dendrogOpt.jury1DProfileH;
     hier = dendrogOpt;
 }
Beispiel #3
0
 public FastDendrog(DistanceMeasure dMeasure, HierarchicalCInput input, string dirName)
 {
     this.dMeasure     = dMeasure;
     this.initNodesNum = input.numInitNodes;
     this.linkage      = input.linkageType;
     this.useKMeans    = input.ItMeans;
     this.hConcensus   = input.HConsensus;
     this.kMeansIter   = input.ItNum;
     this.dirName      = dirName;
     this.input        = input;
 }
Beispiel #4
0
 public FastDendrog(DistanceMeasure dMeasure,HierarchicalCInput input,string dirName)
 {
     this.dMeasure = dMeasure;
     this.initNodesNum = input.numInitNodes;
     this.linkage = input.linkageType;
     this.useKMeans = input.ItMeans;
     this.hConcensus = input.HConsensus;
     this.kMeansIter = input.ItNum;
     this.dirName = dirName;
     this.input = input;
   
 }
        public HierarchicalCForm(HierarchicalCInput obj,ClusterAlgorithm alg,INPUTMODE mode,bool flag,List<string> profiles)
        {
            this.alg = alg;
            objCopy = obj;
            this.mode = mode;
            InitializeComponent();
            if (profiles != null)
            {
                button3.Visible = true;
                profileFile = profiles[0];
            }
            else
                button3.Visible = false;

            userHash1.regularizationOff();
            SizeHeight = this.Size.Height;
            distanceControl1.refChanged = ReferanceCheckChanged;
            //distanceControl1.FreezeCAtoms();
            Settings set = new Settings();
            set.Load();
            if (set.mode == INPUTMODE.RNA)
                distanceControl1.HideAtoms = true;
            
            foreach (var item in Enum.GetValues(typeof(AglomerativeType)))
                comboBox1.Items.Add(Enum.GetName(typeof(AglomerativeType),item));

            if (obj != null)
            {                
                comboBox1.SelectedItem=Enum.GetName(typeof(AglomerativeType),obj.linkageType);                
                numericBox1.Text = obj.numInitNodes.ToString();
                DBIndex.Value = (decimal)obj.indexDB;
                threshold.Value = (decimal)obj.numberOfStruct;
                maxRepeat.Value = (decimal)obj.repeatTime;
                maxK.Value = (decimal)obj.maxK;
                
                switch (alg)
                {
                    case ClusterAlgorithm.FastHCluster:
                        AglomRadio.Checked = false;
                        FastHClusterRadio.Checked = true;
                        KmeansRadio.Checked = false;
                        userHash1.Visible = false;
                        radioButton3.Checked = false;
                        groupBox1.Visible = true;
                        if (radioButton1.Checked)
                            if (distanceControl1.reference)
                                jury1DSetup3.Visible = false;
                            else
                                jury1DSetup3.Visible = true;
                        this.Size = new Size(this.Size.Width, SizeHeight / 2 + SizeHeight / 4);
                        distanceControl1.reference = obj.reference1DjuryFast;
                        distanceControl1.referenceProfile = obj.consensusProfile;
                        userHash1.profRefFile = obj.jury1DProfileFast;
                        break;
                    case ClusterAlgorithm.HKmeans:
                        AglomRadio.Checked = false;
                        FastHClusterRadio.Checked = false;
                        KmeansRadio.Checked = true;
                        groupBox1.Visible = false;
                        radioButton3.Checked = false;
                        userHash1.Visible = false;
                        this.Size = new Size(this.Size.Width, SizeHeight / 2 + SizeHeight/3);
                        distanceControl1.reference = obj.reference1DjuryKmeans;
                        distanceControl1.referenceProfile = obj.jury1DProfileKmeans;
                        break;
                    case ClusterAlgorithm.uQlustTree:
                        userHash1.Visible = true;
                        AglomRadio.Checked = false;
                        FastHClusterRadio.Checked = false;
                        KmeansRadio.Checked = false;
                        groupBox1.Visible = false;
                        radioButton3.Checked = true;
                        this.Size = new Size(this.Size.Width, SizeHeight);
                        distanceControl1.reference = obj.reference1DjuryH;
                        distanceControl1.referenceProfile = obj.jury1DProfileH;
                        break;
                    default://Aglomerative
                        AglomRadio.Checked = true;
                        FastHClusterRadio.Checked = false;
                        KmeansRadio.Checked = false;
                        groupBox1.Visible = false;
                        userHash1.Visible = false;
                        radioButton3.Checked = false;
                        distanceControl1.reference = obj.reference1DjuryAglom;
                        distanceControl1.referenceProfile = obj.jury1DProfileAglom;
                        break;
                }
                distanceControl1.distDef = obj.distance;
                distanceControl1.CAtoms = obj.atoms;
                distanceControl1.profileName = obj.hammingProfile;
                
                jury1DSetup3.profileName = obj.consensusProfile;
                checkBox2.Checked = obj.ItMeans;
                numericUpDown1.Value = obj.ItNum;
                if (obj.HConsensus)
                {
                    radioButton1.Checked = false;
                    radioButton2.Checked = true;
                }
                else
                {
                    radioButton1.Checked = true;
                    radioButton2.Checked = false;
                }
                if (flag)
                {
                    distanceControl1.FreezDist();
                  //  distanceControl1.distDef = DistanceMeasures.HAMMING;
                }
               // distanceControl1.CAtoms = PDB.PDBMODE.ONLY_CA;
                userHash1.SetHash(obj.hash);
            }
        }
        private void SetOptions()
        {
            userHash1.UpdateMode();
            localOpt = new HierarchicalCInput();
            localOpt.linkageType = (AglomerativeType) Enum.Parse(typeof(AglomerativeType), comboBox1.SelectedItem.ToString());
            localOpt.numInitNodes = Convert.ToInt32(numericBox1.Text);
            localOpt.indexDB = (float)DBIndex.Value;
            localOpt.numberOfStruct = (int)threshold.Value;
            localOpt.repeatTime = (int)maxRepeat.Value;
            localOpt.maxK = (int)maxK.Value;
            if (AglomRadio.Checked)
            {
                alg = ClusterAlgorithm.HierarchicalCluster;
                localOpt.reference1DjuryAglom = distanceControl1.reference;
                localOpt.jury1DProfileAglom= distanceControl1.referenceProfile;
            }
            else
                if (FastHClusterRadio.Checked)
                {
                    alg = ClusterAlgorithm.FastHCluster;
                    localOpt.reference1DjuryFast = distanceControl1.reference;
                    localOpt.consensusProfile = distanceControl1.referenceProfile;
                    if (distanceControl1.reference)
                    {
                        localOpt.jury1DProfileFast = distanceControl1.referenceProfile;

                    }
                }
                else
                    if (KmeansRadio.Checked)
                    {
                        alg = ClusterAlgorithm.HKmeans;
                        localOpt.reference1DjuryKmeans = distanceControl1.reference;
                        localOpt.jury1DProfileKmeans = distanceControl1.referenceProfile;
                    }
                    else
                    {
                        alg = ClusterAlgorithm.uQlustTree;
                        localOpt.reference1DjuryH = distanceControl1.reference;
                        localOpt.jury1DProfileH = distanceControl1.referenceProfile;
                    }

            localOpt.distance = distanceControl1.distDef;
            localOpt.atoms = distanceControl1.CAtoms;
            localOpt.hammingProfile = distanceControl1.profileName;
            //localOpt.usedJuryForRef = distanceControl1.reference;
            localOpt.consensusProfile = jury1DSetup3.profileName;
            localOpt.ItMeans = checkBox2.Checked;
            if (radioButton1.Checked)
                localOpt.HConsensus = false;
            else
                localOpt.HConsensus = true ;

            localOpt.ItNum = (int)numericUpDown1.Value;

            localOpt.hash = userHash1.GetHash();

        }