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

Diff of /FigWebServices/close_genome_discrepancies.cgi

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

revision 1.2, Thu Jun 29 15:36:01 2006 UTC revision 1.7, Thu Jun 29 22:43:41 2006 UTC
# Line 55  Line 55 
55  my $max       = $cgi->param('max');  my $max       = $cgi->param('max');
56    
57  unless ($key_org) {$key_org=$orgs[0]}  unless ($key_org) {$key_org=$orgs[0]}
58  unless ($maxN) {$maxN=10}  unless ($maxN) {$maxN=50}
59  unless ($maxP) {$maxP=1e-20}  unless ($maxP) {$maxP=1e-20}
60  unless ($max) {$max=10}  unless ($max) {$max=10}
61    
62  my $keep=0;  my $keep=0;
63    undef $first_peg unless ($key_org eq $fig->genome_of($first_peg));
64  unless ($first_peg) {$keep=1}  unless ($first_peg) {$keep=1}
65    
66    
67  my $last_peg;  my $last_peg;
68    my $pegct; my $pegsofar;
69  foreach my $peg (sort {$fig->feature_location($a) cmp $fig->feature_location($b)} $fig->pegs_of($key_org))  foreach my $peg (sort {$fig->feature_location($a) cmp $fig->feature_location($b)} $fig->pegs_of($key_org))
70  {  {
71        $pegct++;
72      my $tab;      my $tab;
73      ($peg eq $first_peg) ? ($keep=1) : 1;      ($peg eq $first_peg) ? ($keep=1) : 1;
74      next unless ($keep);      unless ($keep) {$pegsofar++; next}
75        next if ($keep > $max);
76      $last_peg=$peg;      $last_peg=$peg;
77      last if ($keep > $max);      $pegsofar++;
78      my $fn=$fig->function_of($peg, $user);      my $fn=$fig->function_of($peg, $user);
79      my @inc=($peg);      my @inc=($peg);
80      my %function;      my %function;
# Line 90  Line 94 
94      my %position;      my %position;
95      foreach my $fn (sort {$function{$b} <=> $function{$a}} keys %function) {$position{$fn}=$cnt++}      foreach my $fn (sort {$function{$b} <=> $function{$a}} keys %function) {$position{$fn}=$cnt++}
96      my @colors= UnvSubsys::cool_colors();      my @colors= UnvSubsys::cool_colors();
97        my %genomect;
98    
99      foreach my $peg (@inc)      foreach my $peg (sort {$fig->genome_of($a) cmp $fig->genome_of($b)} @inc)
100      {      {
101            $genomect{$fig->genome_of($peg)}++;
102          my $user_entry = &HTML::fid_link( $cgi, $peg );          my $user_entry = &HTML::fid_link( $cgi, $peg );
103          if ($user)          if ($user)
104          {          {
# Line 120  Line 126 
126          }          }
127          my $ev = join("<br>", &evidence_codes($fig, $peg));          my $ev = join("<br>", &evidence_codes($fig, $peg));
128    
129            my $genomelabel = $fig->genus_species($fig->genome_of($peg)) . " (".$fig->genome_of($peg).")";
130            my $abbr=$cgi->a({id=>"genome", onMouseover=>"javascript:if(!this.tooltip) this.tooltip=new Popup_Tooltip(this, 'Genome', '$genomelabel', ''); this.tooltip.addHandler(); return false;"}, $fig->abbrev($fig->genus_species($fig->genome_of($peg))));
131    
132          my $row=[          my $row=[
133              $keep,              $keep,
134              $fig->abbrev($fig->genus_species($fig->genome_of($peg))),              $abbr,
135                $genomect{$fig->genome_of($peg)},
136              $user_entry,              $user_entry,
137              $in_sub,              $in_sub,
138              $ev,              $ev,
# Line 157  Line 166 
166    
167    
168    
169      my $col_hdrs=["Set", "Organism", "PEG", "SS", "EV", "Len", "Function"];      my $col_hdrs=["Set", "Organism", "Occ", "PEG", "SS", "EV", "Len", "Function"];
170      push( @$html, &HTML::make_table( $col_hdrs, $tab, "Description By Set" ) );      push( @$html, &HTML::make_table( $col_hdrs, $tab, "Description By Set" ) );
171    
172      if ($user)      if ($user)
# Line 170  Line 179 
179    
180  }  }
181    
182    
183    # set the new first peg
184    $cgi->param('first_peg', $last_peg);
185    
186    
187  my $link=$cgi->url."?user=$user&max=$max&maxN=$maxN&maxP=$maxP&key_org=$key_org&first_peg=$last_peg&korgs=".(join("&korgs=", @orgs));  my $link=$cgi->url."?user=$user&max=$max&maxN=$maxN&maxP=$maxP&key_org=$key_org&first_peg=$last_peg&korgs=".(join("&korgs=", @orgs));
188  splice(@$html, 1, 0, $cgi->p("<a href='$link'>Next $max pegs</a>"));  my $percent=int(($pegsofar/$pegct) * 1000)/10;
189    splice(@$html, 1, 0, $cgi->p("<a href='$link'>Next $max pegs</a>"), $cgi->h4("Walked $pegsofar of $pegct pegs ($percent \%)"));
190    
191    
192  push @$html, $cgi->p("<a href='$link'>Next $max pegs</a>");  push @$html, $cgi->p("<a href='$link'>Next $max pegs</a><hr>\n");
193    my %organisms=map {($_ => $fig->genus_species($_). " ($_)")} @orgs;
194    push @$html, (
195                    $cgi->start_form(),
196                    $cgi->hidden(-name=>"user"),
197                    $cgi->hidden(-name=>"korgs"),
198                    $cgi->ul(
199                        "<br />\n<h2>Currently walking along " , $fig->genus_species($key_org), "</h2>",
200                        "<br />\nChange to: &nbsp; " , $cgi->popup_menu(-name=>"key_org", -values=>[keys %organisms], -labels=>\%organisms, -default=>$key_org),
201                        "<br />\nmaxN: " , $cgi->textfield(-name=>"maxN", -default=>$maxN, -size=>6),
202                        "<br />\nmaxP: " , $cgi->textfield(-name=>"maxP", -default=>$maxP, -size=>6),
203                        "<br />\nfirst peg: " , $cgi->textfield(-name=>"first_peg", -default=>$last_peg, -size=>20),
204                        "<br />\nNumber of pegs to show: " , $cgi->textfield(-name=>"max", -default=>$max, -size=>6),
205                        "<br />\n" , $cgi->submit, $cgi->reset,
206                        ),
207                    $cgi->end_form,
208                );
209  &HTML::show_page($cgi, $html);  &HTML::show_page($cgi, $html);
210    
211    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3