From: martinahansen Date: Tue, 31 Jan 2012 10:55:06 +0000 (+0000) Subject: add ustar method to usearch.rb X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b573d2ab7a95ff03226d7f7851173274640061bb;p=biopieces.git add ustar method to usearch.rb git-svn-id: http://biopieces.googlecode.com/svn/trunk@1737 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_ruby/lib/maasha/usearch.rb b/code_ruby/lib/maasha/usearch.rb index 129cfce..9f09751 100644 --- a/code_ruby/lib/maasha/usearch.rb +++ b/code_ruby/lib/maasha/usearch.rb @@ -83,6 +83,25 @@ class Usearch execute end + # Method to execute ustar alignment. + def ustar + @command << %Q{grep "^[SH]" #{@outfile} > #{@outfile}.sub} + + execute + + File.rename "#{@outfile}.sub", @outfile + + @command << "usearch --uc2fastax #{@outfile} --input #{@infile} --output #{@infile}.sub" + + execute + + @command << "usearch --staralign #{@infile}.sub --output #{@outfile}" + + execute + + File.delete "#{@infile}.sub" + end + # Method to parse a Uclust .uc file and for each line of data # yield a Biopiece record. def each_cluster