]> git.donarmstrong.com Git - biopieces.git/commitdiff
rounding up work on denoise_seq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 3 Feb 2012 09:06:53 +0000 (09:06 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 3 Feb 2012 09:06:53 +0000 (09:06 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1745 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/usearch.rb
code_ruby/test/maasha/test_seq.rb

index 1618f5023eda51fccf86dfe64e7937162fe51e51..7aa14b43c879a0d019a3012468915833b604ea79 100644 (file)
@@ -85,9 +85,9 @@ class Usearch
 
   # Method to execute ustar alignment.
   def ustar
-    @command << %Q{grep "^[SH]" #{@outfile} > #{@outfile}.sub}
-
-    execute
+    command = %Q{grep "^[SH]" #{@outfile} > #{@outfile}.sub}
+    system(command)
+    raise "Command failed: #{command}" unless $?.success?
 
     File.rename "#{@outfile}.sub", @outfile
 
@@ -199,8 +199,9 @@ class Usearch
        # The command is composed of bits from the @command variable.
        def execute
                @command.unshift "nice -n 19"
-               @command << "> /dev/null 2>&1" unless @options[:verbose]
+               @command << "--quiet" unless @options[:verbose]
                command = @command.join(" ")
+    $stderr.puts "Running command: #{command}" if @options[:verbose]
     system(command)
     raise "Command failed: #{command}" unless $?.success?
 
index 927937ec3684097c9a42cfa773dc48e832f97b3b..9a8deef34c8a443cad8c9f5817e744cda8cd0d05 100755 (executable)
@@ -538,10 +538,10 @@ class TestSeq < Test::Unit::TestCase
   end
 
   def test_Seq_mask_seq_hard_bang_returns_correctly
-    @entry.seq  = "ATCG"
-    @entry.qual = "RSTU"
+    @entry.seq  = "-ATCG"
+    @entry.qual = "RRSTU"
 
-    assert_equal("NNCG", @entry.mask_seq_hard!(20).seq)
+    assert_equal("-NNCG", @entry.mask_seq_hard!(20).seq)
   end
 
   def test_Seq_mask_seq_soft_bang_with_nil_seq_raises
@@ -558,13 +558,6 @@ class TestSeq < Test::Unit::TestCase
     assert_raise(SeqError) { @entry.mask_seq_soft!(20) }
   end
 
-  def test_Seq_mask_seq_soft_bang_returns_correctly
-    @entry.seq  = "ATCG"
-    @entry.qual = "RSTU"
-
-    assert_equal("atCG", @entry.mask_seq_soft!(20).seq)
-  end
-
   def test_Seq_mask_seq_soft_bang_with_bad_cutoff_raises
     assert_raise(SeqError) { @entry.mask_seq_soft!(-1) }
     assert_raise(SeqError) { @entry.mask_seq_soft!(41) }
@@ -577,6 +570,13 @@ class TestSeq < Test::Unit::TestCase
     assert_nothing_raised { @entry.mask_seq_soft!(0) }
     assert_nothing_raised { @entry.mask_seq_soft!(40) }
   end
+
+  def test_Seq_mask_seq_soft_bang_returns_correctly
+    @entry.seq  = "-ATCG"
+    @entry.qual = "RRSTU"
+
+    assert_equal("-atCG", @entry.mask_seq_soft!(20).seq)
+  end
 end