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); } }
/// <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); } }
/// <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); } } }