Skip to content

Instantly share code, notes, and snippets.

@maasha

maasha/error.txt Secret

Created January 21, 2015 13:44
Show Gist options
  • Save maasha/8638e14e0a7d9f5b8310 to your computer and use it in GitHub Desktop.
Save maasha/8638e14e0a7d9f5b8310 to your computer and use it in GitHub Desktop.
test BioPieces::Pipeline#usearch_global outputs correctly(TestUsearchGlobal)
/Users/maasha/install/src/biopieces/test/biopieces/commands/test_usearch_global.rb:68:in `block in <class:TestUsearchGlobal>'
<"{:SEQ=>\"atcgatcgatcgatcgatcgatcgatcgtacgacgtagct\"}{:SEQ=>\"gtgtgtagctacgatcagctagcgatcgagctatatgttt\"}{:TYPE=>\"H\", :CLUSTER=>0, :SEQ_LEN=>40, :IDENT=>100.0, :STRAND=>\"+\", :CIGAR=>\"40M\", :Q_ID=>\"1\", :S_ID=>\"test1\", :RECORD_TYPE=>\"usearch\"}{:TYPE=>\"N\", :CLUSTER=>0, :SEQ_LEN=>0, :STRAND=>\".\", :CIGAR=>\"*\", :Q_ID=>\"2\", :RECORD_TYPE=>\"usearch\"}{:one=>1, :two=>2, :three=>3}">(UTF-8) expected but was
<"{:SEQ=>\"atcgatcgatcgatcgatcgatcgatcgtacgacgtagct\"}{:SEQ=>\"gtgtgtagctacgatcagctagcgatcgagctatatgttt\"}{:TYPE=>\"N\", :CLUSTER=>0, :SEQ_LEN=>40, :STRAND=>\".\", :CIGAR=>\"*\", :Q_ID=>\"1\", :RECORD_TYPE=>\"usearch\"}{:TYPE=>\"N\", :CLUSTER=>0, :SEQ_LEN=>40, :STRAND=>\".\", :CIGAR=>\"*\", :Q_ID=>\"2\", :RECORD_TYPE=>\"usearch\"}{:one=>1, :two=>2, :three=>3}">(US-ASCII)
diff:
? {:SEQ=>"atcgatcgatcgatcgatcgatcgatcgtacgacgtagct"}{:SEQ=>"gtgtgtagctacgatcagctagcgatcgagctatatgttt"}{:TYPE=>"H", :CLUSTER=>0, :SEQ_LEN=>40, :IDENT=>100.0, :STRAND=>"+", :CIGAR=>"40M", :Q_ID=>"1", :S_ID=>"test1", :RECORD_TYPE=>"usearch"}{:TYPE=>"N", :CLUSTER=>0, :SEQ_LEN=> 0, :STRAND=>".", :CIGAR=>"*", :Q_ID=>"2", :RECORD_TYPE=>"usearch"}{:one=>1, :two=>2, :three=>3}
? N . * 4
? Encoding: UTF-8
? S ASCII
test "BioPieces::Pipeline#usearch_global outputs correctly" do
input, output = BioPieces::Stream.pipe
input2, output2 = BioPieces::Stream.pipe
output.write({one: 1, two: 2, three: 3})
output.write({SEQ: "gtgtgtagctacgatcagctagcgatcgagctatatgttt"})
output.write({SEQ: "atcgatcgatcgatcgatcgatcgatcgtacgacgtagct"})
output.close
p = BioPieces::Pipeline.new
p.usearch_global(database: @db, identity: 0.97, strand: "plus").run(input: input, output: output2)
result = input2.map { |h| h.to_s }.sort_by { |a| a.to_s }.reduce(:<<)
expected = ""
expected << %Q{{:SEQ=>"atcgatcgatcgatcgatcgatcgatcgtacgacgtagct"}}
expected << %Q{{:SEQ=>"gtgtgtagctacgatcagctagcgatcgagctatatgttt"}}
expected << %Q{{:TYPE=>"H", :CLUSTER=>0, :SEQ_LEN=>40, :IDENT=>100.0, :STRAND=>"+", :CIGAR=>"40M", :Q_ID=>"1", :S_ID=>"test1", :RECORD_TYPE=>"usearch"}}
expected << %Q{{:TYPE=>"N", :CLUSTER=>0, :SEQ_LEN=>0, :STRAND=>".", :CIGAR=>"*", :Q_ID=>"2", :RECORD_TYPE=>"usearch"}}
expected << %Q{{:one=>1, :two=>2, :three=>3}}
assert_equal(expected, result)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment