Пример #1
0
        public RpartSimple(Form parent, Settings set, ResultWindow results, string fileName = null)
        {
            InitializeComponent();
            this.parent = parent;
            dialog      = folderBrowserDialog1;
            if (set.mode == INPUTMODE.USER_DEFINED)
            {
                dialog      = openFileDialog1;
                label1.Text = "Choose user defined file with profiles";
            }
            this.Location = parent.Location;
            this.set      = set;
            if (fileName != null)
            {
                opt.ReadOptionFile(fileName);
                SetProfileOptions();
            }

            this.results = results;
            if (opt.hash.profileName != null)
            {
                tree.LoadProfiles(opt.hash.profileName);
                label9.Text = tree.GetStringActiveProfiles();
            }
        }
Пример #2
0
        private void toolLoad_Click(object sender, EventArgs e)
        {
            DialogResult res;

            if (filter == filterOPT.SIMILARITY)
            {
                openFileDialog1.Filter = "Profiles file (*.profiles)|*.profiles";
            }
            else
            {
                openFileDialog1.Filter = "Profiles file (*distance.profile)|*distance.profile";
            }
            string dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            if (Directory.Exists(dir + Path.DirectorySeparatorChar + "profiles"))
            {
                dir = dir + Path.DirectorySeparatorChar + "profiles";
            }
            openFileDialog1.InitialDirectory = dir;
            res = openFileDialog1.ShowDialog();
            if (res == DialogResult.OK)
            {
                fileName = openFileDialog1.FileName;
                treeProfiles.LoadProfiles(fileName);
                this.Text = fileName;
                ShowTree();
            }
        }
Пример #3
0
        private string LabelActiveProfiles(string fileName)
        {
            string      outStr = "";
            ProfileTree tree   = new ProfileTree();

            try
            {
                tree.LoadProfiles(fileName);
            }
            catch (Exception)
            {
                label2.Text = "";
                return(null);
            }
            inputMode = tree.GetModes();
            List <profileNode> active = tree.GetActiveProfiles();

            outStr = "Active profiles: ";
            if (active != null)
            {
                for (int i = 0; i < active.Count; i++)
                {
                    outStr += active[i].profName;
                    if (i < active.Count - 1)
                    {
                        outStr += ", ";
                    }
                }
            }

            return(outStr);
        }
Пример #4
0
        public ProfileForm(string fileName, string alignFile, filterOPT filter)
        {
            InitializeComponent();
            if (fileName == null || fileName.Length == 0)
            {
                this.Text = "Profile not defined";
            }
            else
            {
                this.Text     = fileName;
                this.fileName = fileName;
            }

            this.filter = filter;
            //profilesView.DrawMode = TreeViewDrawMode.OwnerDrawText;

            treeProfiles = new ProfileTree();
            if (fileName != null && fileName.Length > 0)
            {
                if (File.Exists(fileName))
                {
                    treeProfiles.LoadProfiles(fileName);
                }
            }

            ShowTree();
            //profilesView.
        }
Пример #5
0
        public void Prepare(List<KeyValuePair<string,string>> profilesStr,string profName,string profFile)
        {
            r = new ProfileTree();
            r.LoadProfiles(profFile);            
            
            foreach(var item in profilesStr)
            {
                List<string> aux = new List<string>(item.Value.Length);
                for (int i = 0; i < item.Value.Length; i++)
                    aux.Add(item.Value[i].ToString());

               r.AddItemsCombineStates(item.Key,aux);
                                
            }
        }
Пример #6
0
        void SetProfileOptions()
        {
            if (set.mode == INPUTMODE.USER_DEFINED)
            {
                if (opt.profileFiles.Count > 0)
                {
                    textBox1.Text = opt.profileFiles[0];
                }
            }
            else
            if (opt.dataDir.Count > 0)
            {
                textBox1.Text = opt.dataDir[0];
            }

            opt.clusterAlgorithm.Clear();
            opt.clusterAlgorithm.Add(ClusterAlgorithm.uQlustTree);
            label3.Text                  = opt.hash.profileName;
            relevantC.Value              = opt.hash.relClusters;
            distanceControl1.distDef     = opt.hierarchical.distance;
            distanceControl1.profileName = opt.hierarchical.hammingProfile;
            if (opt.hash.combine)
            {
                radioButton1.Checked = true;
            }
            else
            {
                Hash.Checked = true;
            }

            switch (set.mode)
            {
            case INPUTMODE.USER_DEFINED:
                distanceControl1.HideRmsdLike = true;
                distanceControl1.distDef      = DistanceMeasures.COSINE;
                break;

            case INPUTMODE.PROTEIN:
            case INPUTMODE.RNA:
                distanceControl1.HideCosine = true;
                break;
            }
            if (opt.hash.profileName != null)
            {
                tree.LoadProfiles(opt.hash.profileName);
                label9.Text = tree.GetStringActiveProfiles();
            }
        }
Пример #7
0
        public ProfileForm(string fileName,string alignFile,filterOPT filter)
        {
            InitializeComponent();
            if (fileName == null || fileName.Length == 0)
                this.Text = "Profile not defined";
            else
            {
                this.Text = fileName;
                this.fileName = fileName;
            }

            this.filter = filter;
            //profilesView.DrawMode = TreeViewDrawMode.OwnerDrawText;
            
            treeProfiles = new ProfileTree();
            if(fileName!=null && fileName.Length>0)
                if(File.Exists(fileName))
                    treeProfiles.LoadProfiles(fileName);
           
            ShowTree();
            //profilesView.
        }
Пример #8
0
        public ProfileForm(string fileName, string alignFile, filterOPT filter)
        {
            InitializeComponent();
            if (fileName == null || fileName.Length == 0)
            {
                this.Text = "Profile not defined";
            }
            else
            {
                this.Text     = fileName;
                this.fileName = fileName;
            }

            this.filter = filter;
            //profilesView.DrawMode = TreeViewDrawMode.OwnerDrawText;

            treeProfiles = new ProfileTree();
            if (fileName != null && fileName.Length > 0)
            {
                if (File.Exists(fileName))
                {
                    treeProfiles.LoadProfiles(fileName);
                    if (treeProfiles.combine == profileCombination.JOIN_STATES)
                    {
                        toolStripButton1.Enabled = false;
                        toolStripButton4.Enabled = true;
                    }
                    else
                    {
                        toolStripButton1.Enabled = true;
                        toolStripButton4.Enabled = false;
                    }
                }
            }

            ShowTree();
            //profilesView.
        }
Пример #9
0
        private string LabelActiveProfiles(string fileName)
        {
            string outStr = "";
            ProfileTree tree = new ProfileTree();
            if (fileName.Length > 0)
                tree.LoadProfiles(fileName);
            else
                return null;
            inputMode = tree.GetModes();
            List<profileNode> active = tree.GetActiveProfiles();
            outStr = "Active profiles: ";
            if(active!=null)
                for (int i = 0; i < active.Count; i++)
                {
                    outStr += active[i].profName;
                    if (i < active.Count - 1)
                        outStr += ", ";
                }

            return outStr;
        }
Пример #10
0
        private string LabelActiveProfiles(string fileName)
        {
            string outStr = "";
            ProfileTree tree = new ProfileTree();
            try
            {
                tree.LoadProfiles(fileName);
            }
            catch(Exception ex)
            {
                label2.Text = "";
            }
            inputMode = tree.GetModes();
            List<profileNode> active = tree.GetActiveProfiles();
            outStr = "Active profiles: ";
            if(active!=null)
                for (int i = 0; i < active.Count; i++)
                {
                    outStr += active[i].profName;
                    if (i < active.Count - 1)
                        outStr += ", ";
                }

            return outStr;
        }