]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/KISS.pm
adding bzip2 support in ruby
[biopieces.git] / code_perl / Maasha / KISS.pm
index be841089e82c147c78d620ee779a0d34b10dd99c..35d21108d9b853f59dd74738278a29a9054d4fd5 100644 (file)
@@ -108,8 +108,8 @@ sub kiss_retrieve
     # within an optional interval.
 
     my ( $file,   # path to KISS file
-         $beg,    # interval begin -  OPTIONAL
-         $end,    # interval end   -  OPTIONAL
+         $beg,    # interval begin  -  OPTIONAL
+         $end,    # interval end    -  OPTIONAL
        ) = @_;
 
     # Returns a list.
@@ -123,9 +123,8 @@ sub kiss_retrieve
 
     while ( $entry = kiss_entry_get( $fh ) )
     {
-        push @entries, $entry if $entry->[ S_END ] > $beg;
-        
         last if $entry->[ S_BEG ] > $end;
+        push @entries, $entry if $entry->[ S_END ] > $beg;
     }
 
     close $fh;
@@ -710,7 +709,7 @@ sub biopiece2kiss
     $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' } || ".";