From: martinahansen Date: Mon, 8 Dec 2008 00:32:14 +0000 (+0000) Subject: made check_bed optional X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f727dc81703ae24a5667ebb9922502f2b127104a;p=biopieces.git made check_bed optional git-svn-id: http://biopieces.googlecode.com/svn/trunk@337 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_c/Maasha/src/Makefile b/code_c/Maasha/src/Makefile index d1e8d84..cee84b8 100644 --- a/code_c/Maasha/src/Makefile +++ b/code_c/Maasha/src/Makefile @@ -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 diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index 013b031..cbd0e1f 100644 --- a/code_perl/Maasha/Biopieces.pm +++ b/code_perl/Maasha/Biopieces.pm @@ -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 ); } } diff --git a/code_perl/Maasha/UCSC/BED.pm b/code_perl/Maasha/UCSC/BED.pm index 9d48daa..f12c8b9 100644 --- a/code_perl/Maasha/UCSC/BED.pm +++ b/code_perl/Maasha/UCSC/BED.pm @@ -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; diff --git a/code_python/Cjung/Args.pyc b/code_python/Cjung/Args.pyc index 8b12178..cce3509 100644 Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ