lib/parse_fasta/sequence.rb in parse_fasta-1.8.0 vs lib/parse_fasta/sequence.rb in parse_fasta-1.8.1
- old
+ new
@@ -33,10 +33,16 @@
#
# @return [Sequence] A Sequence string
#
# @example Removes whitespace
# Sequence.new "AA CC TT" #=> "AACCTT"
+ #
+ # @raise [ParseFasta::SequenceFormatError] if sequence has a '>'
def initialize(str)
+ if str.match(/>/)
+ raise ParseFasta::SequenceFormatError
+ end
+
super(str.gsub(/ +/, ""))
end
# Calculates GC content
#