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

Diff of /FigWebServices/protein_info.cgi

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

revision 1.1, Thu Jul 14 22:36:03 2005 UTC revision 1.2, Fri Jul 15 03:23:54 2005 UTC
# Line 64  Line 64 
64   my ($fig,$cgi,$html)=@_;   my ($fig,$cgi,$html)=@_;
65   # generate a blank page   # generate a blank page
66   push @$html,   push @$html,
  "<h2>Protein Info</h2>\n",  
  "<p>Please enter some protein ID's. We will try and map them</p>",  
67   $cgi->start_form(),   $cgi->start_form(),
68   $cgi->textarea(-name=>"proteins", -rows=>20, -columns=>100), "<br>",   "<h2>Generate information and links about a series of proteins</h2>\n",
69     "<p>Please paste some gene or protein IDs into this box. We will then try and map the IDs that you find onto FIG IDs. If we are able to map them you will see a table of results. If we are unable to map some we'll let you know which ones.</p>\n",
70     "<p>Typical IDs are in the following format:</p>\n",
71     "<ol>\n<li><b>FIG</b>: &nbsp; fig|83333.1.peg.1697</li>\n<li><b>Genbank</b><ul><li>Refseq: &nbsp; begin with NP_ or NC_</li>\n",
72     "<li>gi numbers &nbsp; These are just numeric, please add the characters 'gi|' to make a number like gi|16129669</li>\n",
73     "<li>GenBank Accessions &nbsp; numbers and letters such as AAF12034</li>\n</ul>\n",
74     "<li><b>SwissProt, PIR, Trembl, Uniprot</b> &nbsp; a single letter and some digits</li></ol>\n",
75     "<p>Next, please paste some accesion numbers into the box below. You can separate your accessions with spaces, returns, or commas.</p>\n",
76     $cgi->textarea(-name=>"proteins", -rows=>10, -columns=>40), "<br>",
77   $cgi->submit, $cgi->reset, $cgi->end_form;   $cgi->submit, $cgi->reset, $cgi->end_form;
78   return $html;   return $html;
79  }  }
# Line 75  Line 81 
81  sub show_info {  sub show_info {
82   my ($fig,$cgi,$html)=@_;   my ($fig,$cgi,$html)=@_;
83    
84   my $ids=&parse_ids($cgi->param('proteins'));   my $ids=&parse_ids($cgi->param('proteins')); # this does it all in one but does not allow error checking
85    
86   my $tab; my @unknowns;   my $tab; my @unknowns;
87   foreach my $key (keys %$ids) {   foreach my $key (keys %$ids) {
88      print STDERR "$key\n";
89    unless (scalar(@{$ids->{$key}})) {    unless (scalar(@{$ids->{$key}})) {
90       print STDERR "Addiong $key\n";
91     push @unknowns, $key;     push @unknowns, $key;
92     next;     next;
93    }    }
# Line 87  Line 96 
96    foreach my $peg (@{$ids->{$key}}) {    foreach my $peg (@{$ids->{$key}}) {
97     # link to ss is: subsys.cgi?can_alter=$can_alter&SPROUT=$sprout&user=$user&ssa_name=$esc_sub&request=show_ssa&show_clusters=1&sort=by_phylo"     # link to ss is: subsys.cgi?can_alter=$can_alter&SPROUT=$sprout&user=$user&ssa_name=$esc_sub&request=show_ssa&show_clusters=1&sort=by_phylo"
98     my $ss = join "<br>\n",     my $ss = join "<br>\n",
99                  map {"<a href='/FIG/subsys.cgi?&user=$user&ssa_name=". $_->[0] ."&request=show_ssa&show_clusters=1&sort=by_phylo'>" . $_->[0] . "</a> (" . $_->[1] . ")"}                  map {"<a href='/FIG/subsys.cgi?&user=$user&ssa_name=". $_->[0] ."&request=show_ssa&show_clusters=1&sort=by_phylo'>" . $_->[0] . "</a>"}
100                  (sort $fig->subsystems_for_peg($peg));                  (sort $fig->subsystems_for_peg($peg));
    #my $ss=$raelib->ss_by_id($peg);  
101     unless ($ss) {$ss=" None "}     unless ($ss) {$ss=" None "}
102     my $ffp=join ", ", map {$fig->family_function($_) . " ($_)"} ($fig->families_for_protein($peg));     my $ffp=join "", map {"<a href='/FIG/proteinfamilies.cgi?user=$user&family=$_'>" . $fig->family_function($_) . "</a><br>\n"} ($fig->families_for_protein($peg));
103     unless ($ffp) {$ffp=" None "}     unless ($ffp) {$ffp=" None "}
104     # push @row, $peg, $ss, $ffp;     if ($first)
105     $peg = "<a href='/FIG/protein.cgi?user=$user&prot=$peg'>$peg</a>\n";     {
106     if ($first) {push @$tab, [$first, $peg, $ss, $ffp]; undef($first)} else {push @$tab, [$peg, $ss, $ffp]}       push @$tab, [$first, "<a href='/FIG/protein.cgi?user=$user&prot=$peg'>$peg</a>\n", scalar($fig->function_of($peg, $user)), $ss, $ffp]; undef($first)
107       }
108       else
109       {
110         push @$tab, ["<a href='/FIG/protein.cgi?user=$user&prot=$peg'>$peg</a>\n", scalar($fig->function_of($peg, $user)), $ss, $ffp]
111       }
112    }    }
113   }   }
114    
115     push @$html, &HTML::make_table(["ID", "FIG ID", "Functional Role", "Subsystems", "Protein Families"], $tab, "IDs"), "\n";
116     if (scalar @unknowns)
117     {
118       open (OUT, ">$FIG_Config::temp/protein_info_not_found.$$.txt") || die "Can't open $FIG_Config::temp/protein_info_not_found.$$.txt";
119       print OUT join "\n", "For request from ", $cgi->remote_host, " couldn't find the following IDs", @unknowns, '';
120       close OUT;
121   my $list=join "</li>\n<li>", @unknowns;   my $list=join "</li>\n<li>", @unknowns;
122   push @$html, &HTML::make_table(["ID", "FIG ID", "Subsystems this is in", "Protein Families this is in"], $tab, "IDs"), "\n",     push @$html, "<p>We do not know about the following IDs. Sorry.</p><ul><li>$list</li></ul>\n";
123   "<p>We do not know about the following IDs. Sorry.</p><ul><li>$list</li></ul>\n";   }
124    
125  }  }
126    
# Line 130  Line 149 
149   return $want;   return $want;
150  }  }
151    
   

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3