From: martinahansen Date: Mon, 13 Jan 2014 09:39:43 +0000 (+0000) Subject: exchanged subseq with seq[] X-Git-Url: https://git.donarmstrong.com/?p=biopieces.git;a=commitdiff_plain;h=29d03f83dfadfdb5f856cac227c5fbf0b3180761 exchanged subseq with seq[] git-svn-id: http://biopieces.googlecode.com/svn/trunk@2285 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_ruby/lib/maasha/seq/trim.rb b/code_ruby/lib/maasha/seq/trim.rb index 2be3e56..cc9b549 100644 --- a/code_ruby/lib/maasha/seq/trim.rb +++ b/code_ruby/lib/maasha/seq/trim.rb @@ -40,7 +40,7 @@ module Trim pos = trim_right_pos_c(self.qual, self.length, min_qual, min_len, Seq::SCORE_BASE) - self.subseq(0, pos) + self[0, pos] end # Method to progressively trim a Seq object sequence from the right end until @@ -50,7 +50,10 @@ module Trim pos = trim_right_pos_c(self.qual, self.length, min_qual, min_len, Seq::SCORE_BASE) - self.subseq!(0, pos) + self.seq = self.seq[0, pos] + self.qual = self.qual[0, pos] if self.qual + + self end # Method to progressively trim a Seq object sequence from the left end until @@ -60,7 +63,7 @@ module Trim pos = trim_left_pos_c(self.qual, self.length, min_qual, min_len, Seq::SCORE_BASE) - self.subseq(pos) + self[pos .. -1] end # Method to progressively trim a Seq object sequence from the left end until @@ -70,7 +73,10 @@ module Trim pos = trim_left_pos_c(self.qual, self.length, min_qual, min_len, Seq::SCORE_BASE) - self.subseq!(pos) + self.seq = self.seq[pos .. -1] + self.qual = self.qual[pos .. -1] if self.qual + + self end # Method to progressively trim a Seq object sequence from both ends until a @@ -83,7 +89,7 @@ module Trim pos_left = pos_right if pos_left > pos_right - self.subseq(pos_left, pos_right - pos_left) + self[pos_left .. pos_right - 1] end # Method to progressively trim a Seq object sequence from both ends until a @@ -96,7 +102,10 @@ module Trim pos_left = pos_right if pos_left > pos_right - self.subseq!(pos_left, pos_right - pos_left) + self.seq = self.seq[pos_left .. pos_right - 1] + self.qual = self.qual[pos_left .. pos_right - 1] if self.qual + + self end # Method to locate a pattern in a sequence and trim all sequence to the left