[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.13, Thu Aug 4 20:08:55 2005 UTC revision 1.14, Mon Aug 8 18:43:08 2005 UTC
# Line 80  Line 80 
80  {  {
81   &show_protein($fig,$cgi,$html);   &show_protein($fig,$cgi,$html);
82  }  }
83    elsif ($cgi->param('fig2kegg'))
84    {
85     &comparefig2kegg($fig,$cgi,$html);
86    }
87  else  else
88  {  {
89    &show_initial($fig,$cgi,$html);    &show_initial($fig,$cgi,$html);
# Line 183  Line 187 
187    
188  # Note that column == family, But start with fig and then  allow a replace ID feature like before.  # Note that column == family, But start with fig and then  allow a replace ID feature like before.
189    
190   my $focus=$cgi->param('focus'); # these are the things that we are interested in   my $focus=$cgi->param('focus') or 'fig'; # these are the things that we are interested in
  unless ($focus) {$focus="fig"}  
191    
192   my @cols;   my @cols;
193   if ($cgi->param("allfams")) {@cols=grep {$cgi->param($_)} $cgi->param("allfams")}   if ($cgi->param("allfams")) {@cols=grep {$cgi->param($_)} $cgi->param("allfams")}
# Line 304  Line 307 
307  }  }
308    
309    
310    sub comparefig2kegg {
311     my ($fig,$cgi,$html)=@_;
312    
313     my $classification; my %subsystem;
314     # read classification from kegg file
315     if (open(IN, "$FIG_Config::global/ProteinFamilies/kegg_classificaation.txt")) {
316      while (<IN>) {
317       chomp;
318       my @a=split /\t/;
319       my $id=shift(@a);
320       $subsystem{"kegg|$id"}=pop(@a);
321       push @{$classification->{"kegg|$id"}}, \@a;
322      }
323     }
324    
325    
326     my $tab=[];
327     # find out what families our proteins are in
328     map {
329      my $prot=$_;
330      map {
331       my $fam=$_;
332       if ($fam =~ /^fig/) {
333        my %ss;
334        map {$ss{$_->[0]}++} ($fig->subsystems_for_role($fig->family_function($fam)));
335        map {my $ss=$_; push @$tab, [$prot, @{$fig->subsystem_classification($ss)}, $ss, $fam, $fig->family_function($fam)]} keys %ss;
336       }
337       else {
338        map {push @$tab, [$prot, @{$_}, $subsystem{$fam}, $fam, $fig->family_function($fam)]} @{$classification->{$fam}}
339       }
340       } grep {/^fig/ || /^kegg/} $fig->families_for_protein($prot);
341       } $cgi->param('proteins');
342    
343     my $col_hdrs=['Protein', ['Classification', 'th colspan=2'], 'Subsystem', 'Family ID', 'Family Function'];
344     push @$html, &HTML::make_table($col_hdrs, $tab, "Families"),  "\n",
345    }
346    
347    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3