# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-require 'biopieces'
-
-ILLUMINA_BASE = 64
+require 'maasha/biopieces'
+require 'maasha/seq'
# Expading class Hash with possibly evil monkey patch.
class Hash
def scores2dec!
if self.has_key? :SCORES
self[:SCORES].gsub! /./ do |score|
- score = (score.ord - ILLUMINA_BASE).to_s + ";"
+ score = (score.ord - Seq::SCORE_BASE).to_s + ";"
end
self[:SCORES].chomp! ";"
end
end
-casts = []
-
-bp = Biopieces.new
+options = Biopieces.options_parse(ARGV)
-options = bp.parse(ARGV, casts)
-
-bp.each_record do |record|
- bp.puts record.scores2dec!
+Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
+ input.each_record do |record|
+ output.puts record.scores2dec!
+ end
end