Ejemplo n.º 1
0
        public static void enterTextMutPred(UVSearch main, ref WebBrowser webBrowserProvean)
        {
            HtmlElementCollection collection;

            collection = webBrowserProvean.Document.GetElementsByTagName("textarea");

            //change fasta header to put gene name first
            string fasta = ">" + main._Gene + "_" + main._RefSeq + "_" + main._protRefSeq + "\n" + main._FastaNH;

            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "pseq")
                {
                    element.SetAttribute("Value", fasta);
                }
            }

            collection = webBrowserProvean.Document.GetElementsByTagName("input");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "mut")
                {
                    element.SetAttribute("Value", main._Variant);
                }
                if (name == "email")
                {
                    element.SetAttribute("Value", main._Email);
                }
            }
        }
Ejemplo n.º 2
0
        public static void enterTextPMut(UVSearch main, ref WebBrowser webBrowserPMut)
        {
            //Comma or blank separated mutations
            HtmlElement           inputFasta = webBrowserPMut.Document.GetElementById("sequence-input");
            HtmlElementCollection collection = inputFasta.GetElementsByTagName("textarea");
            HtmlElement           textbox    = collection[0];

            textbox.SetAttribute("Value", main._Fasta);

            HtmlElement searchButton = webBrowserPMut.Document.GetElementById("search-sequences");

            searchButton.InvokeMember("click");

            HtmlElement chooseButton = webBrowserPMut.Document.GetElementById("choose-sequence");

            chooseButton.InvokeMember("click");

            HtmlElement mutationList = webBrowserPMut.Document.GetElementById("mutations-list");
            string      mutation     = main._VarArray[0] + main._VarArray[1] + main._VarArray[2];

            mutationList.SetAttribute("Value", mutation);

            webBrowserPMut.Document.InvokeScript("update_variants");

            HtmlElement analysisButton = webBrowserPMut.Document.GetElementById("start-analysis");

            analysisButton.InvokeMember("click");
        }
Ejemplo n.º 3
0
        public static void saveTextFile(UVSearch main, string filename, string URL)
        {
            string fpath = main._Path + "\\" + main._Gene + "_" + main._Variant + "_" + filename;

            TextWriter tw = new StreamWriter(fpath, false);

            tw.Write(URL);
            tw.Close();
        }
Ejemplo n.º 4
0
        public static void enterTextSNAP(UVSearch main, ref WebBrowser webBrowserMain)
        {
            HtmlElement element;

            element = webBrowserMain.Document.GetElementById("sequence");
            element.SetAttribute("Value", main._Fasta);
            element = webBrowserMain.Document.GetElementById("email");
            element.SetAttribute("Value", main._Email);

            submitSNAP(ref webBrowserMain);
        }
Ejemplo n.º 5
0
        public static void enterTextPROVEAN(UVSearch main, ref WebBrowser webBrowserProvean)
        {
            // Format <uniprot code> <position> <wild type AA> <variant AA>
            string variantEntry = main._protRefSeq + " " + main._VarArray[1] + " " + main._VarArray[0] + " " + main._VarArray[2];

            HtmlElement element;

            element = webBrowserProvean.Document.GetElementById("variants");
            element.SetAttribute("Value", variantEntry);
            submitProvean(ref webBrowserProvean);
        }
Ejemplo n.º 6
0
        public static void savePage(UVSearch main, string fileName, string documentText, Encoding wbrowserEncoding)
        {
            string fpath = "";

            if (main._Gene != null)
            {
                fpath = main._Path + "\\" + main._Gene + "_" + main._Variant + "_" + fileName;
            }
            File.WriteAllText(fpath,
                              documentText,
                              wbrowserEncoding);
        }
Ejemplo n.º 7
0
        public static bool enterTextSNPsandGO(UVSearch main, WebBrowser webBrowserSandGo)
        {
            //Find GO Terms
            string terms = GoTerms.GetGOs(main._RefSeq);

            if (!Regex.IsMatch(terms, @"^GO:\d+(?:\sGO:\d+){0,}") && terms != "")
            {
                Go_Manual    frm = new Go_Manual();
                DialogResult dlg = frm.ShowDialog();

                if (dlg == System.Windows.Forms.DialogResult.OK)
                {
                    terms = GoTerms.GetGOs(frm.Terms);
                }
            }

            if (terms == "")
            {
                terms = GOTerms();
                if (terms == "" || terms == null)
                {
                    return(false);
                }
            }

            //save GO terms
            Utilities.saveTextFile(main, "GOTerms.txt", terms);

            //Comma or blank separated mutations

            HtmlElementCollection collection;

            collection = webBrowserSandGo.Document.GetElementsByTagName("textarea");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "proteina")
                {
                    element.SetAttribute("Value", main._Fasta);
                }
                else if (name == "posizione")
                {
                    element.SetAttribute("Value", main._Variant);
                }
                else if (name == "gos")
                {
                    element.SetAttribute("Value", terms);
                }
            }
            return(true);
        }
Ejemplo n.º 8
0
        public static void enterTextPanther(UVSearch main, WebBrowser webBrowserMain)
        {
            //Comma or blank separated mutations

            HtmlElementCollection collection;

            collection = webBrowserMain.Document.GetElementsByTagName("textarea");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "sequence")
                {
                    element.SetAttribute("Value", main._FastaNH);
                }
                if (name == "substitutions")
                {
                    element.SetAttribute("Value", main._Variant);
                }
            }
        }
Ejemplo n.º 9
0
        public static void enterTextMutAssess(UVSearch main, WebBrowser webBrowserMain)
        {
            //Needs the shorter version of the refseq code (!?)
            string[] splitStr     = main._protRefSeq.Split('.');
            string   shortPRefSeq = splitStr[0];

            string varMA = shortPRefSeq + " " + main._Variant;

            HtmlElementCollection collection;

            collection = webBrowserMain.Document.GetElementsByTagName("textarea");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "vars")
                {
                    element.SetAttribute("Value", varMA);
                }
            }
        }
Ejemplo n.º 10
0
        public static void enterTextHANSA(UVSearch main, ref WebBrowser webBrowserHansa)
        {
            string variantEntry = main._VarArray[0] + " " + main._VarArray[1] + " " + main._VarArray[2];

            HtmlElementCollection collection;

            collection = webBrowserHansa.Document.GetElementsByTagName("textarea");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "fsequence")
                {
                    element.SetAttribute("Value", main._Fasta);
                }
                if (name == "mutlist")
                {
                    element.SetAttribute("Value", variantEntry);
                }
            }

            Utilities.submit(ref webBrowserHansa);
        }
Ejemplo n.º 11
0
        public static void enterTextPolyPhen2(UVSearch main, ref WebBrowser webBrowserPP2)
        {
            HtmlElementCollection collection;

            collection = webBrowserPP2.Document.GetElementsByTagName("textarea");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "seqres")
                {
                    element.SetAttribute("Value", main._Fasta);
                }
            }

            collection = webBrowserPP2.Document.GetElementsByTagName("input");
            foreach (HtmlElement element in collection)
            {
                string name = element.GetAttribute("name");
                if (name == "seqpos")
                {
                    element.SetAttribute("Value", main._VarArray[1]);
                }
                if (name == "description")
                {
                    element.SetAttribute("Value", main._Gene + ' ' + main._Variant);
                }
            }

            HtmlElement AAelement;

            AAelement = webBrowserPP2.Document.GetElementById("v1" + main._VarArray[0]);
            AAelement.InvokeMember("click");
            AAelement = webBrowserPP2.Document.GetElementById("v2" + main._VarArray[2]);
            AAelement.InvokeMember("click");

            PP2.submitPP2(ref webBrowserPP2);
        }
Ejemplo n.º 12
0
 public SelectTranscript(UVSearch main)
 {
     InitializeComponent();
     _main = main;
 }