]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/read_psl
refactoring of assemble_pairs
[biopieces.git] / bp_bin / read_psl
index 866b99bc3343944eadeaafd60b60ef4788ea49ea..0d7fe35e10270a0909c41fe6c06116eeef4e030d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
 
 # Copyright (C) 2007-2009 Martin A. Hansen.
 
@@ -26,6 +26,7 @@
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
+use warnings;
 use strict;
 use Maasha::Biopieces;
 use Maasha::Filesys;
@@ -57,13 +58,16 @@ if ( $options->{ 'data_in' } )
 
     $num = 1;
 
-    while ( $record = Maasha::UCSC::PSL::psl_get_entry( $data_in ) ) 
+    while ( $entry = Maasha::UCSC::PSL::psl_entry_get( $data_in ) ) 
     {
-        Maasha::Biopieces::put_record( $record, $out );
+        if ( $record = Maasha::UCSC::PSL::psl2biopiece( $entry ) )
+        {
+            Maasha::Biopieces::put_record( $record, $out );
 
-        last if $options->{ "num" } and $num == $options->{ "num" };
+            last if $options->{ "num" } and $num == $options->{ "num" };
 
-        $num++;
+            $num++;
+        }
     }
 
     close $data_in;