]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/clip_adaptor
refactor subseq to Seq#[]
[biopieces.git] / bp_bin / clip_adaptor
index 1e722b28ba8f64c322006e566d61c00681bb70b9..1bf6bf5240a61f374ec4ac9bed8d7e6e51aa001f 100755 (executable)
@@ -42,12 +42,12 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
       entry = Seq.new_bp(record)
 
       if record[:ADAPTOR_POS_RIGHT]
-        entry.subseq!(0, record[:ADAPTOR_POS_RIGHT].to_i)
+        entry = entry[0 ... record[:ADAPTOR_POS_RIGHT].to_i]
       end
 
       if record[:ADAPTOR_POS_LEFT]
         if record[:ADAPTOR_POS_LEFT].to_i + record[:ADAPTOR_LEN_LEFT].to_i < entry.length
-          entry.subseq!(record[:ADAPTOR_POS_LEFT].to_i + record[:ADAPTOR_LEN_LEFT].to_i)
+          entry = entry[record[:ADAPTOR_POS_LEFT].to_i + record[:ADAPTOR_LEN_LEFT].to_i .. -1]
         end
       end