[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.14, Thu Apr 19 00:07:02 2007 UTC revision 1.15, Thu May 17 23:44:21 2007 UTC
# Line 398  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.14  
changed lines
  Added in v.1.15

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3