@seq = seq
@type = type
@qual = qual
+
+ if @qual
+ raise SeqError, "Sequence length and score length mismatch: #{@seq.length} != #{@qual.length}" if @seq.length != @qual.length
+ end
end
# Method that guesses and returns the sequence type
@entry = Seq.new
end
+ test "Seq.new with differnet length SEQ and SCORES raises" do
+ assert_raise(SeqError) { Seq.new("test", "ATCG", "dna", "hhh") }
+ end
+
test "Seq.new_bp returns correctly" do
record = {:SEQ_NAME => "test", :SEQ => "ATCG", :SEQ_TYPE => :dna, :SCORES => "hhhh"}
seq = Seq.new_bp(record)