}
+sub kiss_retrieve
+{
+ # Martin A. Hansen, February 2010.
+
+ # Retrieves KISS entries from a given sorted KISS file
+ # within an optional interval.
+
+ my ( $file, # path to KISS file
+ $beg, # interval begin - OPTIONAL
+ $end, # interval end - OPTIONAL
+ ) = @_;
+
+ # Returns a list.
+
+ my ( $fh, $entry, @entries );
+
+ $beg ||= 0;
+ $end ||= 999999999;
+
+ $fh = Maasha::Filesys::file_read_open( $file );
+
+ while ( $entry = kiss_entry_get( $fh ) )
+ {
+ last if $entry->[ S_BEG ] > $end;
+ push @entries, $entry if $entry->[ S_END ] > $beg;
+ }
+
+ close $fh;
+
+ return wantarray ? @entries : \@entries;
+}
+
+
sub kiss_entry_parse
{
# Martin A. Hansen, December 2009.
$entry->[ S_BEG ] = $record->{ 'S_BEG' };
$entry->[ S_END ] = $record->{ 'S_END' };
$entry->[ Q_ID ] = $record->{ 'Q_ID' } || ".";
- $entry->[ SCORE ] = $record->{ 'SCORE' } || $record->{ 'BIT_SCORE' } || ".";
+ $entry->[ SCORE ] = $record->{ 'SCORE' } || $record->{ 'BIT_SCORE' } || $record->{ 'ID' } || ".";
$entry->[ STRAND ] = $record->{ 'STRAND' } || ".";
$entry->[ HITS ] = $record->{ 'HITS' } || ".";
$entry->[ ALIGN ] = $record->{ 'ALIGN' } || $record->{ 'DESCRIPTOR' } || ".";
$entry->[ BLOCK_COUNT ] = $record->{ 'BLOCK_COUNT' } || ".";
- $entry->[ BLOCK_BEGS ] = $record->{ 'BLOCK_BEGS' } || ".";
+ $entry->[ BLOCK_BEGS ] = $record->{ 'BLOCK_BEGS' } || $record->{ 'Q_BEGS' } || ".";
$entry->[ BLOCK_LENS ] = $record->{ 'BLOCK_LENS' } || ".";
$entry->[ BLOCK_TYPE ] = $record->{ 'BLOCK_TYPE' } || ".";