[Bio] / DrugTargets / drug_targets_table.pl Repository:
ViewVC logotype

Diff of /DrugTargets/drug_targets_table.pl

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

revision 1.1, Wed Aug 10 21:24:19 2005 UTC revision 1.2, Wed Aug 10 22:26:14 2005 UTC
# Line 6  Line 6 
6  my $cgi = new CGI;  my $cgi = new CGI;
7  my $temp_dir = $FIG_Config::temp;  my $temp_dir = $FIG_Config::temp;
8  my $fin      = "$temp_dir/tmp$$.in";  my $fin      = "$temp_dir/tmp$$.in";
9    my $fcsv_name= "download$$.csv";
10    my $fcsv     = "/home/fangfang/public_html/FIG_tmp/$fcsv_name";
11  $| = 1;  $| = 1;
12    
13  my $webpage    = 1;  my $webpage    = 1;
# Line 15  Line 17 
17  print $cgi->header();  print $cgi->header();
18    
19  if ($webpage || !$no_header) {  if ($webpage || !$no_header) {
20      my @header = ('Category', 'Gene Name', 'Gene Id', 'PEG ID', 'PEG SeqLen', 'GenBank ID', 'UniProt ID', 'Functional Role', 'Conservation of Seqs', 'PDB (bound)', 'e-Value (bound)', 'PDB (free)', 'e-Value', 'PDB Title', 'PDB SeqLen', 'ProtDist', 'PASS ASPs', 'PASS Weight of Largest Pocket', 'PDB Ligand CLiBE');      @header = ('Category', 'Gene Name', 'Gene Id', 'PEG ID', 'PEG SeqLen', 'GenBank ID', 'UniProt ID', 'Functional Role', 'Conservation of Seqs', 'PDB (bound)', 'e-Value (bound)', 'PDB (free)', 'e-Value', 'PDB Title', 'PDB SeqLen', 'ProtDist', 'PASS ASPs', 'PASS Weight of Largest Pocket', 'PDB Ligand CLiBE');
21      if ($webpage) {      if ($webpage) {
22          if ($table_only) {          if ($table_only) {
23              print gen_html("start_table");              print gen_html("start_table");
# Line 39  Line 41 
41    
42  {  {
43      open(FIN, $fin) || (print(STDERR "'$fin': Couldn't open file. Skipped...\n\n"), next);      open(FIN, $fin) || (print(STDERR "'$fin': Couldn't open file. Skipped...\n\n"), next);
44        open(FCSV, ">$fcsv");
45        print FCSV join(",", @header) . "\n";
46    
47      while (<FIN>) {      while (<FIN>) {
48          chomp;          chomp;
# Line 119  Line 123 
123              my $clibe_u = get_clibe_u($pdb) if ($pdb);              my $clibe_u = get_clibe_u($pdb) if ($pdb);
124              my $clibe   = ($clibe_u =~ /<.*>(.*)<.*>/, $1);              my $clibe   = ($clibe_u =~ /<.*>(.*)<.*>/, $1);
125    
             if ($no_link) {  
126                  @row = ($cat, $gene, $geneId, $peg, $peg_len, $gid, $uniId, $role, $cons, $pdb_bound, $escore_bound, $pdb, $escore, $pdb_title, $pdb_len, $dist, $pass, $pass_maxwgt, $clibe);                  @row = ($cat, $gene, $geneId, $peg, $peg_len, $gid, $uniId, $role, $cons, $pdb_bound, $escore_bound, $pdb, $escore, $pdb_title, $pdb_len, $dist, $pass, $pass_maxwgt, $clibe);
127              } else {  
128                  @row = ($cat, $gene_u, $geneId, $peg_u, $peg_len, $gid_u, $uniId_u, $role, $cons, $pdb_bound_u, $escore_bound, $pdb_u, $escore, $pdb_title, $pdb_len, $dist_u, $pass_u, $pass_maxwgt, $clibe_u);              @row_u = ($cat, $gene_u, $geneId, $peg_u, $peg_len, $gid_u, $uniId_u, $role, $cons, $pdb_bound_u, $escore_bound, $pdb_u, $escore, $pdb_title, $pdb_len, $dist_u, $pass_u, $pass_maxwgt, $clibe_u);
129              }  
130                if (FCSV) {print FCSV join(",", @row) . "\n";}
131    
132              if ($webpage) {              if ($webpage) {
133                  print gen_html("row", @row);                  print gen_html("row", @row_u);
134              } else {              } else {
135                  print join("\t", @row) . "\n";                  print join("\t", @row_u) . "\n";
136              }              }
137          }          }
138      }      }
139        close(FCSV);
140      close(FIN);      close(FIN);
141  }  }
142    
143    
144    
145  if ($webpage) {  if ($webpage) {
146      print gen_html("end_table");      print gen_html("end_table");
147        print "<p> <a href=http://ci-www.uchicago.edu/~fangfang/FIG_tmp/$fcsv_name> Download to Excel </a>\n";
148      print gen_html("end_html") unless $table_only;      print gen_html("end_html") unless $table_only;
149  }  }
150    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3