]> git.donarmstrong.com Git - biopieces.git/commitdiff
upgraded scores_to_dec
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 12 Oct 2010 15:00:07 +0000 (15:00 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 12 Oct 2010 15:00:07 +0000 (15:00 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1114 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/scores_to_dec
bp_test/out/scores_to_dec.out.2 [deleted file]
bp_test/out/scores_to_dec.out.3 [deleted file]
bp_test/test/test_scores_to_dec

index 9c94454be65b7028b20f1f2113fb086b37db1e2a..ecf214848923f7ff08d149dc38e83ad363f42b1b 100755 (executable)
 
 require 'biopieces'
 
+ILLUMINA_BASE = 64
+
 # Expading class Hash with possibly evil monkey patch.
 class Hash
   # Method to convert scores from ASCII encode string to
   # a semi-colon seperated string of decimal values.
-  def scores2dec!(base)
+  def scores2dec!
     if self.has_key? :SCORES
       self[:SCORES].gsub! /./ do |score|
-        score = (score.ord - base).to_s + ";"
+        score = (score.ord - ILLUMINA_BASE).to_s + ";"
       end
 
       self[:SCORES].chomp! ";"
@@ -49,14 +51,13 @@ class Hash
 end
 
 casts = []
-casts << {:long=>'base', :short=>'b', :type=>'uint', :mandatory=>false, :default=>64, :allowed=>"33,59,64", :disallowed=>nil}
 
 bp = Biopieces.new
 
 options = bp.parse(ARGV, casts)
 
 bp.each_record do |record|
-  bp.puts record.scores2dec!(options[:base])
+  bp.puts record.scores2dec!
 end
 
 
diff --git a/bp_test/out/scores_to_dec.out.2 b/bp_test/out/scores_to_dec.out.2
deleted file mode 100644 (file)
index 00f19b6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-SCORES: 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93
----
diff --git a/bp_test/out/scores_to_dec.out.3 b/bp_test/out/scores_to_dec.out.3
deleted file mode 100644 (file)
index c192097..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-SCORES: -26;-25;-24;-23;-22;-21;-20;-19;-18;-17;-16;-15;-14;-13;-12;-11;-10;-9;-8;-7;-6;-5;-4;-3;-2;-1;0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67
----
index d4e7076a992d7b40a6b5b76bdbebddb36612a8cd..61c570925c960531a3e4b24eb994deff0d49ef25 100755 (executable)
@@ -5,11 +5,3 @@ source "$BP_DIR/bp_test/lib/test.sh"
 run "$bp -I $in -O $tmp"
 assert_no_diff $tmp $out.1
 clean
-
-run "$bp -I $in -b 33 -O $tmp"
-assert_no_diff $tmp $out.2
-clean
-
-run "$bp -I $in -b 59 -O $tmp"
-assert_no_diff $tmp $out.3
-clean