[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.44, Fri Jan 27 05:05:36 2006 UTC revision 1.45, Fri Jan 27 20:24:55 2006 UTC
# Line 413  Line 413 
413   #   #
414   # Note that in both cases we grep out our two query families and then unshift them to make them the first two query columns   # Note that in both cases we grep out our two query families and then unshift them to make them the first two query columns
415    
416   my @families;   my @families; my $peg;
417   if ($cgi->param('prot'))   if ($cgi->param('prot'))
418   {   {
419    my $peg=$cgi->param('prot');    $peg=$cgi->param('prot');
420    @families=sort {$a cmp $b} grep {$_ ne $fam_id1} grep {$_ ne $fam_id2} $fig->families_for_protein($peg);    @families=sort {$a cmp $b} grep {$_ ne $fam_id1} grep {$_ ne $fam_id2} $fig->families_for_protein($peg);
421   }   }
422   else   else
# Line 451  Line 451 
451   # finally generate the table. Note that there are three different arrays that we operate on depending on the user input   # finally generate the table. Note that there are three different arrays that we operate on depending on the user input
452   # but it really only changes which set algorith we use. Each array is handled identically.   # but it really only changes which set algorith we use. Each array is handled identically.
453   my $tab=[];   my $tab=[];
454     my $firstrow=[]; # this will hold the first row with the peg we selected.
455     # add the first line of the table, with a nice colored background, that shows what the original protein is.
456     if ($peg)
457     {
458        my $seen;
459        foreach my $prot ($fig->cid_to_prots($fig->prot_to_cid($peg)))
460        {
461            for (my $i=0; $i<=$#families; $i++)
462            {
463                if ($extids->{$prot}->{$families[$i]} && !($seen->{$prot}->{$i}))
464                {
465                    if ($i == 0) { $firstrow->[$i] .= &protein_link($prot, 1, $families[$i]) . "<br />" if ($peg eq $prot)}
466                    else {$firstrow->[$i] .= &protein_link($prot, 1, $families[$i]) . "<br />"}
467                    $seen->{$prot}->{$i}=1;
468                }
469            }
470        }
471        unshift @$firstrow, "Your<br>peg";
472        map {$firstrow->[$_] = [$firstrow->[$_], "td style='background-color: #FF9966'"]} (0 .. $#$firstrow);
473    
474     }
475    
476    
477    
478   my ($totalfor, $totalagainst);   my ($totalfor, $totalagainst);
479   foreach my $cid (@$set)   foreach my $cid (@$set)
# Line 516  Line 539 
539    
540   # sort the table   # sort the table
541   @$tab=sort {$a->[1] cmp $b->[1] || $a->[2] cmp $b->[2]} @$tab;   @$tab=sort {$a->[1] cmp $b->[1] || $a->[2] cmp $b->[2]} @$tab;
542     $firstrow && (unshift @$tab, $firstrow);
543    
544   #generate the titles   #generate the titles
545   my $title;   my $title;

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3