- # Initialize a sequence object with the following arguments:
- # - seq_name: Name of the sequence.
- # - seq: The sequence.
- # - type: The sequence type - DNA, RNA, or protein
- # - qual: An Illumina type quality scores string.
- def initialize(seq_name = nil, seq = nil, type = nil, qual = nil)
- @seq_name = seq_name
- @seq = seq
- @type = type
- @qual = qual
+ # Initialize a sequence object with the following options:
+ # - :seq_name Name of the sequence.
+ # - :seq The sequence.
+ # - :type The sequence type - DNA, RNA, or protein
+ # - :qual An Illumina type quality scores string.
+ def initialize(options = {})
+ @seq_name = options[:seq_name]
+ @seq = options[:seq]
+ @type = options[:type]
+ @qual = options[:qual]
+
+ if @qual and @seq.length != @qual.length
+ raise SeqError, "Sequence length and score length mismatch: #{@seq.length} != #{@qual.length}"
+ end