From f727dc81703ae24a5667ebb9922502f2b127104a Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 8 Dec 2008 00:32:14 +0000 Subject: [PATCH] made check_bed optional git-svn-id: http://biopieces.googlecode.com/svn/trunk@337 74ccb610-7750-0410-82ae-013aeee3265d --- code_c/Maasha/src/Makefile | 1 + code_perl/Maasha/Biopieces.pm | 18 +++++++++--------- code_perl/Maasha/UCSC/BED.pm | 11 +++++------ code_python/Cjung/Args.pyc | Bin 5025 -> 6063 bytes 4 files changed, 15 insertions(+), 15 deletions(-) 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 8b121787fa51f401453d056b37e17c49ecd4e740..cce3509a33c7afeff94d9d5366385e2d0fbe1b33 100644 GIT binary patch delta 2170 zcmcIl!DFf^dPLJKaNfyNM zARd%}&|e_AE0U`o{0=`MH-A8@s&{r~mqj9I4x5_p>Zb8)g0w~g736P9r4!77@v+mTaX2cftFG12VGuxWe)GJS+qWE;5n zux!zfybe}>Nst6WyT@aU9A;vOPs#mChu^x*q^KHvIU$FTDhohB>Z98gC zuTF1g5{_9S{sn(q{yb*N0~TBm2%^NQ2^K~qFS?O|pvGvA%YlK71R8A)?9dugB`eEP zh2700V*49Ha6$P=B}_#Xp9SNQ;_0ShB2+O?Mk<(N8cV+3S!sm{^j!UU%+r`Pn5;MS zJNFFKZn=8kC{KT_CI(QGK^D_$)QAP{X@DSGT+lu#(&kAMovHJ{09aDi!0jFdDYy^? z)Dpc>o^Be2iV@E!ZYUq&ZxphhEY(=9*sL|mVVLOewTF(H)QdCspA-oSR(X$(sQ{wJ z-a1ih=?^n-F(&o#%!B`!r;^{P!xyu5>CTlpF~2*w1Wm|bCI{$9ND#ya6_z3}67o zs`!8j03V1y!9pVb{-q_Zt$63Q%G-p3?S&$VlO}I5yl&7)*`9m#+DXU=ATSq{6O(i2-nNDg?nUye2Rt23&9mz(@a$EO%~c z3}ODh5Fl8F2k=sc#1RKdPTNeaJuV``JvyQhZU50kiE~wOSx6<~lEZ+Q_h*r8hDwYaC`(y3Ap@(JOz# zbne)@s59j%l$T`7Nm{CDlBrC)DxE^L&4z0yT}I|Q)r8u#(MlOBSq%Y8pp57t5z+@;Hdwi(A#ONUI}syj7iSmHFM2z>VZO7j+ouRp%<> zQ<-FpU_MIi4g%}qBol~Y51VC6HgaxL)OL$JG))!yWbsXVAVnV{wqJGlK2UAd9<{^( z9VNf$w-~}JPVAR z2H{|ohV=l1Z|kkWkG&by}Jbu zofAL2rxa$fHP83_s(;!K!A9P?lz976I*?DwhK`#lOmr({te2#cqMr8chDp|IwOX~-;fl|L-&$P7qO zJSs6sVh3K-bi`SLhkZ%8ri>+;l8xpFF0oNc!Ec$l$VkcMi3t)8j)>{Y@OcaC+Qb5H zNOZO!F$aN`nBm4cljP;&L$hXWwqt6r55Z561W-fabCT>2+7M$HgDT|_& Kpi(>^8v6~zz57f6 -- 2.39.5