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

Diff of /FigWebServices/get_dlits.cgi

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

revision 1.9, Tue Jul 8 21:26:13 2008 UTC revision 1.10, Wed Jul 9 15:59:57 2008 UTC
# Line 85  Line 85 
85  my $role      = $cgi->param('role');           #  Find lit by role  my $role      = $cgi->param('role');           #  Find lit by role
86  my $show_just = $cgi->param('show_just');      #  Filter lit by status  my $show_just = $cgi->param('show_just');      #  Filter lit by status
87     $show_just = ($show_just eq "all") ? '' : $show_just;     $show_just = ($show_just eq "all") ? '' : $show_just;
 my $who_says  = $cgi->param('who_says');       #  Show the responsible party  
88    
89  #  Requested actions:  #  Requested actions:
90    
# Line 149  Line 148 
148      my @to_display = ();      my @to_display = ();
149      foreach my $x ( @$tuples )      foreach my $x ( @$tuples )
150      {      {
151          my( $status, $hash, $cur ) = @$x;          my( $status, $hash, $prev_curator ) = @$x;
152          my @pegs = $fig->pegs_with_md5( $hash );          my @pegs = grep { $fig->is_real_feature($_) }
153                       $fig->pegs_with_md5( $hash );
154          if ( @pegs > 0 )          if ( @pegs > 0 )
155          {          {
156              push( @to_display, [ $status, $pegs[0], $ref_id, $cur ] );              push( @to_display, [ $status, $pegs[0], $ref_id, $prev_curator ] );
157          }          }
158      }      }
159    
# Line 174  Line 174 
174      my @to_display = ();      my @to_display = ();
175      foreach my $x ( @$tuples )      foreach my $x ( @$tuples )
176      {      {
177          my( $status, $hash, $pubmed, $cur ) = @$x;          my( $status, $hash, $pubmed, $prev_curator ) = @$x;
178          my @pegs = $fig->pegs_with_md5( $hash );          my @pegs = grep { $fig->is_real_feature($_) }
179                       $fig->pegs_with_md5( $hash );
180          if ( @pegs > 0 )          if ( @pegs > 0 )
181          {          {
182              push( @to_display, [ $status, $pegs[0], $pubmed, $cur ] );              push( @to_display, [ $status, $pegs[0], $pubmed, $prev_curator ] );
183          }          }
184      }      }
185    
# Line 203  Line 204 
204                               ) };                               ) };
205      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),
206                    $cgi->hidden( -name => 'user',     -value => $user ),                    $cgi->hidden( -name => 'user',     -value => $user ),
207                    $cgi->hidden( -name => 'curator',  -value => $curator ),                    $cgi->hidden( -name => 'curator',  -value => $curator )
                   $cgi->hidden( -name => 'who_says', -value => $who_says )  
208          );          );
209    
210      my $whom   = $curator ? "'$curator'" : "any one";      my $whom   = $curator ? "'$curator'" : "any one";
# Line 236  Line 236 
236      my @to_display = ();      my @to_display = ();
237      foreach my $x ( @$tuples )      foreach my $x ( @$tuples )
238      {      {
239          my ( $status, $hash, $pubmed, $cur ) = @$x;          my ( $status, $hash, $pubmed, $prev_curator ) = @$x;
240          foreach my $peg ( $fig->pegs_with_md5($hash) )          push @to_display, map  { [ $status, $_, $pubmed, $prev_curator ] }
241          {                            grep { &FIG::genome_of($_) eq $genome && $fig->is_real_feature($_) }
242              if ( &FIG::genome_of($peg) eq $genome )                            $fig->pegs_with_md5($hash);
             {  
                 push(@to_display,[ $status, $peg, $pubmed, $cur ]);  
             }  
         }  
243      }      }
244    
245      &display_set( $fig, $cgi, $html, \@to_display, "Genes for $genomeD", 'Show Genome' );      &display_set( $fig, $cgi, $html, \@to_display, "Genes for $genomeD", 'Show Genome' );
246  }  }
247    
# Line 268  Line 265 
265      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),
266                    $cgi->hidden( -name => 'user',     -value => $user ),                    $cgi->hidden( -name => 'user',     -value => $user ),
267                    $cgi->hidden( -name => 'curator',  -value => $curator ),                    $cgi->hidden( -name => 'curator',  -value => $curator ),
                   $cgi->hidden( -name => 'who_says', -value => $who_says ),  
268                    $cgi->scrolling_list( -name   => 'genomeD',                    $cgi->scrolling_list( -name   => 'genomeD',
269                                          -values => [@genomes],                                          -values => [@genomes],
270                                          -size   => 30                                          -size   => 30
# Line 297  Line 293 
293    
294      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),
295                    $cgi->hidden( -name => 'user',     -value => $user ),                    $cgi->hidden( -name => 'user',     -value => $user ),
                   $cgi->hidden( -name => 'who_says', -value => $who_says ),  
296                    $cgi->scrolling_list( -name   => 'curator',                    $cgi->scrolling_list( -name   => 'curator',
297                                          -values => [ @cur ],                                          -values => [ @cur ],
298                                          -size   => $curN                                          -size   => $curN
# Line 367  Line 362 
362      foreach $_ ( @$to_display ) { $_->[0] =~ s/^\s*$/ /; }  # fix empty status strings      foreach $_ ( @$to_display ) { $_->[0] =~ s/^\s*$/ /; }  # fix empty status strings
363      my @tuples = sort { ( $status_code{$a->[0]} <=> $status_code{$b->[0]} )      my @tuples = sort { ( $status_code{$a->[0]} <=> $status_code{$b->[0]} )
364                       or &FIG::by_fig_id( $a->[1], $b->[1] )                       or &FIG::by_fig_id( $a->[1], $b->[1] )
365                       or ( $a->[2] <=> $b->[2] )                       or ( $a->[2] <=> $b->[2] )  # Numeric sort of PMID
366                        }                        }
367                   @$to_display;                   @$to_display;
368      my $total_tuples = @tuples;      my $total_tuples = @tuples;
# Line 431  Line 426 
426      my $role = $cgi->param('role');      my $role = $cgi->param('role');
427      push( @$html, $cgi->hidden( -name => 'role', -value => $role, -override => 1 ) ) if $role;      push( @$html, $cgi->hidden( -name => 'role', -value => $role, -override => 1 ) ) if $role;
428    
     #  Find lit by role  
     my $who_says = $cgi->param('who_says');  
     push( @$html, $cgi->hidden( -name => 'who_says', -value => $who_says, -override => 1 ) ) if $who_says;  
   
429      #  Requested action      #  Requested action
430      push( @$html, $cgi->hidden( -name => 'prev_req', -value => $submit, -override => 1 ) ) if $submit;      push( @$html, $cgi->hidden( -name => 'prev_req', -value => $submit, -override => 1 ) ) if $submit;
431    
# Line 461  Line 452 
452    
453      #  Build the status selection table      #  Build the status selection table
454    
455      my $col_hdrs = $who_says ? [' ','G','N','R','D','Curator','PEG','Function','Genus/Species','PubMed','Title']      my $col_hdrs = [' ','G','N','R','D','Curator','PEG','Function','Genus/Species','PubMed','Title'];
                              : [' ','G','N','R','D','PEG','Function','Genus/Species','PubMed','Title'];  
456      my $tab = [];      my $tab = [];
457      my $i;      my $i;
458      for ( $i = 0; ($i < @tuples); $i++ )      for ( $i = 0; ($i < @tuples); $i++ )
459      {      {
460          my $tuple = $tuples[$i];          my $tuple = $tuples[$i];
461          my( $status, $peg, $pubmed, $cur ) = @$tuple;          my( $status, $peg, $pubmed, $prev_curator ) = @$tuple;
462          next if (! $fig->is_real_feature($peg));          next if ( ! $fig->is_real_feature($peg) );   # This should never fail
463    
464            $prev_curator =~ s/^master://i;  #  Remove master from displayed curator
465          my $gs = $fig->genus_species( &FIG::genome_of( $peg ) );          my $gs = $fig->genus_species( &FIG::genome_of( $peg ) );
466          $gs =~ s/^(\S+\s+\S+).*$/$1/;          $gs =~ s/^(\S+\s+\S+).*$/$1/;
467          my $title = &title_of( $fig, $pubmed );          my $title = &title_of( $fig, $pubmed );
# Line 488  Line 480 
480          {          {
481              #  This link intentionally omits filtering by status              #  This link intentionally omits filtering by status
482              my $href = "get_dlits.cgi?user=$user&ref_id=$pubmed";              my $href = "get_dlits.cgi?user=$user&ref_id=$pubmed";
             $href .= '&who_says=1' if $who_says;  
483              $pub_link .= "<BR />(<A HRef='$href' Target=_blank>$genes_in_pub{$pubmed} seqs</A>)";              $pub_link .= "<BR />(<A HRef='$href' Target=_blank>$genes_in_pub{$pubmed} seqs</A>)";
484          }          }
485          if (($i % 15) == 14) { push(@$tab,$col_hdrs) }          if (($i % 15) == 14) { push(@$tab,$col_hdrs) }
486          push( @$tab, $who_says ? [ @codes, $cur, &HTML::fid_link( $cgi, $peg ), $func, $gs, $pub_link, $title ]          push( @$tab, [ @codes, $prev_curator, &HTML::fid_link( $cgi, $peg ), $func, $gs, $pub_link, $title ] );
                                : [ @codes, &HTML::fid_link( $cgi, $peg ), $func, $gs, $pub_link, $title ]  
             );  
487      }      }
488    
489      push( @$html,&HTML::make_table( $col_hdrs, $tab, $tab_title ) );      push( @$html,&HTML::make_table( $col_hdrs, $tab, $tab_title ) );

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3