[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.4, Fri Jul 15 17:19:24 2005 UTC revision 1.7, Tue Sep 20 17:29:31 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",   "<b>Paste some IDs here:</b><br>",
76   $cgi->textarea(-name=>"proteins", -rows=>10, -columns=>40), "<br>",   $cgi->textarea(-name=>"proteins", -rows=>10, -columns=>40), "<br>\n",
77     "<br><b>Or choose a file here</b><br>",
78     $cgi->filefield(-name=>"fileupload", -size=>50), "<br>\n",
79   $cgi->submit, $cgi->reset, $cgi->end_form;   $cgi->submit, $cgi->reset, $cgi->end_form;
80   return $html;   return $html;
81  }  }
# Line 81  Line 83 
83  sub show_info {  sub show_info {
84   my ($fig,$cgi,$html)=@_;   my ($fig,$cgi,$html)=@_;
85    
86     if ($cgi->upload('fileupload'))
87     {
88      my $fh=$cgi->upload('fileupload');
89      $cgi->param(-name=>'proteins', -value=>[(<$fh>)]);
90     }
91    
92   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
93    
94     # predefine the color section for the subsys link
95     my $color="&color=" . join("&color=", map {@{$ids->{$_}}} keys %$ids);
96    
97   my $tab; my @unknowns;   my $tab; my @unknowns;
98   foreach my $key (keys %$ids) {   foreach my $key (keys %$ids) {
99    unless (scalar(@{$ids->{$key}})) {    unless (scalar(@{$ids->{$key}})) {
# Line 92  Line 103 
103    my $cs="td rowspan=".scalar(@{$ids->{$key}});    my $cs="td rowspan=".scalar(@{$ids->{$key}});
104    my $first=[$key, $cs];    my $first=[$key, $cs];
105    foreach my $peg (@{$ids->{$key}}) {    foreach my $peg (@{$ids->{$key}}) {
106    
107       # OLD STYLE: Regular link into the subsystems page
108     # 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"
109       #my $ss = join "<br>\n",
110       #            map {"<a href='subsys.cgi?&user=$user&ssa_name=". $_->[0] ."&request=show_ssa&show_clusters=1&sort=by_phylo'>" . $_->[0] . "</a>"}
111       #            (sort $fig->subsystems_for_peg($peg));
112    
113       # NEW STYLE: Link to displaysubsys.cgi
114       #display_subsys.cgi?ssa_name=Capsular_polysaccharide_biosynthesis_in_Staphylococcus&color=uni|P95695&color=uni|Q99X66&uni|Q99X65
115     my $ss = join "<br>\n",     my $ss = join "<br>\n",
116                  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>"}
117                  (sort $fig->subsystems_for_peg($peg));                  (sort $fig->subsystems_for_peg($peg));
118    
119     unless ($ss) {$ss=" None "}     unless ($ss) {$ss=" None "}
120     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));
121     unless ($ffp) {$ffp=" None "}     unless ($ffp) {$ffp=" None "}
122     if ($first)     if ($first)
123     {     {
124       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)       push @$tab, [$first, "<a href='protein.cgi?user=$user&prot=$peg'>$peg</a>\n",
125            $fig->genus_species($fig->genome_of($peg)), scalar($fig->function_of($peg, $user)), $ss, $ffp]; undef($first)
126     }     }
127     else     else
128     {     {
129       push @$tab, ["<a href='/FIG/protein.cgi?user=$user&prot=$peg'>$peg</a>\n", scalar($fig->function_of($peg, $user)), $ss, $ffp]       push @$tab, ["<a href='protein.cgi?user=$user&prot=$peg'>$peg</a>\n", $fig->genus_species($fig->genome_of($peg)),
130                    scalar($fig->function_of($peg, $user)), $ss, $ffp]
131     }     }
132    }    }
133   }   }
134    
135   push @$html, &HTML::make_table(["ID", "FIG ID", "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";
136   if (scalar @unknowns)   if (scalar @unknowns)
137   {   {
138     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 143  Line 165 
165   # 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
166   # 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
167   # disk space or something.   # disk space or something.
 # map {@{$want->{$_}}=$fig->by_alias($_) if ($_); s/^\s+//; s/\s+$//} map {split /[\s*\,]/, $_} @given;  
168   map {   map {
169     s/^\s+//; s/\s+$//;     s/^\s+//; s/\s+$//;
170     if (/^\d+$/) {$_="gi|".$_}     if (/^\d+$/) {$_="gi|".$_}

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3