]> git.donarmstrong.com Git - biopieces.git/commitdiff
made check_bed optional
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 8 Dec 2008 00:32:14 +0000 (00:32 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 8 Dec 2008 00:32:14 +0000 (00:32 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@337 74ccb610-7750-0410-82ae-013aeee3265d

code_c/Maasha/src/Makefile
code_perl/Maasha/Biopieces.pm
code_perl/Maasha/UCSC/BED.pm
code_python/Cjung/Args.pyc

index d1e8d844e0f60e26564966e73afc51e83e7ad3b2..cee84b87504966f08778d1e5428e6cea6e8a0988 100644 (file)
@@ -43,6 +43,7 @@ repeat-O-matic: repeat-O-matic.c
 clean:
        cd $(LIB_DIR) && ${MAKE} clean
        cd $(TEST_DIR) && ${MAKE} clean
+       rm bed2chrom_files
        rm bed2fixedstep
        rm bed2tag_contigs
        rm bed_sort
index 013b0319a5a2636a70220503d30448cd7c7521fd..cbd0e1f16b531913d385b88fa1282a8ee7ec646c 100644 (file)
@@ -1448,7 +1448,7 @@ sub script_read_bed
     {
         $data_in = Maasha::Common::read_open( $file );
 
-        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $data_in, $cols ) )
+        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $data_in, $cols, 1 ) )
         {
             $record = Maasha::UCSC::BED::bed2biopiece( $bed_entry );
 
@@ -2188,7 +2188,7 @@ sub script_assemble_tag_contigs
         {
             $strand = $record->{ 'STRAND' } || '+';
 
-            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols );
+            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols, 1 );
         }
     }
 
@@ -2207,7 +2207,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 ) )
+        while ( $bed_entry = Maasha::UCSC::BED::bed_entry_get( $fh_in, $cols ) )
         {
             if ( $record = Maasha::UCSC::BED::bed2biopiece( $bed_entry ) ) {
                 put_record( $record, $out );
@@ -2664,7 +2664,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 );
+            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols, 1 );
         }
     }
 
@@ -4312,7 +4312,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 );
+            Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh, $cols, 1 );
         }
 
         put_record( $record, $out ) if not $options->{ 'no_stream' };
@@ -6195,7 +6195,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 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
             }
         }
         elsif ( $record->{ "REC_TYPE" } eq "PATSCAN" and $record->{ "CHR" } )
@@ -6204,7 +6204,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 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
             }
         }
         elsif ( $record->{ "REC_TYPE" } eq "BLAST" and $record->{ "S_ID" } =~ /^chr/ )
@@ -6215,7 +6215,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 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
             }
         }
         elsif ( $record->{ "REC_TYPE" } eq "VMATCH" and $record->{ "S_ID" } =~ /^chr/i )
@@ -6224,7 +6224,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 );
+                Maasha::UCSC::BED::bed_entry_put( $entry, $fh_out, $columns, 1 );
             }
         }
 
index 9d48daaf2caca40448cbd173a7bff654105d0475..f12c8b913dc2ba73c11722da2874eeaf46733785 100644 (file)
@@ -74,9 +74,6 @@ use constant {
 };
 
 
-my $CHECK_ALL = 1;   # Global flag indicating that BED input and output is checked thoroughly.
-
-
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BED format <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
@@ -123,7 +120,8 @@ sub bed_entry_get
     # Reads a BED entry given a filehandle.
 
     my ( $fh,     # file handle
-         $cols,   # columns to read - OPTIONAL (3,4,5,6,8,9 or 12)
+         $cols,   # columns to read               - OPTIONAL (3,4,5,6,8,9 or 12)
+         $check,  # check integrity of BED values - OPTIONAL
        ) = @_;
 
     # Returns a list.
@@ -144,7 +142,7 @@ sub bed_entry_get
 
     pop @entry if scalar @entry > $cols;
 
-    bed_entry_check( \@entry ) if $CHECK_ALL;
+    bed_entry_check( \@entry ) if $check;
 
     return wantarray ? @entry : \@entry;
 }
@@ -159,6 +157,7 @@ sub bed_entry_put
     my ( $entry,   # list
          $fh,      # file handle                   - OPTIONAL
          $cols,    # number of columns in BED file - OPTIONAL (3,4,5,6,8,9 or 12)
+         $check,   # check integrity of BED values - OPTIONAL
        ) = @_;
 
     # Returns nothing.
@@ -167,7 +166,7 @@ sub bed_entry_put
         @{ $entry } = @{ $entry }[ 0 .. $cols - 1 ];
     }
 
-    bed_entry_check( $entry ) if $CHECK_ALL;
+    bed_entry_check( $entry ) if $check;
 
     $fh = \*STDOUT if not defined $fh;
 
index 8b121787fa51f401453d056b37e17c49ecd4e740..cce3509a33c7afeff94d9d5366385e2d0fbe1b33 100644 (file)
Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ