[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.25, Tue Oct 25 15:17:47 2005 UTC revision 1.26, Tue Oct 25 17:41:32 2005 UTC
# Line 12  Line 12 
12    
13  use strict;  use strict;
14  use FIG;  use FIG;
15    use FIGjs;
16  use HTML;  use HTML;
17  use raelib;  use raelib;
18  use CGI;  use CGI;
# Line 571  Line 572 
572    
573      # if the protein is not added, we want to know if it has the same start characters as the family (i.e. from the same source), and note that.      # if the protein is not added, we want to know if it has the same start characters as the family (i.e. from the same source), and note that.
574      ($extids->{$prot}->{$families[$_]}) ?      ($extids->{$prot}->{$families[$_]}) ?
575      eval {$seen->{$prot}=1; $row->[$_+1] .= &protein_link($prot) . "<br />" } :      eval {$seen->{$prot}=1; $row->[$_+1] .= &protein_link($prot, $families[$_]) . "<br />" } :
576      ($prot =~ /^$source[$_]/) ? eval      ($prot =~ /^$source[$_]/) ? eval
577      {$mismatchcolor->{$_+1}=1; $row->[$_+1] .= &protein_link($prot) . "<br />" } :      {$mismatchcolor->{$_+1}=1; $row->[$_+1] .= &protein_link($prot, $families[$_]) . "<br />" } :
578      1;      1;
579     } (0 .. $#families);     } (0 .. $#families);
580    } sort $fig->cid_to_prots($cid);    } sort $fig->cid_to_prots($cid);
# Line 587  Line 588 
588    #push @$tab, $row if ($row->[1]->[0]);    #push @$tab, $row if ($row->[1]->[0]);
589    
590    # if we want to show everything do so, otherwise only show the rows where there is a missing protein    # if we want to show everything do so, otherwise only show the rows where there is a missing protein
591    if ($cgi->param('show') eq "all")    if ($cgi->param("diff") eq "1and2" || $cgi->param('show') eq "all")
592    {    {
593     push @$tab, $row;     push @$tab, $row;
594    }    }
# Line 597  Line 598 
598    }    }
599    elsif ($cgi->param("diff") eq "2not1" && $row->[1] ne " &nbsp; ")    elsif ($cgi->param("diff") eq "2not1" && $row->[1] ne " &nbsp; ")
600    {    {
601     ($row->[1], $row->[2])=($row->[2], $row->[1]);     #($row->[1], $row->[2])=($row->[2], $row->[1]);
602     push @$tab, $row;     push @$tab, $row;
603    }    }
604   }   }
# Line 629  Line 630 
630    
631   #my @headers=map {$_ = "$_: <a href='proteinfamilies.cgi?family=$families[$_]'>$source[$_]</a>"} (0..$#families);   #my @headers=map {$_ = "$_: <a href='proteinfamilies.cgi?family=$families[$_]'>$source[$_]</a>"} (0..$#families);
632   my @headers=@families;   my @headers=@families;
633   ($cgi->param("diff") eq "2not1") ? ($headers[0], $headers[1])=($headers[1], $headers[0]) : 1;   #($cgi->param("diff") eq "2not1") ? ($headers[0], $headers[1])=($headers[1], $headers[0]) : 1;
634   map {$_ = "<a href='proteinfamilies.cgi?family=$_'>$_</a>"} @headers;   map {$_ = "<a " . FIGjs::mouseover("Column Family", $fig->family_function($_) . " ($_)", '') . " href='proteinfamilies.cgi?family=$_'>$_</a>"} @headers;
635   #my $colhdrs=["CID", ["Proteins not in families", "th style='background-color: #FF3366'"], @headers];   #my $colhdrs=["CID", ["Proteins not in families", "th style='background-color: #FF3366'"], @headers];
636   my $colhdrs=["CID", @headers];   my $colhdrs=["CID", @headers];
637     if ($tab)
638     {
639   push @$html, HTML::make_table($colhdrs, $tab, $title);   push @$html, HTML::make_table($colhdrs, $tab, $title);
640  }  }
641     else
642     {
643      push @$html, $cgi->h3("<div style='color: blue; text-align: center'><p>Sorry there were no protein families that satisfied looking for</p>\n<p>$title</p></span>");
644     }
645    }
646    
647    
648  sub old_differentiate {  sub old_differentiate {
# Line 841  Line 849 
849     } sort grep {/^$focus/} $fig->cid_to_prots($cid);     } sort grep {/^$focus/} $fig->cid_to_prots($cid);
850     unless ($#$row == $#families+2) {$#$row=$#families+2}     unless ($#$row == $#families+2) {$#$row=$#families+2}
851    
852     $row->[1] = [join("<br />", map {&protein_link($_)} grep {!$seen->{$_}} $fig->cid_to_prots($cid)), "td style='background-color: #FF3366'"];     $row->[1] = [join("<br />", map {&protein_link($_, $families[0])} grep {!$seen->{$_}} $fig->cid_to_prots($cid)), "td style='background-color: #FF3366'"];
853    
854     push @$tab, $row;     push @$tab, $row;
855    } @{&set_utilities::set_diff($fam1, $fam2)};    } @{&set_utilities::set_diff($fam1, $fam2)};
# Line 927  Line 935 
935    
936    
937  sub protein_link {  sub protein_link {
938   my $p=shift;   my ($p, $fam) =@_;
939   my %proteinbase=(   my %proteinbase=(
940    "fig"         => "protein.cgi?user=$user&prot=fig|",    "fig"         => "protein.cgi?user=$user&prot=fig|",
941    "cog"  => "http://www.ncbi.nlm.nih.gov/COG/old/palox.cgi?",    "cog"  => "http://www.ncbi.nlm.nih.gov/COG/old/palox.cgi?",
# Line 936  Line 944 
944    "kegg" => "http://www.genome.jp/dbget-bin/www_bget?",    "kegg" => "http://www.genome.jp/dbget-bin/www_bget?",
945   );   );
946    
947   map {($p =~ /^$_/) ? eval {$p =~ s/^(.*?)\|//; $p = "<a href='$proteinbase{$_}$p'>$1|$p</a>"} : 1;} keys %proteinbase;   my $mouseovertitle="Protein Families";
948     if ($fam)
949     {
950      $mouseovertitle="<i>Column: " . $fig->family_function($fam) . " ($fam)</i>";
951     }
952     my $familiesforp = join("<br />", map {$_ . " : ". $fig->family_function($_)} $fig->ext_family_for_id($p));
953     unless ($familiesforp) {$familiesforp="No protein family"} # this is so there is something (whitespace) to print
954     map {($p =~ /^$_/) ? eval {$p =~ s/^(.*?)\|//; $p = "<a " . FIGjs::mouseover($mouseovertitle, $familiesforp, '') . "href='$proteinbase{$_}$p'>$1|$p</a>"} : 1;} keys %proteinbase;
955   return $p;   return $p;
956  }  }
957    

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3