]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Biopieces.pm
added --check to a number of Biopieces
[biopieces.git] / code_perl / Maasha / Biopieces.pm
index cbd0e1f16b531913d385b88fa1282a8ee7ec646c..161f73d16eb39daa0d0f388f1082240bc10798ac 100644 (file)
@@ -328,6 +328,7 @@ sub get_options
             data_in|i=s
             cols|c=s
             num|n=s
+            check|C
         );
     }
     elsif ( $script eq "read_fixedstep" )
@@ -428,6 +429,18 @@ sub get_options
             num|n=s
         );
     }
+    elsif ( $script eq "assemble_tag_contigs" )
+    {
+        @options = qw(
+            check|C
+        );
+    }
+    elsif ( $script eq "calc_fixedstep" )
+    {
+        @options = qw(
+            check|C
+        );
+    }
     elsif ( $script eq "format_genome" )
     {
         @options = qw(
@@ -672,6 +685,7 @@ sub get_options
     {
         @options = qw(
             cols|c=s
+            check|C
             no_stream|x
             data_out|o=s
             compress|Z
@@ -988,7 +1002,7 @@ sub get_options
             use_score|u
             visibility|V=s
             color|c=s
-            chunk_size|C=s
+            check|C
         );
     }
 
@@ -1037,7 +1051,7 @@ sub get_options
 
     # print STDERR Dumper( \%options );
 
-    $real = "beg|end|word_size|wrap|chunk_size|tile_size|len|prefix_length|mismatches|offset|num|skip|cpus|window_size|step_size";
+    $real = "beg|end|word_size|wrap|tile_size|len|prefix_length|mismatches|offset|num|skip|cpus|window_size|step_size";
 
     foreach $opt ( keys %options )
     {
@@ -1448,7 +1462,7 @@ sub script_read_bed
     {
         $data_in = Maasha::Common::read_open( $file );
 
-        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $data_in, $cols, 1 ) )
+        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $data_in, $cols, $options->{ 'check' } ) )
         {
             $record = Maasha::UCSC::BED::bed2biopiece( $bed_entry );
 
@@ -2188,7 +2202,7 @@ sub script_assemble_tag_contigs
         {
             $strand = $record->{ 'STRAND' } || '+';
 
-            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols, 1 );
+            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols, $options->{ 'check' } );
         }
     }
 
@@ -2207,7 +2221,7 @@ sub script_assemble_tag_contigs
 
         $fh_in = Maasha::Filesys::file_read_open( $tag_file );
 
-        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $fh_in, $cols ) )
+        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $fh_in, $cols, $options->{ 'check' } ) )
         {
             if ( $record = Maasha::UCSC::BED::bed2biopiece( $bed_entry ) ) {
                 put_record( $record, $out );
@@ -2664,7 +2678,7 @@ sub script_calc_fixedstep
     while ( $record = get_record( $in ) ) 
     {
         if ( $bed_entry = Maasha::UCSC::BED::biopiece2bed( $record, $cols ) ) {
-            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols, 1 );
+            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols, $options->{ 'check' } );
         }
     }
 
@@ -4312,7 +4326,7 @@ sub script_write_bed
         $record = Maasha::UCSC::psl2record( $record ) if $record->{ 'tBaseInsert' }; # Dirty addition to allow Affy data from MySQL to be dumped
 
         if ( $bed_entry = Maasha::UCSC::BED::biopiece2bed( $record, $cols ) ) {
-            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh, $cols, 1 );
+            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh, $cols, $options->{ 'check' } );
         }
 
         put_record( $record, $out ) if not $options->{ 'no_stream' };
@@ -6195,7 +6209,7 @@ sub script_upload_to_ucsc
             $columns = $record->{ "BED_COLS" };
 
             if ( $entry = Maasha::UCSC::BED::biopiece2bed( $record, $columns ) ) {
-                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, $options->{ 'check' } );
             }
         }
         elsif ( $record->{ "REC_TYPE" } eq "PATSCAN" and $record->{ "CHR" } )
@@ -6204,7 +6218,7 @@ sub script_upload_to_ucsc
             $columns = 6;
 
             if ( $entry = Maasha::UCSC::BED::biopiece2bed( $record, $columns ) ) {
-                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, $options->{ 'check' } );
             }
         }
         elsif ( $record->{ "REC_TYPE" } eq "BLAST" and $record->{ "S_ID" } =~ /^chr/ )
@@ -6215,7 +6229,7 @@ sub script_upload_to_ucsc
             $record->{ "SCORE" } = $record->{ "BIT_SCORE" } * 1000;
 
             if ( $entry = Maasha::UCSC::BED::biopiece2bed( $record, $columns ) ) {
-                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, $options->{ 'check' } );
             }
         }
         elsif ( $record->{ "REC_TYPE" } eq "VMATCH" and $record->{ "S_ID" } =~ /^chr/i )
@@ -6224,7 +6238,7 @@ sub script_upload_to_ucsc
             $columns = 6;
 
             if ( $entry = Maasha::UCSC::BED::biopiece2bed( $record, $columns ) ) {
-                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, $options->{ 'check' } );
             }
         }