]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/read_tab
refactoring of assemble_pairs
[biopieces.git] / bp_bin / read_tab
index 3c782303d101c2da9d14afaebab7dac2f9857119..a8dede9d9ce979fb12c20718de8c993b1027cf2b 100755 (executable)
@@ -28,6 +28,7 @@
 
 use warnings;
 use strict;
+use Data::Dumper;
 use Maasha::Filesys;
 use Maasha::Biopieces;
 
@@ -64,15 +65,24 @@ if ( $options->{ 'data_in' } )
 
     while ( $line = <$data_in> ) 
     {
+        chomp $line;
+
         if ( $skip )
         {
             $skip--;
             next;
         }
 
-        next if $line =~ /^#|^$/;  # skip comment lines beginning with # and skip empty lines.
+        next if $line =~ /^$/;  # skip empty lines.
 
-        chomp $line;
+        if ( $line =~ /^#.+/ and not defined $options->{ 'keys' } )
+        {
+            $line = substr $line, 1;
+
+            $options->{ 'keys' } = [ split /$options->{'delimit'}/, $line ];
+
+            next;
+        }
 
         undef $record;
         undef @fields2;