Beispiel #1
0
        public static List <string> GetAutoCompleteData(string prefixText, int count)
        {
            const int     minPrefixLength = 3;
            List <string> valuesList      = new List <string>();

            if (prefixText.Length >= minPrefixLength)
            {
                try
                {
                    List <Protein_Information> proteins = EF_Data.GetProteinsInfoQuery(prefixText);

                    foreach (Protein_Information p in proteins)
                    {
                        valuesList.Add(p.Protein_Short_Name);
                        valuesList.Add(p.Protein_Full_Name);
                        valuesList.Add(p.NCBI_Gene_ID);
                        valuesList.Add(p.PDB_Protein_Name);
                        valuesList.Add(p.Protein_Alias);
                        valuesList.Add(p.UniProt_ID);
                        valuesList.Add(p.NCBI_RefSeq_NP_ID);
                        valuesList.Add(p.NCBI_Gene_Name);
                        valuesList.Add(p.PhosphoNET_Name);
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(DataUtilities.FilterDropdownList(valuesList, prefixText, true));
        }
Beispiel #2
0
        public static List <string> GetAutoCompleteData(string prefixText, int count)
        {
            const int     minPrefixLength = 3;
            List <string> valuesList      = new List <string>();

            if (prefixText.Length >= minPrefixLength)
            {
                try
                {
                    List <Drug_Information> drugs = EF_Data.GetDrugsQuery(prefixText);

                    foreach (Drug_Information drug in drugs)
                    {
                        valuesList.Add(drug.Other_Drug_Name_Alias);
                        valuesList.Add(drug.Drug_Common_Name);
                        valuesList.Add(drug.Drug_Chemical_Name);
                        valuesList.Add(drug.Compound_CAS_ID);
                        valuesList.Add(drug.PubChem_CID);
                        valuesList.Add(drug.ChEMBL_ID);
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(DataUtilities.FilterDropdownList(valuesList, prefixText));
        }
Beispiel #3
0
        public static List <string> GetAutoCompleteData(string prefixText, int count)
        {
            List <string> valuesList = new List <string>();

            const int minPrefixLength = 14;

            if (prefixText.Length >= minPrefixLength)
            {
                try
                {
                    List <SNV_Mutation> SNV_Mutation = EF_Data.GetMutationsBySNVIDKeyContains(prefixText);

                    foreach (SNV_Mutation mutation in SNV_Mutation)
                    {
                        valuesList.AddRange(new List <string> {
                            mutation.SNV_P1W_ID, mutation.SNV_P2W_ID, mutation.SNV_P3W_ID,
                            mutation.SNV_P1M1_ID, mutation.SNV_P1M2_ID, mutation.SNV_P1M3_ID,
                            mutation.SNV_P2M1_ID, mutation.SNV_P2M2_ID, mutation.SNV_P2M3_ID,
                            mutation.SNV_P3M1_ID, mutation.SNV_P3M2_ID, mutation.SNV_P3M3_ID,
                        }
                                            );
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(DataUtilities.FilterDropdownList(valuesList, prefixText, true));
        }
Beispiel #4
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 #5
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 <Drug_Information> drugList = new List <Drug_Information>();

            const int minPrefixLength = 3;

            if (search_textBox.Text.Length < minPrefixLength)
            {
                return;
            }

            Protein_Information protein = EF_Data.GetProteinsInfoQuery(search_textBox.Text).FirstOrDefault();

            if (protein != null)
            {
                List <PDB_Information> pdbInfoList = EF_Data.GetPDBInfoUsingProtein(protein.UniProt_ID);

                foreach (PDB_Information pdb in pdbInfoList)
                {
                    Drug_Information drug = EF_Data.GetDrugByDrugPDBID(pdb.Drug_PDB_ID);
                    if (drug != null)
                    {
                        drugList.Add(drug);
                    }
                }
            }

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

                foreach (Drug_Information drug in drugList)
                {
                    valuesList.Add(drug.Other_Drug_Name_Alias);
                    valuesList.Add(drug.Drug_Common_Name);
                    valuesList.Add(drug.Drug_Chemical_Name);
                    valuesList.Add(drug.Compound_CAS_ID);
                    valuesList.Add(drug.PubChem_CID);
                    valuesList.Add(drug.ChEMBL_ID);
                }

                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 #6
0
        protected void Search_Textbox_Changed(object sender, EventArgs e)
        {
            drug_specification_drop_down.Items.Clear();
            drug_specification_drop_down.Items.Add(DROP_DOWN_PROMPT_MESSAGE);

            amino_acid_specification_drop_down.Items.Clear();
            amino_acid_specification_drop_down.Items.Add(DROP_DOWN_PROMPT_MESSAGE);

            const int minPrefixLength = 3;

            if (search_textBox.Text.Length < minPrefixLength)
            {
                return;
            }

            Protein_Information protein = EF_Data.GetProteinsInfoQuery(search_textBox.Text).FirstOrDefault();

            if (protein != null)
            {
                List <PDB_Information>  pdbList  = EF_Data.GetPDBInfoUsingProtein(protein.UniProt_ID);
                List <Drug_Information> drugList = new List <Drug_Information>();

                foreach (PDB_Information pdb in pdbList)
                {
                    Drug_Information drug = EF_Data.GetDrugByDrugPDBID(pdb.Drug_PDB_ID);
                    if (drug != null)
                    {
                        drugList.Add(drug);
                    }
                }

                if (drugList.Count > 0)
                {
                    List <string> dropdownValues = new List <string>();
                    foreach (Drug_Information drug in drugList)
                    {
                        dropdownValues.Add(drug.Drug_Name_for_Pull_Down_Menu);
                    }

                    dropdownValues = DataUtilities.FilterDropdownList(dropdownValues);

                    foreach (string dropdownValue in dropdownValues)
                    {
                        drug_specification_drop_down.Items.Add(dropdownValue);
                    }
                }
                else
                {
                    drug_specification_drop_down.Items.Clear();
                    drug_specification_drop_down.Items.Add(DROP_DOWN_NO_MATCHES_MESSAGE);
                }
            }
        }
        /// <summary>
        /// Author: Andy Tang
        /// </summary>
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            string query = Request.QueryString["query_string"];

            Protein_Information protein = EF_Data.GetProteinsInfoQuery(query).FirstOrDefault();

            if (protein != null)
            {
                LoadData(protein);
            }
            else
            {
                Page.Master.FindControl("BodyContentPlaceHolder").Visible = false;
                ExceptionUtilities.DisplayAlert(this, QUERY_PAGE);
            }
        }
Beispiel #8
0
        protected void LoadAminoAcidDropDown(object sender, EventArgs e)
        {
            amino_acid_specification_drop_down.Items.Clear();
            amino_acid_specification_drop_down.Items.Add(DROP_DOWN_PROMPT_MESSAGE);

            try
            {
                if (drug_specification_drop_down.SelectedItem.Value != DROP_DOWN_PROMPT_MESSAGE)
                {
                    Protein_Information protein = EF_Data.GetProtein(search_textBox.Text);
                    Drug_Information    drug    = EF_Data.GetDrugUsingDropDownName(drug_specification_drop_down.SelectedItem.Value);
                    PDB_Information     PDB     = EF_Data.GetPDBInfo(protein, drug);

                    List <SNV_Mutation> mutations = EF_Data.GetMutations(protein.UniProt_ID, drug.Drug_PDB_ID, PDB.PDB_File_ID);

                    if (mutations.Count > 0)
                    {
                        List <string> dropdownValues = new List <string>();

                        foreach (SNV_Mutation mutation in mutations)
                        {
                            dropdownValues.Add(mutation.SNV_Key);
                        }

                        dropdownValues = DataUtilities.FilterDropdownList(dropdownValues);

                        foreach (string dropdownValue in dropdownValues)
                        {
                            amino_acid_specification_drop_down.Items.Add(dropdownValue);
                        }
                    }
                    else
                    {
                        amino_acid_specification_drop_down.Items.Clear();
                        amino_acid_specification_drop_down.Items.Add(DROP_DOWN_NO_MATCHES_MESSAGE);
                    }
                }
            }
            catch (Exception)
            {
                amino_acid_specification_drop_down.Items.Clear();
                amino_acid_specification_drop_down.Items.Add(DROP_DOWN_PROMPT_MESSAGE);
            }
        }
Beispiel #9
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);
            }
        }
        /// <summary>
        /// Author: Andy Tang
        /// </summary>
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            string query = Request.QueryString["query_string"];

            try
            {
                drug = EF_Data.GetDrugUsingDropDownName(query);

                if (drug != null)
                {
                    LoadData(drug);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #11
0
        /// <summary>
        /// Author: Garth Nelson
        /// </summary>
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            try
            {
                string protein_specification = Request.QueryString["query_string"];
                string drug_specification    = Request.QueryString["drug_specification"];
                string SNV_Key = Request.QueryString["snv_id_key"];

                Session["SNV_Key"] = SNV_Key;

                Protein_Information protein = EF_Data.GetProtein(protein_specification);
                Drug_Information    drug    = EF_Data.GetDrugUsingDropDownName(drug_specification);
                PDB_Information     PDB     = EF_Data.GetPDBInfo(protein, drug);

                string[] SNV_KEYsplit = SNV_Key.Split('-');

                // Retrieve second and third elements
                string amino_acid_specification = SNV_KEYsplit[1] + "-" + SNV_KEYsplit[2];

                PDB_Interaction interaction = EF_Data.GetPDB_Interaction(protein.Uniprot_ID, drug.Drug_PDB_ID, amino_acid_specification);
                mutation = EF_Data.GetMutationBySNVKey(SNV_Key);

                Session["mutation"] = mutation;

                LoadProtein(protein, interaction, mutation);
                LoadDrug(drug, mutation);
                LoadPDB_Info(PDB);

                CreateSNVIdentificationTable(mutation);
            }
            catch (Exception)
            {
                Page.Master.FindControl("BodyContentPlaceHolder").Visible = false;
                ExceptionUtilities.DisplayAlert(this, QUERY_PAGE);
            }
        }
Beispiel #12
0
        public static List <string> GetAutoCompleteData(string prefixText, int count)
        {
            const int     minPrefixLength = 3;
            List <string> valuesList      = new List <string>();

            if (prefixText.Length >= minPrefixLength)
            {
                try
                {
                    List <Drug_Information> drugs = EF_Data.GetDrugsInfoQuery(prefixText);

                    foreach (Drug_Information drug in drugs)
                    {
                        valuesList.Add(drug.Drug_Name_for_Pull_Down_Menu);
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(DataUtilities.FilterDropdownList(valuesList));
        }
Beispiel #13
0
        /// <summary>
        /// Author: Andy Tang, Ryan Liang
        /// </summary>
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!IsPostBack)
            {
                string fromPage     = null;
                string query_string = null;

                try
                {
                    query_string = Request.QueryString["query_string"];

                    drug_specification    = Request.QueryString["drug_specification"];
                    protein_specification = Request.QueryString["protein_specification"];

                    if (!string.IsNullOrEmpty(drug_specification))
                    {
                        protein_specification = query_string;
                        fromPage = "protein";
                    }
                    else if (!string.IsNullOrEmpty(protein_specification))
                    {
                        drug_specification = query_string;
                        fromPage           = "drug";
                    }

                    drug    = EF_Data.GetDrugsQuery(drug_specification).FirstOrDefault();
                    protein = EF_Data.GetProteinsInfoQuery(protein_specification).FirstOrDefault();
                    PDB     = EF_Data.GetPDBInfo(protein, drug);
                    Session["PDB_File_ID"] = PDB.PDB_File_ID;

                    interaction_distance    = double.Parse(Request.QueryString["interaction_distance"]);
                    protein_chain           = bool.Parse(Request.QueryString["protein_chain"]);
                    protein_atoms           = bool.Parse(Request.QueryString["protein_atoms"]);
                    protein_residues        = bool.Parse(Request.QueryString["protein_residues"]);
                    protein_residue_numbers = bool.Parse(Request.QueryString["protein_residue_numbers"]);
                    drug_atoms = bool.Parse(Request.QueryString["drug_atoms"]);

                    Session["interaction_distance"] = interaction_distance;
                }
                catch (Exception)
                {
                    throw;
                }

                if (drug == null || protein == null || PDB == null)
                {
                    Page.Master.FindControl("BodyContentPlaceHolder").Visible = false;

                    if (fromPage != null)
                    {
                        ExceptionUtilities.DisplayAlert(this, fromPage.Equals("drug") ? DRUG_QUERY_PAGE : PROTEIN_QUERY_PAGE);
                    }
                    else
                    {
                        ExceptionUtilities.DisplayAlert(this, DEFAULT_REDIRECT_PAGE);
                    }
                }
                else
                {
                    Session["interaction_distance"]    = interaction_distance;
                    Session["protein_chain"]           = protein_chain;
                    Session["protein_atoms"]           = protein_atoms;
                    Session["protein_residues"]        = protein_residues;
                    Session["protein_residue_numbers"] = protein_residue_numbers;
                    Session["drug_atoms"] = drug_atoms;

                    LoadProtein(protein);
                    LoadDrug(drug, PDB);
                    LoadPDB_Info(PDB);

                    GetDrugAtomNumberingImage(drug);

                    CreateInteractionList(PDB, interaction_distance, protein_chain, protein_atoms, protein_residues, protein_residue_numbers, drug_atoms);

                    CreateInteractionSummary();

                    ScriptManager.RegisterStartupScript(Page, GetType(), "D_3DViewer", "javascript:loadDrugLigand('" + drug.Drug_PDB_ID + "');", true);
                    ScriptManager.RegisterStartupScript(Page, GetType(), "PDB_3DViewer", "javascript:loadStage('" + drug.PDB_File_ID + "', '" + drug.Drug_PDB_ID + "');", true);
                }
            }
        }
Beispiel #14
0
        /// <summary>
        /// Author: Ryan Liang
        /// </summary>
        private void CreateInteractionList(PDB_Information PDB, double interaction_distance, bool protein_chain, bool protein_atoms, bool protein_residues, bool protein_residue_numbers, bool drug_atoms)
        {
            TableHeaderRow tableHeaderRow = new TableHeaderRow {
                TableSection = TableRowSection.TableHeader
            };

            tableHeaderRow.Cells.Add(new TableHeaderCell {
                Text = "Distance (Å)"
            });

            if (protein_chain)
            {
                tableHeaderRow.Cells.Add(new TableHeaderCell {
                    Text = "Protein Chain"
                });
            }

            if (protein_residue_numbers)
            {
                tableHeaderRow.Cells.Add(new TableHeaderCell {
                    Text = "Protein Residue Number"
                });
            }

            if (protein_residues)
            {
                tableHeaderRow.Cells.Add(new TableHeaderCell {
                    Text = "Amino Acid Residue Type"
                });
            }

            if (protein_atoms)
            {
                tableHeaderRow.Cells.Add(new TableHeaderCell {
                    Text = "Amino Acid Residue Atom"
                });
            }

            if (drug_atoms)
            {
                tableHeaderRow.Cells.Add(new TableHeaderCell {
                    Text = "Drug Atom"
                });
            }

            interaction_list.Rows.Add(tableHeaderRow);

            var DistanceAndUniprotResidueNumbers = EF_Data.GetDistanceAndUniprotResidueNumbers(PDB.PDB_File_ID, interaction_distance);

            Session["DistanceAndUniprotResidueNumbers"] = DistanceAndUniprotResidueNumbers;

            foreach (KeyValuePair <PDB_Distance, string> kvp in DistanceAndUniprotResidueNumbers)
            {
                TableRow tableRow = new TableRow();

                tableRow.Cells.Add(new TableCell {
                    Text = kvp.Key.Distance.ToString("0.00")
                });

                if (protein_chain)
                {
                    tableRow.Cells.Add(new TableCell {
                        Text = kvp.Key.Protein_Chain
                    });
                }

                if (protein_residue_numbers)
                {
                    tableRow.Cells.Add(new TableCell {
                        Text = kvp.Value
                    });
                }

                if (protein_residues)
                {
                    tableRow.Cells.Add(new TableCell {
                        Text = kvp.Key.Protein_Residue
                    });
                }

                if (protein_atoms)
                {
                    tableRow.Cells.Add(new TableCell {
                        Text = kvp.Key.Protein_Atom
                    });
                }

                if (drug_atoms)
                {
                    tableRow.Cells.Add(new TableCell {
                        Text = kvp.Key.Compound_Atom
                    });
                }

                interaction_list.Rows.Add(tableRow);
            }
        }