[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.5, Fri Jul 15 17:31:49 2005 UTC revision 1.6, Tue Sep 20 16:58:09 2005 UTC
# Line 47  Line 47 
47  unshift(@$html, "<TITLE>The SEED - Protein Information</TITLE>\n");  unshift(@$html, "<TITLE>The SEED - Protein Information</TITLE>\n");
48    
49    
50  if ($cgi->param('proteins'))  if ($cgi->param('proteins') || $cgi->param('fileupload'))
51  {  {
52   &show_info($fig,$cgi,$html);   &show_info($fig,$cgi,$html);
53  }  }
# 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,
67   $cgi->start_form(),   $cgi->start_multipart_form(),
68   "<h2>Generate information and links about a series of proteins</h2>\n",   "<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",   "<p>Please paste some gene or protein IDs into this box or upload a file of IDs. 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. You can separate your accessions with spaces, returns, or commas.</p>\n",
70   "<p>Typical IDs are in the following format:</p>\n",   "<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",   "<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",   "<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",   "<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",   "<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",   $cgi->textarea(-name=>"proteins", -rows=>10, -columns=>40), "<br>\n",
76   $cgi->textarea(-name=>"proteins", -rows=>10, -columns=>40), "<br>",   $cgi->filefield(-name=>"fileupload", -size=>50), "<br>\n",
77   $cgi->submit, $cgi->reset, $cgi->end_form;   $cgi->submit, $cgi->reset, $cgi->end_form;
78   return $html;   return $html;
79  }  }
# Line 81  Line 81 
81  sub show_info {  sub show_info {
82   my ($fig,$cgi,$html)=@_;   my ($fig,$cgi,$html)=@_;
83    
84     if ($cgi->upload('fileupload'))
85     {
86      my $fh=$cgi->upload('fileupload');
87      $cgi->param(-name=>'proteins', -value=>[(<$fh>)]);
88     }
89    
90   my $ids=&parse_ids($cgi->param('proteins')); # this does it all in one but does not allow error checking   my $ids=&parse_ids($cgi->param('proteins')); # this does it all in one but does not allow error checking
91    
92     # predefine the color section for the subsys link
93     my $color="&color=" . join("&color=", map {@{$ids->{$_}}} keys %$ids);
94    
95   my $tab; my @unknowns;   my $tab; my @unknowns;
96   foreach my $key (keys %$ids) {   foreach my $key (keys %$ids) {
97    unless (scalar(@{$ids->{$key}})) {    unless (scalar(@{$ids->{$key}})) {
# Line 92  Line 101 
101    my $cs="td rowspan=".scalar(@{$ids->{$key}});    my $cs="td rowspan=".scalar(@{$ids->{$key}});
102    my $first=[$key, $cs];    my $first=[$key, $cs];
103    foreach my $peg (@{$ids->{$key}}) {    foreach my $peg (@{$ids->{$key}}) {
104    
105       # OLD STYLE: Regular link into the subsystems page
106     # 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"
107       #my $ss = join "<br>\n",
108       #            map {"<a href='subsys.cgi?&user=$user&ssa_name=". $_->[0] ."&request=show_ssa&show_clusters=1&sort=by_phylo'>" . $_->[0] . "</a>"}
109       #            (sort $fig->subsystems_for_peg($peg));
110    
111       # NEW STYLE: Link to displaysubsys.cgi
112       #display_subsys.cgi?ssa_name=Capsular_polysaccharide_biosynthesis_in_Staphylococcus&color=uni|P95695&color=uni|Q99X66&uni|Q99X65
113     my $ss = join "<br>\n",     my $ss = join "<br>\n",
114                  map {"<a href='/FIG/subsys.cgi?&user=$user&ssa_name=". $_->[0] ."&request=show_ssa&show_clusters=1&sort=by_phylo'>" . $_->[0] . "</a>"}                 map {"<a href='display_subsys.cgi?user=$user&ssa_name=". $_->[0] . "$color'>" . $_->[0] . "</a>"}
115                  (sort $fig->subsystems_for_peg($peg));                  (sort $fig->subsystems_for_peg($peg));
116    
117     unless ($ss) {$ss=" None "}     unless ($ss) {$ss=" None "}
118     my $ffp=join "", map {"<a href='/FIG/proteinfamilies.cgi?user=$user&family=$_'>" . $fig->family_function($_) . "</a><br>\n"} ($fig->families_for_protein($peg));     my $ffp=join "", map {"<a href='proteinfamilies.cgi?user=$user&family=$_'>" . $fig->family_function($_) . "</a><br>\n"} ($fig->families_for_protein($peg));
119     unless ($ffp) {$ffp=" None "}     unless ($ffp) {$ffp=" None "}
120     if ($first)     if ($first)
121     {     {
122       push @$tab, [$first, "<a href='/FIG/protein.cgi?user=$user&prot=$peg'>$peg</a>\n",       push @$tab, [$first, "<a href='protein.cgi?user=$user&prot=$peg'>$peg</a>\n",
123          $fig->genus_species($fig->genome_of($peg)), scalar($fig->function_of($peg, $user)), $ss, $ffp]; undef($first)          $fig->genus_species($fig->genome_of($peg)), scalar($fig->function_of($peg, $user)), $ss, $ffp]; undef($first)
124     }     }
125     else     else
126     {     {
127       push @$tab, ["<a href='/FIG/protein.cgi?user=$user&prot=$peg'>$peg</a>\n", $fig->genus_species($fig->genome_of($peg)),       push @$tab, ["<a href='protein.cgi?user=$user&prot=$peg'>$peg</a>\n", $fig->genus_species($fig->genome_of($peg)),
128                  scalar($fig->function_of($peg, $user)), $ss, $ffp]                  scalar($fig->function_of($peg, $user)), $ss, $ffp]
129     }     }
130    }    }
131   }   }
132    
133   push @$html, &HTML::make_table(["ID", "FIG ID", "Genus Species", "Functional Role", "Subsystems", "Protein Families"], $tab, "IDs"), "\n";   push @$html, &HTML::make_table(["ID", "FIG ID<br><small>Link goes to protein page</small>", "Genus Species", "Functional Role", "Subsystems<br><small>Link will color subsystem with all pegs</small>", "Protein Families<br><small>Link will explore Protein Family</small>"], $tab, "IDs"), "\n";
134   if (scalar @unknowns)   if (scalar @unknowns)
135   {   {
136     open (OUT, ">$FIG_Config::temp/protein_info_not_found.$$.txt") || die "Can't open $FIG_Config::temp/protein_info_not_found.$$.txt";     open (OUT, ">$FIG_Config::temp/protein_info_not_found.$$.txt") || die "Can't open $FIG_Config::temp/protein_info_not_found.$$.txt";
# Line 145  Line 163 
163   # If you look through the code, and find a really long run on line, blame GJO   # If you look through the code, and find a really long run on line, blame GJO
164   # he complained about having to delete my beautifully functional code. Perhaps he is worried about   # he complained about having to delete my beautifully functional code. Perhaps he is worried about
165   # disk space or something.   # disk space or something.
 # map {@{$want->{$_}}=$fig->by_alias($_) if ($_); s/^\s+//; s/\s+$//} map {split /[\s*\,]/, $_} @given;  
166   map {   map {
167     s/^\s+//; s/\s+$//;     s/^\s+//; s/\s+$//;
168     if (/^\d+$/) {$_="gi|".$_}     if (/^\d+$/) {$_="gi|".$_}

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3