[Bio] / Sprout / SHSigGenes.pm Repository:
ViewVC logotype

Diff of /Sprout/SHSigGenes.pm

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

revision 1.12, Tue Apr 10 06:10:02 2007 UTC revision 1.15, Thu May 17 23:44:21 2007 UTC
# Line 96  Line 96 
96      my $statistical = $cgi->param('statistical') || 1;      my $statistical = $cgi->param('statistical') || 1;
97      my $showMatch = $cgi->param('showMatch') || 0;      my $showMatch = $cgi->param('showMatch') || 0;
98      my $useSims = $cgi->param('useSims') || 0;      my $useSims = $cgi->param('useSims') || 0;
99      my $pegsOnly = $cgi->param('pegsOnly') || 0;      my $pegsOnly = $cgi->param('pegsOnly') || 1;
100      # Now we build the table rows.      # Now we build the table rows.
101      my @rows = ();      my @rows = ();
102      # First we have the given genome.      # First we have the given genome.
# Line 126  Line 126 
126                                                   -checked => $showMatch,                                                   -checked => $showMatch,
127                                                   -value => 1,                                                   -value => 1,
128                                                   -label => 'Show Matching Genes'),                                                   -label => 'Show Matching Genes'),
129                                    $cgi->checkbox(-name => 'pegsOnly',  #                                  $cgi->checkbox(-name => 'pegsOnly',
130                                                   -checked => $pegsOnly,  #                                                 -checked => $pegsOnly,
131                                                   -value => 1,  #                                                 -value => 1,
132                                                   -label => 'PEGs Only')))),  #                                                 -label => 'PEGs Only')
133                                      ))),
134                  $cgi->Tr($cgi->td("Cutoff"),                  $cgi->Tr($cgi->td("Cutoff"),
135                           $cgi->td($cgi->textfield(-name => 'cutoff',                           $cgi->td($cgi->textfield(-name => 'cutoff',
136                                                    -value => $cutoff,                                                    -value => $cutoff,
# Line 167  Line 168 
168      # assume there was an error.      # assume there was an error.
169      my $retVal;      my $retVal;
170      # Denote the extra columns go at the end.      # Denote the extra columns go at the end.
171      $self->SetExtraPos(1);      $self->SetExtraPos('score');
172      # Create the timers.      # Create the timers.
173      my ($saveTime, $loopCounter, $bbhTimer, $putTimer, $queryTimer) = (0, 0, 0, 0, 0);      my ($saveTime, $loopCounter, $bbhTimer, $putTimer, $queryTimer) = (0, 0, 0, 0, 0);
174      # Validate the numeric parameters.      # Validate the numeric parameters.
175      my $commonality = $cgi->param('commonality');      my $commonality = $cgi->param('commonality');
176      my $cutoff = $cgi->param('cutoff');      my $cutoff = $cgi->param('cutoff');
177      my $pegsOnly = $cgi->param('pegsOnly');      my $pegsOnly = $cgi->param('pegsOnly') || 1;
178      if ($commonality !~ /^\s*\d(\.\d+)?\s*$/) {      if ($commonality !~ /^\s*\d(\.\d+)?\s*$/) {
179          $self->SetMessage("Commonality value appears invalid, too big, negative, or not a number.");          $self->SetMessage("Commonality value appears invalid, too big, negative, or not a number.");
180      } elsif ($commonality <= 0 || $commonality > 1) {      } elsif ($commonality <= 0 || $commonality > 1) {
# Line 397  Line 398 
398      return "Search for genes that are common to a group of organisms or that discriminate between two groups of organisms.";      return "Search for genes that are common to a group of organisms or that discriminate between two groups of organisms.";
399  }  }
400    
401    =head3 SortKey
402    
403    C<< my $key = $shelp->SortKey($fdata); >>
404    
405    Return the sort key for the specified feature data. The default is to sort by feature name,
406    floating NMPDR organisms to the top. If a full-text search is used, then the default
407    sort is by relevance followed by feature name. This sort may be overridden by the
408    search class to provide fancier functionality. This method is called by
409    B<PutFeature>, so it is only used for feature searches. A non-feature search
410    would presumably have its own sort logic.
411    
412    =over 4
413    
414    =item record
415    
416    The C<FeatureData> containing the current feature.
417    
418    =item RETURN
419    
420    Returns a key field that can be used to sort this row in among the results.
421    
422    =back
423    
424    =cut
425    
426    sub SortKey {
427        # Get the parameters.
428        my ($self, $fdata) = @_;
429        # Get the score.
430        my $retVal = $fdata->GetExtraColumn('score');
431        # Invert it to create a sort with the high score first.
432        $retVal = sprintf("%0.3f", 1 - $retVal);
433        Trace("Sort key for " . $fdata->FID() . " is $retVal.") if T(4);
434        # Return the result.
435        return $retVal;
436    }
437    
438    
439    
440  =head2 Internal Utilities  =head2 Internal Utilities
441    
442  =head3 IsCommon  =head3 IsCommon

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3