]> git.donarmstrong.com Git - biopieces.git/commitdiff
add ustar method to usearch.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 31 Jan 2012 10:55:06 +0000 (10:55 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 31 Jan 2012 10:55:06 +0000 (10:55 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1737 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/usearch.rb

index 129cfced4fafcf8ebf7c704fc399d14b5196211f..9f09751bc2900069a0025416c8abcbcf5fc4cc75 100644 (file)
@@ -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