]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/shred_seq
refactoring of assemble_pairs
[biopieces.git] / bp_bin / shred_seq
index 5b2a886af36e0708ebf4066795e0396067eae86b..322916426e606dd11259eb6f34757486296e039d 100755 (executable)
@@ -51,7 +51,7 @@ class Seq
 
     while coverage(sum) < max_cov
       entry = self.subseq_rand(size)
-      entry.revcomp if strand == '-'
+      entry.reverse!.complement! if strand == '-'
 
       if block_given?
         yield entry
@@ -83,9 +83,9 @@ options = Biopieces.options_parse(ARGV, casts)
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each_record do |record|
-    if record.has_key? :SEQ and record[:SEQ].length >= options[:size]
-      entry      = Seq.new(record[:SEQ_NAME], record[:SEQ], record[:SCORES])
-      entry.type = 'dna'
+    if record[:SEQ] and record[:SEQ].length >= options[:size]
+      entry      = Seq.new_bp(record)
+      entry.type = :dna
 
       entry.shred(options[:size], options[:coverage]) do |subentry|
         output.puts subentry.to_bp