Table of Contents


Search Helper Feature Data Object

Introduction

This is the base class for objects used by the search helpers that store feature data. For ordinary feature handling this method is adequate; however, if the features are to be returned via a filtered query, the FeatureQuery class is better.

shelp

Parent search helper object.

sprout

Sprout object for accessing the database.

extraCols

Recommended extra columns to use for PutFeature.

featureData

ERDBObject for the current feature.

Public Methods

new

my $fdata = FeatureData->new($shelp);

Construct a new FeatureData object for a specified search helper.

shelp

Search helper being serviced by this feature data object.

FID

my $fid = $fdata->FID();

Return the ID of the current feature.

ExtraCols

my $extraCols = $fdata->ExtraCols();

Return the extra column hash for the current feature. The hash is returned as a reference.

Feature

my $featureData = $fdata->Feature();

Return the current feature data. The feature data is returned as a ERDBObject.

AddExtraColumns

$fdata->AddExtraColumns(%nameValuePairs);

Add extra columns to the extra column cache. Extra columns appear in the search results output. The pairs can be coded in hash notation.

    $fdata->AddExtraColumns(evidence => $evidenceCode, score => $sc);
nameValuePairs

A hash mapping extra column names to extra column values. The names should be suitable for column headings and the values must be fully-formatted HTML.

GetExtraColumn

my $value = $fdata->GetExtraColumn($colName);

Return the value of the named extra column. The extra column should have been created by a preceding call to AddExtraColumns. If not, then the column value will be an empty string.

colName

Name of the desired extra column.

RETURN

Returns the value of the named column as taken from the extra columns hash, or a null string if the column is not present.

Helper

my $shelp = $fdata->Helper();

Return this feature data object's parent search helper.

DB

my $sprout = $fdata->DB();

Return the Sprout datbase relevant to this feature data object.

Store

$fdata->Store($record);

Store a feature in this feature data object.

record

A ERDBObject containing the feature data.

SortKey

my $key = $fquery->SortKey($shelp, $group);

Return the sort key for the current feature. The sort key floats NMPDR organisms to the top. If a keyword search is in progress, then the search relevance will be in the feature record, and this becomes the second criterion. Finally, the NMPDR group name is used.

shelp

Current search helper object.

group

Name of the NMPDR group containing this feature.

RETURN

Returns a string that can be used to sort the specified feature into the correct position.