Beispiel #1
0
        /// <summary>
        /// Author: Andy Tang
        /// </summary>
        protected void Search_Textbox_Changed(object sender, EventArgs e)
        {
            search_drop_down.Items.Clear();
            search_drop_down.Items.Add(DROP_DOWN_PROMPT_MESSAGE);

            List <Protein_Information> proteinList = new List <Protein_Information>();

            const int minPrefixLength = 3;

            if (search_textBox.Text.Length < minPrefixLength)
            {
                return;
            }
            Drug_Information drug = EF_Data.GetDrugsQuery(search_textBox.Text).FirstOrDefault();

            if (drug != null)
            {
                List <PDB_Information> pdbInfoList = EF_Data.GetPDBInfoUsingDrug(drug.Drug_PDB_ID);

                foreach (PDB_Information pdb in pdbInfoList)
                {
                    Protein_Information protein = EF_Data.GetProteinByUniprotID(pdb.UniProt_ID);

                    if (protein != null)
                    {
                        proteinList.Add(protein);
                    }
                }
            }

            if (proteinList.Count > 0)
            {
                List <string> valuesList = new List <string>();

                foreach (Protein_Information protein in proteinList)
                {
                    valuesList.Add(protein.UniProt_ID);
                    valuesList.Add(protein.Protein_Short_Name);
                    valuesList.Add(protein.Protein_Full_Name);
                    valuesList.Add(protein.Protein_Alias);
                    valuesList.Add(protein.NCBI_RefSeq_NP_ID);
                    valuesList.Add(protein.PhosphoNET_Name);
                    valuesList.Add(protein.PDB_Protein_Name);
                }

                valuesList = DataUtilities.FilterDropdownList(valuesList);

                foreach (string value in valuesList)
                {
                    search_drop_down.Items.Add(new ListItem(value, value, true));
                }
            }
            else
            {
                search_drop_down.Items.Clear();
                search_drop_down.Items.Add(DROP_DOWN_NO_MATCHES_MESSAGE);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Author: Garth Nelson
        /// </summary>
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            SNV_ID_Key = Request.QueryString["query_string"];

            try
            {
                string stringAfterPDot   = SNV_ID_Key.Substring(SNV_ID_Key.IndexOf("p.") + 2);
                string specifiedAAType   = new string(stringAfterPDot.TakeWhile(c => char.IsLetter(c)).ToArray());
                string specifiedAANumber = new string(stringAfterPDot.Substring(specifiedAAType.Length).TakeWhile(c => char.IsNumber(c)).ToArray());
                string specifiedAA       = specifiedAAType + "-" + specifiedAANumber;

                mutations       = EF_Data.GetMutationsBySNVIDKey(SNV_ID_Key);
                proteinMutation = EF_Data.GetMutationBySNVIDKey(SNV_ID_Key);
                protein         = EF_Data.GetProteinByUniprotID(proteinMutation.UniProt_ID);

                foreach (SNV_Mutation mutation in mutations)
                {
                    Drug_Information drug = EF_Data.GetDrugByDrugPDBID(mutation.Drug_PDB_ID);

                    drugs.Add(drug);

                    PDB_Interaction interaction = EF_Data.GetPDB_Interaction(mutation.UniProt_ID, mutation.Drug_PDB_ID, specifiedAA);

                    interactions.Add(interaction);
                }

                Session["drugs"]        = drugs;
                Session["interactions"] = interactions;
                Session["mutations"]    = mutations;
                Session["SNV_ID_Key"]   = SNV_ID_Key;

                LoadSNVID(SNV_ID_Key);
                LoadTargetGeneID(protein, mutations[0]);

                CreateIDofPDILinkedSNVTable(drugs, interactions, mutations);
            }
            catch (Exception)
            {
                Page.Master.FindControl("BodyContentPlaceHolder").Visible = false;
                ExceptionUtilities.DisplayAlert(this, QUERY_PAGE);
            }
        }