# 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
# 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?
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
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) }
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