]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/UCSC/BED.pm
added --check to a number of Biopieces
[biopieces.git] / code_perl / Maasha / UCSC / BED.pm
index f12c8b913dc2ba73c11722da2874eeaf46733785..2fde7c941177d2e4f80518ba8a7d64d38a94082a 100644 (file)
@@ -215,13 +215,13 @@ sub bed_entry_check
         Maasha::Common::error( qq(Bad BED entry - chromEnd must be greater than chromStart - not "$bed->[ chromStart ] > $bed->[ chromEnd ]") );
     }
 
-    return if @{ $bed } == 3;
+    return if $cols == 3;
 
     if ( $bed->[ name ] =~ /\s/ ) {
         Maasha::Common::error( qq(Bad BED entry - no white space allowed in name field: "$bed->[ name ]") );
     }
 
-    return if @{ $bed } == 4;
+    return if $cols == 4;
 
     if ( $bed->[ score ] =~ /\D/ ) {
         Maasha::Common::error( qq(Bad BED entry - score must be a whole number - not "$bed->[ score ]") );
@@ -232,13 +232,13 @@ sub bed_entry_check
         Maasha::Common::error( qq(Bad BED entry - score must be between 0 and 1000 - not "$bed->[ score ]") );
     }
 
-    return if @{ $bed } == 5;
+    return if $cols == 5;
 
     if ( $bed->[ strand ] ne '+' and $bed->[ strand ] ne '-' ) {
         Maasha::Common::error( qq(Bad BED entry - strand must be + or - not "$bed->[ strand ]") );
     }
 
-    return if @{ $bed } == 6;
+    return if $cols == 6;
 
     if ( $bed->[ thickStart ] =~ /\D/ ) {
         Maasha::Common::error( qq(Bad BED entry - thickStart must be a whole number - not "$bed->[ thickStart ]") );
@@ -268,13 +268,13 @@ sub bed_entry_check
         Maasha::Common::error( qq(Bad BED entry - thickEnd must be less than chromEnd - not "$bed->[ thickEnd ] > $bed->[ chromEnd ]") );
     }
 
-    return if @{ $bed } == 8;
+    return if $cols == 8;
 
     if ( $bed->[ itemRgb ] !~ /^(0|\d{1,3},\d{1,3},\d{1,3},?)$/ ) {
         Maasha::Common::error( qq(Bad BED entry - itemRgb must be 0 or in the form of 255,0,0 - not "$bed->[ itemRgb ]") );
     }
 
-    return if @{ $bed } == 9;
+    return if $cols == 9;
 
     if ( $bed->[ blockCount ] =~ /\D/ ) {
         Maasha::Common::error( qq(Bad BED entry - blockCount must be a whole number - not "$bed->[ blockCount ]") );