/Prohits/analyst/band_list.inc.php
PHP | 338 lines | 308 code | 9 blank | 21 comment | 72 complexity | 28d38fc2195e252f6683afa22aaef185 MD5 | raw file
- <?
- /***********************************************************************
- Copyright 2010 Gingras and Tyers labs,
- Samuel Lunenfeld Research Institute, Mount Sinai Hospital.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- *************************************************************************/
- $RawFileColor = "#2080df";
- $HasHitsColor = "#5b52ad";
- $EmptyColor = "#d9e8f0";
- ?>
-
- <script langue='javascript'>
- <?
- if($theaction == "addnewband"){ ?>
- function insert_band(){
- var theForm = document.action_form;
- <?if($Lane_ID){?>
- if(isEmptyStr(theForm.frm_Location.value) || !radio_checked(theForm.frm_Intensity) || isEmptyStr(theForm.frm_BandMW.value)){
- alert("The new band has to have band code, intensity and observed MW!");
- return false;
- }
- if(!isNumber(theForm.frm_BandMW.value)){
- alert("Observed MW has to be a number!");
- return false;
- }
- <?}else{?>
- if(isEmptyStr(theForm.frm_Location.value) ){
- alert("Sample code should not be empty!");
- return false;
- }
- <?}?>
- theForm.theaction.value = "insertnewband";
- theForm.submit();
- }
- <?}
- if($theaction == "modifyband"){ ?>
- function modify_band(Band_ID){
- var theForm = document.action_form;
- <?if($Lane_ID){?>
- if(isEmptyStr(theForm.frm_Location.value) || !radio_checked(theForm.frm_Intensity) || isEmptyStr(theForm.frm_BandMW.value)){
- alert("The new band has to have band code, intensity and observed MW!");
- return false;
- }
- if(!isNumber(theForm.frm_BandMW.value)){
- alert("Observed MW has to be a number!");
- return false;
- }
- <?}else{?>
- if(isEmptyStr(theForm.frm_Location.value) ){
- alert("Sample code should not be empty!");
- return false;
- }
- <?}?>
- theForm.theaction.value = "updateband";
- theForm.Band_ID.value = Band_ID;
- theForm.submit();
- }
- <?}?>
- </script><br>
- <table border="0" cellpadding="0" cellspacing="1" width="100%">
- <tr bgcolor="">
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" height="20" align=center><div class=tableheader> # </div>
- </td>
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" align=center height="20"><div class=tableheader>Band(Sample)<br>ID</div>
- </td>
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" align=center height="20"><div class=tableheader>Band(Sample)<br>Code</div>
- </td>
- <?if($Gel_ID){?>
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" align=center height="20"><div class=tableheader>Intensity</div>
- </td>
- <?}?>
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" align=center height="20"><div class=tableheader>Observed MW</div>
- </td>
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" align=center height="20"><div class=tableheader>Modification</div>
- </td>
- <td width="" bgcolor="<?=$TB_HD_COLOR;?>" align="center" height="20"><div class=tableheader>Options</div></font>
-
- </td>
- </tr>
- <?
- echo "<input type=hidden name=band_counter value=$band_counter>";
- // start of old band list ==============================================
- $location_value = "";
- $intensity_value = "";
- $bandMW_value = "";
- $bandMod_value = "";
- for($i=0; $i < $Bands->count; $i++) {
- $location_value = $Bands->Location[$i];
- $intensity_value = $Bands->Intensity[$i];
- $bandMW_value = $Bands->BandMW[$i];
- $bandMod_value = $Bands->Modification[$i];
- $Description_value = $Bands->ResultsFile[$i];
- $statusArr = get_Progress_status($Bands->ID[$i], "Band");
- array_push($sample_id_arr, $Bands->ID[$i]);
- $modify_intensity = false;
- //modify this band
- if($AUTH->Modify and $theaction == "modifyband" and $Bands->ID[$i] == $Band_ID){
- $modify_intensity = true;
- ?>
- <tr bgcolor="<?=$TB_CELL_COLOR;?>">
- <td align=center><div class=maintext><?=$i+1;?></div></td>
- <td><div class=maintext> <?=$Bands->ID[$i];?></div></td>
- <td width="" align="left">
- <table align="left" bgcolor="" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td align=right>
- <input type="text" size="10" maxlength="29" name='frm_Location' value="<?=$location_value;?>">
- </td>
- <?Description_div_for_sample($Description_value,$Band_ID);?>
- </tr>
- </table>
- </td>
- <?if($Gel_ID){
- echo "<td width='' align='center'>";
- include("./band_color.inc.php");
- echo "</td>";
- }?>
- <td width="" align="center">
- <input type="text" size="5" maxlength="20" name='frm_BandMW' value="<?=$bandMW_value;?>">
- <font color="black" face="helvetica,arial,futura" size="1"> kDa</font>
- </td>
- <td width="" align="center">
- <select name='frm_Modification'>
- <? dis_species_options($bandMod_value); ?>
- </select>
- </td>
- <td width="" align="center">
- <input type="button" value="Update" onclick="javascript: modify_band(<?=$Band_ID;?>);" class="black_but">
- </td>
- </tr>
- <?
- }else{
- //not modify the band
- ?>
- <tr bgcolor="<?=$TB_CELL_COLOR;?>">
- <td align=center><div class=maintext><?=$i+1;?></div> </td>
- <td><div class=maintext> <?=$Bands->ID[$i];?></div></td>
- <td width="" align="center">
- <table align="left" bgcolor="" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td align=right>
- <div class=maintext> <?=$location_value;?> </div>
- </td>
- <?Description_div_for_sample($Description_value,$Bands->ID[$i],'' ,'readonly');?>
- </tr>
- </table>
- </td>
- <?
- if($Gel_ID){
- echo "<td width='' align='center'>";
- include("./band_color.inc.php");
- echo "</td>";
- }?>
- <td width="" align="center">
- <div class=maintext>
- <?=$bandMW_value;?> kDa
- </div>
- </td>
- <td width="" align="center">
- <div class=maintext>
- <?=$bandMod_value;?>
- </div>
- </td>
- <td width="" align="center">
- <table><tr><td>
- <?
- //$statueArr = get_status($Bands->ID[$i],$HITSDB,$Bait->GelFree,'Band');
- $statueArr = get_status($Bands->ID[$i],'Band');
- ?>
- </td><td>
- <?
- if(!$statueArr['num_files'] && !$statueArr['num_hits'] && !$statueArr['num_hitsTppProt'] && $AUTH->Delete && $Bands->OwnerID[$i] == $AccessUserID && $SCRIPT_NAME != 'submit.php'){?>
- <a href="javascript:confirm_delete_band(<?=$Bands->ID[$i];?>);">
- <img border="0" src="images/icon_purge.gif" alt="Delete Band"></a>
- <?}else{
- echo "\n<img src=\"images/icon_empty.gif\"> ";
- }
- if($AUTH->Modify){
- if($SCRIPT_NAME == 'submit.php'){
- $band_list_inc_submit_url = $SCRIPT_NAME."?ProjectID=$ProjectID&gelMode=$gelMode&addNewType=$addNewType&DBname=$DBname&";
- }else{
- $band_list_inc_submit_url = $SCRIPT_NAME.'?';
- }
- ?>
- <a href="./<?=$band_list_inc_submit_url?>theaction=modifyband&Band_ID=<?=$Bands->ID[$i];?>&Plate_ID=<?=$Plate_ID;?><?echo ($sub)?"&sub=$sub":"";?>">
- <img border="0" src="images/icon_view.gif" alt="Modify Band"></a>
- <?}else{
- echo "\n<img src=\"images/icon_empty.gif\"> ";
- }?>
- </td>
- </tr></table>
- </td>
- </tr>
- <?
- } //end if modify
- } //end for loop
- //end band old band list=====================================================
- $location_value = "";
- $intensity_value = "";
- $bandMW_value = "";
- $bandMod_value = "";
- $modify_intensity = true;
- if($band_counter){
- for($i=0; $i < $band_counter; $i++){
- $new_sample_id = "new_$i";
- array_push($sample_id_arr, $new_sample_id);
- ?>
- <tr bgcolor="<?echo $TB_CELL_COLOR;?>">
- <td align=center><div class=maintext><?=$Bands->count+ $i + 1;?></div></td>
- <td> </td>
- <td width="" align="left">
- <table align="left" bgcolor="" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td align=right>
- <input type="text" size="10" maxlength="29" name='<?=$location_name[$i];?>' value=<?=($$location_name[$i])?$$location_name[$i]:$selectedWellCode_arr[$i];?>>
- </td>
- <?Description_div_for_sample('',$new_sample_id,$bandDescription_name[$i]);?>
- </tr>
- </table>
- </td>
- <?if($Gel_ID){
- echo "<td width='' align='center'>";
- include("./band_color.inc.php");
- echo "</td>";
- }?>
- <td align="center" nowrap>
- <font color="black" face="arial,futura" size="1">
- <input type="text" size="7" maxlength="20" name='<?=$bandMW_name[$i];?>' value='<?=$$bandMW_name[$i];?>'> kDa
- </font>
- </td>
- <td align="center" colspan=2>
- <select name='<?=$bandModification_name[$i];?>'>
- <?dis_species_options($$bandModification_name[$i]);?>
- </select>
- </td>
- </tr>
- <?
- }
- ?>
- <tr bgcolor=<?=$TB_CELL_COLOR;?> align='center'>
- <td colspan=7>
- <input type='button' value='Save' onclick='javascript: checkform(this.form);' class='green_but'>
- </td>
- </tr>
- <?
- } //end new band list=========================================================
- ?>
- </table>
- <script language="javascript">
- var Sample_id_arr = new Array();
- <?foreach($sample_id_arr as $sample_id_value){?>
- Sample_id_arr.push("<?=$sample_id_value?>");
- <?}?>
- document.onclick=check;
- var div_id = '';
- var tmp_flag = 0;
- function check(e){
- if(tmp_flag == 1){
- tmp_flag = 0;
- return;
- }
- for(var i=0; i<Sample_id_arr.length; i++){
- var div_id_tmp = "des_" + Sample_id_arr[i];
- var obj_tmp = document.getElementById(div_id_tmp);
- if(obj_tmp.style.display == 'block'){
- div_id = div_id_tmp;
- break;
- }
- }
- var target = (e && e.target) || (event && event.srcElement);
- var obj = document.getElementById(div_id);
- checkParent(target)?obj.style.display='none':null;
- }
- function checkParent(t){
- while(t.parentNode){
- if(t==document.getElementById(div_id)){
- return false
- }
- t=t.parentNode
- }
- return true
- }
- </script>
- <?
- function dis_species_options($bandMod_value){ ?>
- <option value="None">None
- <option value="Acetyl (N-term)"<?echo ($bandMod_value == 'Acetyl (N-term)')?" selected":'';?>>Acetyl (N-term)
- <option value="Acetyl (K)"<?echo ($bandMod_value == 'Acetyl (K)')?" selected":'';?>>Acetyl (K)
- <option value="Amide (C-term G)"<?echo ($bandMod_value == 'Amide (C-term G)')?" selected":'';?>>Amide (C-term G)
- <option value="Biotinylated (N-term)"<?echo ($bandMod_value == 'Biotinylated (N-term)')?" selected":'';?>>Biotinylated (N-term)
- <option value="Biotinylated (K)"<?echo ($bandMod_value == 'Biotinylated (K)')?" selected":'';?>>Biotinylated (K)
- <option value="Carbamyl (N-term)"<?echo ($bandMod_value == 'Carbamyl (N-term)')?" selected":'';?>>Carbamyl (N-term)
- <option value="Carboxymethyl (C)"<?echo ($bandMod_value == 'Carboxymethyl (C)')?" selected":'';?>>Carboxymethyl (C)
- <option value="Deamidation (NQ)"<?echo ($bandMod_value == 'Deamidation (NQ)')?" selected":'';?>>Deamidation (NQ)
- <option value="Glycosylation (N-linked)"<?echo ($bandMod_value == 'Glycosylation (N-linked)')?" selected":'';?>>Glycosylation (N-linked)
- <option value="Glycosylation (O-linked)"<?echo ($bandMod_value == 'Glycosylation (O-linked)')?" selected":'';?>>Glycosylation (O-linked)
- <option value="ICAT_light"<?echo ($bandMod_value == 'ICAT_light')?" selected":'';?>>ICAT_light
- <option value="ICAT_heavy"<?echo ($bandMod_value == 'ICAT_heavy')?" selected":'';?>>ICAT_heavy
- <option value="Methyl ester (C-term)"<?echo ($bandMod_value == 'Methyl ester (C-term)')?" selected":'';?>>Methyl ester (C-term)
- <option value="Methyl ester (DE)"<?echo ($bandMod_value == 'Methyl ester (DE)')?" selected":'';?>>Methyl ester (DE)
- <option value="NIPCAM (C)"<?echo ($bandMod_value == 'NIPCAM (C)')?" selected":'';?>>NIPCAM (C)
- <option value="N-Acetyl (Protein)"<?echo ($bandMod_value == 'N-Acetyl (Protein)')?" selected":'';?>>N-Acetyl (Protein)
- <option value="N-Formyl (Protein)"<?echo ($bandMod_value == 'N-Formyl (Protein)')?" selected":'';?>>N-Formyl (Protein)
- <option value="Oxidation (M)"<?echo ($bandMod_value == 'Oxidation (M)')?" selected":'';?>>Oxidation (M)
- <option value="Oxidation (HW)"<?echo ($bandMod_value == 'Oxidation (HW)')?" selected":'';?>>Oxidation (HW)
- <option value="O18 (C-term)"<?echo ($bandMod_value == 'O18 (C-term)')?" selected":'';?>>O18 (C-term)
- <option value="Phospho (Y)"<?echo ($bandMod_value == 'Phospho (Y)')?" selected":'';?>>Phospho (Y)
- <option value="Phospho (ST)"<?echo ($bandMod_value == 'Phospho (ST)')?" selected":'';?>>Phospho (ST)
- <option value="Propionamide (C)"<?echo ($bandMod_value == 'Propionamide (C)')?" selected":'';?>>Propionamide (C)
- <option value="Pyro-glu (N-term Q)"<?echo ($bandMod_value == 'Pyro-glu (N-term Q)')?" selected":'';?>>Pyro-glu (N-term Q)
- <option value="Pyro-glu (N-term E)"<?echo ($bandMod_value == 'Pyro-glu (N-term E)')?" selected":'';?>>Pyro-glu (N-term E)
- <option value="S-pyridylethyl (C)"<?echo ($bandMod_value == 'S-pyridylethyl (C)')?" selected":'';?>>S-pyridylethyl (C)
- <option value="SMA (K)"<?echo ($bandMod_value == 'SMA (K)')?" selected":'';?>>SMA (K)
- <option value="SMA (N-term)"<?echo ($bandMod_value == 'SMA (N-term)')?" selected":'';?>>SMA (N-term)
- <option value="Sodiated (DE)"<?echo ($bandMod_value == 'Sodiated (DE)')?" selected":'';?>>Sodiated (DE)
- <option value="Sodiated (C-term)"<?echo ($bandMod_value == 'Sodiated (C-term)')?" selected":'';?>>Sodiated (C-term)
- <option value="Sulphone (M)"<?echo ($bandMod_value == 'Sulphone (M)')?" selected":'';?>>Sulphone (M)
- <?
- }
- ?>