[Bio] / FigWebServices / targets.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/targets.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Tue Nov 28 21:52:10 2006 UTC revision 1.4, Wed Dec 6 23:50:46 2006 UTC
# Line 59  Line 59 
59      }      }
60  }  }
61    
62  # This funtion adds the paragraphs needed to explain what we are looking at  # This funtion sets up the variables used by the template to display organism-related text.
63  # and how to navigate it  # and how to navigate it
64  sub add_words{  sub add_words{
65      my ($cgi, $varHash, $org) = @_;      my ($cgi, $varHash, $org) = @_;
66        $varHash->{orgName} = "";
67      if($org){      if($org){
68          my $name= $fig->genus_species($org);          $varHash->{orgName} = $fig->genus_species($org);
         $varHash->{result} .= "<h1>$name targets</h1>";  
         if($target){  
             $varHash->{result} .= "<p>Cross section of<em> $name </em> and $uctarget Targets.</p>  
 <p>Candidacy column connects to literature source.</p>";  
         }else{  
             $varHash->{result} .= "<p>To narrow the table scope to a specific target category  
 click on a category within the larger table under the category column.</p>";  
         }  
         return;  
     }elsif($target){  
         $varHash->{result} .= "<h1> $uctarget Targets</h1>  
 <p>The proteins in these sets come from diverse sources  
  and the criteria for inclusion is intentionally broad.  
  Further curation, filtering and additions to these sets are planned.  
 Feedback to the NMPDR on these proteins is welcome.</p>  
 <p>To narrow the table scope to a specific organism  
 click on an organism in the larger table under the organism column</p>  
 <p>Candidacy column connects to literature source.</p>";  
         return;  
69      }      }
70  }  }
71    
72  # This Sub funtions to open up the table and keep track of the index of what row we are on  # This Sub funtions to open up the table and keep track of the index of what row we are on
73  sub get_table{  sub get_table{
74      my($cgi, $varHash, $file)= @_;      my($cgi, $varHash, $file)= @_;
75      Open(\*TABLE, "$FIG_Config::drug_directory/$file");      Open(\*TABLE, "<$FIG_Config::drug_directory/$file");
76      while (<TABLE>){      while (! eof TABLE){
77          my @lines = split (/\r/,$_);          my @entry = Tracer::GetLine(\*TABLE);
78          for my $i (0..scalar@lines-1) {          &get_best_pdb($cgi, $varHash, @entry);
             my @entry = split (/\t/,$lines[$i]);  
 #           &print_row($entry[5], $entry[9], $entry[3], $entry[1], $i);  
             &get_best_pdb($cgi, $varHash, $i,$file);  
         }  
79      }      }
80  }  }
81    
82    
83  # This Sub funtions to print the Table Row in the correct format.  # This Sub funtions to print the Table Row in the correct format.
84  sub print_column{  sub print_column{
85      my($cgi, $varHash, $pdb, $color, $score,$peg, $func, $lit, $cat, $i) = @_ ;      my($cgi, $varHash, $pdb, $color, $score,$peg, $func, $lit, $cat) = @_ ;
86      my $genome = $peg;      my $genome = $peg;
87      $genome =~ s/fig\|//;      $genome =~ s/fig\|//;
88      $genome =~ s/\.peg\.\d+//;      $genome =~ s/\.peg\.\d+//;
89      my $which  = $fig->genus_species($genome);      my $which  = $fig->genus_species($genome);
90      $pdb =~ s/pdb//;      $pdb =~ s/pdb//;
91      $pdb =~ s/\.ent//;      $pdb =~ s/\.ent//;
92      my $cat = changecat($cat);      $cat = changecat($cat);
93      my $selfURL = $cgi->url(-relative => 1);      my $selfURL = $cgi->url(-relative => 1);
94      my $link = '../FIG/protein.cgi?new_framework=0&SPROUT=1&prot=';      my $link = '../FIG/protein.cgi?new_framework=0&SPROUT=1&prot=';
95      my $org = $cgi->param('org');      my $org = $cgi->param('org');
# Line 173  Line 151 
151    
152  #-- we wish to desplay only the best pdbs and those that are relavent  #-- we wish to desplay only the best pdbs and those that are relavent
153  sub get_best_pdb{  sub get_best_pdb{
154      my ($cgi, $varHash, $i, $file)= @_;      my ($cgi, $varHash, @entry)= @_;
155      my @pdbresults =("1ah7","1dhn","1tfu"); # we define what pdb actually have been docked well.      my @pdbresults =("1ah7","1dhn","1tfu"); # we define what pdb actually have been docked well.
     Open(\*TABLE, "$FIG_Config::drug_directory/$file");  
     while (<TABLE>){  
         my @lines = split (/\r/,$_);  
         my @entry = split(/\t/,$lines[$i]);  
156          if (T(4)) {          if (T(4)) {
157              my $line = "Processing line\n";              my $line = "Processing line\n";
158              for (my $i = 0; $i <= $#entry; $i++) {              for (my $i = 0; $i <= $#entry; $i++) {
# Line 189  Line 163 
163          Trace("Analyzing PDB $entry[11].") if T(4);          Trace("Analyzing PDB $entry[11].") if T(4);
164          foreach (@pdbresults){ #look through the results we have          foreach (@pdbresults){ #look through the results we have
165              if ($entry[11] =~ m/$_/gi){ #ifwe have results for the free              if ($entry[11] =~ m/$_/gi){ #ifwe have results for the free
166                  &print_column($cgi, $varHash, $entry[11],'red', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this              &print_column($cgi, $varHash, $entry[11],'red', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
167                  return;                  return;
168              }elsif($entry[14] =~ m/$_/gi){ #if we have resutls for the bound              }elsif($entry[14] =~ m/$_/gi){ #if we have resutls for the bound
169                  &print_column($cgi, $varHash,$entry[14], 'red', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we wnat to display this              &print_column($cgi, $varHash,$entry[14], 'red', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1]); #we wnat to display this
170                  return;                  return;
171              }              }
172          }          }
173          if ($entry[13] eq "0"){ #if the free pdb is perfect          if ($entry[13] eq "0"){ #if the free pdb is perfect
174              &print_column($cgi, $varHash, $entry[11], '', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this          &print_column($cgi, $varHash, $entry[11], '', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
175              return;              return;
176          }elsif($entry[16] eq '0'){ #if the bound  pdb is perfect          }elsif($entry[16] eq '0'){ #if the bound  pdb is perfect
177              &print_column($cgi, $varHash, $entry[14], '', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this          &print_column($cgi, $varHash, $entry[14], '', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
178              return;              return;
179          }elsif($entry[13] =~ /\d\.\d*E\-(\d+)/ ){ #if the eval is like 1.4E-45          }elsif($entry[13] =~ /\d\.\d*E\-(\d+)/ ){ #if the eval is like 1.4E-45
180              if (15 < $1) { #and the exponant is less than 1.0E-15              if (15 < $1) { #and the exponant is less than 1.0E-15
# Line 211  Line 185 
185                          my $efree = $free[0] * 13 ** -$free[1];                          my $efree = $free[0] * 13 ** -$free[1];
186                          my $ebound = $bound[0] * 13 ** -$bound[1];                          my $ebound = $bound[0] * 13 ** -$bound[1];
187                          if ($efree <= $ebound){ #if the free is less than the boutd                          if ($efree <= $ebound){ #if the free is less than the boutd
188                              &print_column($cgi, $varHash, $entry[11], 'black', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this                          &print_column($cgi, $varHash, $entry[11], 'black', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
189                              return;                              return;
190                          }else{                          }else{
191                              &print_column($cgi, $varHash, $entry[14], 'green', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this                          &print_column($cgi, $varHash, $entry[14], 'green', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
192                              return;                              return;
193                          }                          }
194                      }else{ #the bound exponent wasn't less than 15                      }else{ #the bound exponent wasn't less than 15
195                          &print_column($cgi, $varHash, $entry[11], 'blue', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this                      &print_column($cgi, $varHash, $entry[11], 'blue', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
196                          return;                          return;
197                      }                      }
198                  }else{ #the bound pdb didn't even have an exponant                  }else{ #the bound pdb didn't even have an exponant
199                      &print_column($cgi, $varHash, $entry[11], 'yello', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1], $i); #we want to display this                  &print_column($cgi, $varHash, $entry[11], 'yello', $entry[13],$entry[5], $entry[9], $entry[3], $entry[1]); #we want to display this
200                      return; #this takes care the if free is good and bound is bad                      return; #this takes care the if free is good and bound is bad
201                  }#a free pdb is no good becaus eval > 1e-15                  }#a free pdb is no good becaus eval > 1e-15
202              }#free pdb was no good because eval > 1e-15              }#free pdb was no good because eval > 1e-15
203          }elsif($entry[16] =~ /\d\.\d*E\-(\d+)/ ){ #we are now checking if the bound pdb is good          }elsif($entry[16] =~ /\d\.\d*E\-(\d+)/ ){ #we are now checking if the bound pdb is good
204              if (15 < $1) {              if (15 < $1) {
205                  &print_column($cgi, $varHash, $entry[14], 'black', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1], $i);              &print_column($cgi, $varHash, $entry[14], 'black', $entry[16],$entry[5], $entry[9], $entry[3], $entry[1]);
206                  return;                  return;
207              }              }
208        } else {
209            Trace("Peg $entry[5] not printed.") if T(4);
210          }          }
211      }      }
     Trace("No result printed for line $i in file $file.") if T(4);  
 }  
212    
213    
214  # -error interupt--these subs will probably go when bruce sees them  # -error interupt--these subs will probably go when bruce sees them

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3