[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.17, Wed Oct 5 15:48:22 2005 UTC revision 1.18, Wed Oct 5 21:09:20 2005 UTC
# Line 458  Line 458 
458    map {    map {
459     my $id=$_;     my $id=$_;
460     map {     map {
461      push @$tab, [$fig->prot_to_cid($id), $id, scalar($fig->function_of($id)), $_, $fig->family_function($_)];      push @$tab, [$fig->prot_to_cid($id), $id, &functionate($id), $_, $fig->family_function($_)];
462      $allfams->{$_}="$_ : " . $fig->family_function($_);      $allfams->{$_}="$_ : " . $fig->family_function($_);
463      } $fig->families_for_protein($id);      } $fig->families_for_protein($id);
464    } @equiv;    } @equiv;
# Line 467  Line 467 
467    my $col_hdrs=['CID', 'Protein', 'Function of Proteins', 'Family', 'Family Function'];    my $col_hdrs=['CID', 'Protein', 'Function of Proteins', 'Family', 'Family Function'];
468    push @$html, $cgi->start_form(-method=>'get'), $cgi->p("For protein <b>$peg</b>, which has the unique ID <b>$cid</b>, this is the EQUIV set."),    push @$html, $cgi->start_form(-method=>'get'), $cgi->p("For protein <b>$peg</b>, which has the unique ID <b>$cid</b>, this is the EQUIV set."),
469    &HTML::make_table($col_hdrs, $tab, ""),  "\n", $cgi->p("To differentiate families in this table, please choose two families:"),    &HTML::make_table($col_hdrs, $tab, ""),  "\n", $cgi->p("To differentiate families in this table, please choose two families:"),
470    $cgi->popup_menu(-name=>"family1", -values=>[sort {$a cmp $b} keys %$allfams], -labels=>$allfams),    "Family 1: &nbsp; ", $cgi->popup_menu(-name=>"family1", -values=>[sort {$a cmp $b} keys %$allfams], -labels=>$allfams),
471    $cgi->popup_menu(-name=>"family2", -values=>[sort {$a cmp $b} keys %$allfams], -labels=>$allfams),    " &nbsp; Family 2: &nbsp; ", $cgi->popup_menu(-name=>"family2", -values=>[sort {$a cmp $b} keys %$allfams], -labels=>$allfams),
472    $cgi->p("Limit the display to proteins from ", &choose_focus($cgi), "\n"),    $cgi->p("Limit the display to proteins from ", &choose_focus($cgi), "\n"),
473    $cgi->p("Show proteins:<br /><ul>", $cgi->checkbox(-name=>"1not2", -label=>"In family one and NOT family two"), "<br />",    $cgi->p("Show proteins:<br /><ul>\n",
474    $cgi->checkbox(-name=>"2not1", -label=>"In family two and NOT family one"), "<br />",    $cgi->checkbox(-name=>"1not2", -label=>"In family one and NOT family two"), "<br />\n",
475    $cgi->checkbox(-name=>"intersect", -label=>"In both families"), "</ul>"),    $cgi->checkbox(-name=>"2not1", -label=>"In family two and NOT family one"), "<br />\n",
476      $cgi->checkbox(-name=>"1and2", -label=>"In both families"), "\n</ul>\n"),
477    $cgi->submit(-name=>"differentiate", -value=>"Differentiate these families"), $cgi->reset, $cgi->end_form();    $cgi->submit(-name=>"differentiate", -value=>"Differentiate these families"), $cgi->reset, $cgi->end_form();
478   }   }
479  }  }
# Line 489  Line 490 
490    return;    return;
491   }   }
492   my ($fam1, $fam2)=([$fig->ids_in_family($fam_id1)], [$fig->ids_in_family($fam_id2)]);   my ($fam1, $fam2)=([$fig->ids_in_family($fam_id1)], [$fig->ids_in_family($fam_id2)]);
493   push @$html, $cgi->h3("Proteins that are in $fam_id1 (" . $fig->family_function($fam_id1) . ") and not in $fam_id2 (" .  
494               $fig->family_function($fam_id2) . ")\n"), "<ol>\n<li>",   if ($cgi->param("1not2")) {
495        join("</li>\n<li>", sort grep {/^$focus/} map {$fig->cid_to_prots($_)} @{&set_utilities::set_diff($fam1, $fam2)}),    my $tab;
496        "</li>\n</ol>\n\n" if ($cgi->param("1not2"));    map {
497   push @$html, $cgi->hr, $cgi->h3("Proteins that are in $fam_id2 (" . $fig->family_function($fam_id2) . ") and not in $fam_id1 (" .      my $cid=$_;
498               $fig->family_function($fam_id1) . ")\n"), "<ol>\n<li>",      map {push @$tab, [$cid, $_, &functionate($_)]} sort grep {/^$focus/} $fig->cid_to_prots($cid)
499        join("</li>\n<li>", sort grep {/^$focus/} map {$fig->cid_to_prots($_)} @{&set_utilities::set_diff($fam2, $fam1)}),      } sort @{&set_utilities::set_diff($fam1, $fam2)};
500        "</li>\n</ol>\n\n" if ($cgi->param("2not1"));  
501   push @$html, $cgi->hr, $cgi->h3("Proteins that are in both $fam_id1 (" . $fig->family_function($fam_id1) . ") and in $fam_id2 (" .    $tab=&HTML::merge_table_rows($tab);
502               $fig->family_function($fam_id2) . ") <b>[the intersection]</b>\n"), "<ol>\n<li>",    push @$html, $cgi->h3("Proteins that are in $fam_id1 (" , $fig->family_function($fam_id1) , ") and not in $fam_id2 (" ,
503        join("</li>\n<li>", sort grep {/^$focus/} map {$fig->cid_to_prots($_)} @{&set_utilities::intersection($fam1, $fam2)}),            $fig->family_function($fam_id2) . ")\n"), &HTML::make_table(["CID", "Protein ID", "Function"], $tab, "");
       "</li>\n</ol>\n\n" if ($cgi->param("intersect"));  
504  }  }
505    
506    
507     if ($cgi->param("2not1")) {
508      my $tab;
509      map {
510        my $cid=$_;
511        map {push @$tab, [$cid, $_, &functionate($_)]} sort grep {/^$focus/} $fig->cid_to_prots($cid)
512        } sort @{&set_utilities::set_diff($fam2, $fam1)};
513    
514      $tab=&HTML::merge_table_rows($tab);
515      push @$html, $cgi->hr, $cgi->h3("Proteins that are in $fam_id2 (" , $fig->family_function($fam_id2) , ") and not in $fam_id1 (" ,
516              $fig->family_function($fam_id1) . ")\n"), &HTML::make_table(["CID", "Protein ID", "Function"], $tab, "");
517     }
518    
519     if ($cgi->param("1and2")) {
520      my $tab;
521      map {
522        my $cid=$_;
523        map {push @$tab, [$cid, $_, &functionate($_)]} sort grep {/^$focus/} $fig->cid_to_prots($cid)
524        } @{&set_utilities::intersection($fam1, $fam2)};
525    
526      $tab=&HTML::merge_table_rows($tab);
527      push @$html, $cgi->hr, $cgi->h3("Proteins that are in both $fam_id1 (" , $fig->family_function($fam_id1) , ") and in $fam_id2 (" ,
528              $fig->family_function($fam_id2) . ")\n"), &HTML::make_table(["CID", "Protein ID", "Function"], $tab, "");
529     }
530    }
531    
532    
533    
534    sub functionate {
535     my $peg=shift;
536     return scalar($fig->function_of($peg));
537    }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3