예제 #1
0
        private void ShowSequences(IList <string> items)
        {
            string tblTxt = "";
            string facet  = "";
            int    c      = 0;

            foreach (string item in items)
            {
                PivotItem pivotItem     = MainPivotViewer.GetItem(item);
                string    queryName     = "";
                string    querySequence = "";
                foreach (KeyValuePair <string, IList <string> > kvp in pivotItem.Facets)
                {
                    if (kvp.Key == "QueryName")
                    {
                        string   val  = String.Join(", ", ((List <string>)kvp.Value).ToArray());
                        string[] vals = Regex.Split(val, "[|]{2}");
                        if (vals.Length > 1)
                        {
                            facet = vals[1];
                        }
                        else
                        {
                            facet = vals[0];
                        }
                        queryName = facet;
                    }
                    if (kvp.Key == "QuerySequence")
                    {
                        string   val  = String.Join(", ", ((List <string>)kvp.Value).ToArray());
                        string[] vals = Regex.Split(val, "[|]{2}");
                        if (vals.Length > 1)
                        {
                            facet = vals[1];
                        }
                        else
                        {
                            facet = vals[0];
                        }
                        querySequence = facet;
                    }
                }
                tblTxt += ">" + queryName + "\n" + querySequence + "\n";
                c      += 1;
            }
            ChildWindow childWin = new ChildWindow();

            childWin.Width  = 800;
            childWin.Height = 400;
            childWin.Title  = "BL!P Query Sequences in FASTA Format";
            TextBox tb = new TextBox();

            tb.Text          = tblTxt;
            childWin.Content = tb;
            tb.IsReadOnly    = true;
            tb.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            tb.VerticalScrollBarVisibility   = ScrollBarVisibility.Visible;
            childWin.Show();
        }
예제 #2
0
        private void ShowItemTable(IList <string> items)
        {
            string tblTxt = "";
            string facet  = "";
            int    c      = 0;

            foreach (string item in items)
            {
                PivotItem pivotItem = MainPivotViewer.GetItem(item);
                if (c == 0)
                {
                    foreach (KeyValuePair <string, IList <string> > kvp in pivotItem.Facets)
                    {
                        if (validFacet(kvp.Key))
                        {
                            tblTxt += kvp.Key + "\t";
                        }
                    }
                    tblTxt += "\n";
                }

                foreach (KeyValuePair <string, IList <string> > kvp in pivotItem.Facets)
                {
                    if (validFacet(kvp.Key))
                    {
                        string   val  = String.Join(", ", ((List <string>)kvp.Value).ToArray());
                        string[] vals = Regex.Split(val, "[|]{2}");
                        if (vals.Length > 1)
                        {
                            facet = vals[1];
                        }
                        else
                        {
                            facet = vals[0];
                        }
                        tblTxt += facet + "\t";
                    }
                }
                tblTxt += "\n";
                c      += 1;
            }

            ChildWindow childWin = new ChildWindow();

            childWin.Width  = 800;
            childWin.Height = 400;
            childWin.Title  = "BL!P Output in Tablular Format";
            TextBox tb = new TextBox();

            tb.Text          = tblTxt;
            childWin.Content = tb;
            tb.IsReadOnly    = true;
            tb.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            tb.VerticalScrollBarVisibility   = ScrollBarVisibility.Visible;
            childWin.Show();
        }
예제 #3
0
        private void PivotViewerControl_ItemDoubleClicked(object sender, System.Windows.Pivot.ItemEventArgs e)
        {
            PivotItem piv_item = MainPivotViewer.GetItem(e.ItemId);

            if (!string.IsNullOrWhiteSpace(piv_item.Href))
            {
                MainPivotViewer.CurrentItemId = e.ItemId;

                OpenLink(piv_item.Href);
            }
            else
            {
                MessageBox.Show("No Web Page...");
            }
        }