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

Diff of /FigWebServices/proteinfamilies.cgi

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

revision 1.2, Fri Jul 1 02:09:16 2005 UTC revision 1.3, Tue Jul 12 14:34:15 2005 UTC
# Line 4  Line 4 
4    
5  =head1 proteinfamilies.cgi  =head1 proteinfamilies.cgi
6    
7  A base web service for getting information about protein families in and out. Initially we are going to make a 3 (or 4) column table of protein, family and other proteins.  A base web interface for getting information about protein families in and out. Initially we are going to make a 3 (or 4) column table of protein, family and other proteins.
8    
9  =cut  =cut
10    
# Line 135  Line 135 
135   foreach my $fam ($cgi->param('family')) {   foreach my $fam ($cgi->param('family')) {
136    my @eids=sort {$a <=> $b} $fig->ids_in_family($fam);    my @eids=sort {$a <=> $b} $fig->ids_in_family($fam);
137    my $tab=[];    my $tab=[];
138    my $col_hdrs=['Cluster ID', 'Polypeptides with same protein sequence'];    my $col_hdrs=['Cluster ID', 'Polypeptides with same amino acid sequence'];
139    foreach my $eid (@eids) {    foreach my $eid (@eids) {
140     my @pegs=$fig->eid_to_prots($eid);     my @pegs=$fig->eid_to_prots($eid);
141     foreach my $p (@pegs) {     foreach my $p (@pegs) {
# Line 148  Line 148 
148    
149    push @$html, "<h2>$fam Family</h2>\n",    push @$html, "<h2>$fam Family</h2>\n",
150    "<p>The family $fam has the function ", $fig->family_function($fam), ", and contains ", $fig->sz_family($fam), " proteins, as shown in the table below.<br>",    "<p>The family $fam has the function ", $fig->family_function($fam), ", and contains ", $fig->sz_family($fam), " proteins, as shown in the table below.<br>",
151    "Each of the proteins with a given ID have the same sequence, and hence are the same polypeptide, even though they may come from different organisms.</p>",    "Each of the sequences with a given ID have the same amino acid sequence, and hence are the same polypeptide, ",
152      "even though they may come from different organisms.</p>",
153    "<p>The links will take you to the respective databases for each of the other protein families.\n</p>",    "<p>The links will take you to the respective databases for each of the other protein families.\n</p>",
154    $cgi->start_form,    $cgi->start_form,
155    &HTML::make_table($col_hdrs, $tab, "Proteins in " . $fig->family_function($fam) . " ($fam)"),    &HTML::make_table($col_hdrs, $tab, "Proteins in " . $fig->family_function($fam) . " ($fam)"),
# Line 160  Line 161 
161  sub combine_families {  sub combine_families {
162   my ($fig,$cgi,$html)=@_;   my ($fig,$cgi,$html)=@_;
163   # first find all the families and all the eids in those families   # first find all the families and all the eids in those families
164   my $eids; my @families;   my $eids; my @families; my $allprots;
165   foreach my $f (grep {$cgi->param($_)} $cgi->param("allfams"))   foreach my $f (grep {$cgi->param($_)} $cgi->param("allfams"))
166   {   {
167    push @families, $f;    push @families, $f;
168    foreach my $e ($fig->ids_in_family($f)) {    foreach my $e ($fig->ids_in_family($f)) {$eids->{$e}->{$f}=1; $allprots++}
    $eids->{$e}->{$f}=1;  
   }  
169   }   }
170    
171   # now figure out those eids that are in all families   # now figure out those eids that are in all families
# Line 174  Line 173 
173   my @wanted;   my @wanted;
174   foreach my $eid (keys %$eids) {   foreach my $eid (keys %$eids) {
175    my $keep=1;    my $keep=1;
176    foreach my $f (@families) {undef $keep unless (exists $eids->{$eid}->{$f})}    foreach my $f (@families) {undef $keep unless ($eids->{$eid}->{$f})}
177    push @wanted if ($keep);    push @wanted, $eid if ($keep);
178   }   }
179    
180   my $tab=[];   my $tab=[];
181   my $col_hdrs=['Cluster ID', 'Polypeptides with same protein sequence'];   my $col_hdrs=['Cluster ID', 'Polypeptides with same amino acid sequence'];
182   foreach my $eid (@wanted) {   foreach my $eid (sort {$a <=> $b} @wanted) {
183    my @pegs=$fig->eid_to_prots($eid);    my @pegs=$fig->eid_to_prots($eid);
184    foreach my $p (@pegs) {    foreach my $p (@pegs) {
185     foreach my $k (keys %proteinbase) {     foreach my $k (keys %proteinbase) {
# Line 192  Line 191 
191    
192    
193   push @$html, "<h2>Proteins in ", (join ", ", (@families)), " families</h2>\n",   push @$html, "<h2>Proteins in ", (join ", ", (@families)), " families</h2>\n",
194   "<p>The following proteins are present in the ", scalar(@families), " families that you selected.<br>",   "<h3>Summary</h3>\n<p>There were $allprots proteins in the ", scalar(@families), " families that you selected.\n<br>",
195   "Each of the proteins with a given ID have the same sequence, and hence are the same polypeptide, even though they may come from different organisms.</p>",   "Out of a those proteins, there were ", scalar(keys %$eids),
196     " unique proteins, and ", scalar(@wanted), " proteins are present in the ",
197     scalar(@families), " families.</p>\n",
198     "Each of the sequences with a given ID have the same amino acid sequence, and hence are the same polypeptide, even though they may come from different organisms.</p>",
199   "<p>The links will take you to the respective databases for each of the other protein families.\n</p>",   "<p>The links will take you to the respective databases for each of the other protein families.\n</p>",
200   $cgi->start_form,   $cgi->start_form,
201   &HTML::make_table($col_hdrs, $tab, "Proteins in " . (join ", ", (@families)) . " families"),   &HTML::make_table($col_hdrs, $tab, "Proteins in " . (join ", ", (@families)) . " families"),

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3