# http://samtools.sourceforge.net/SAM1.pdf
-require 'pp'
-
# Error class for all exceptions to do with CIGAR.
class CigarError < StandardError; end
check_cigar
end
+ # Method to convert the CIGAR string to
+ # a printable string.
def to_s
@cigar
end
# Method to check that the CIGAR string is formatted
# correctly, including hard clipping and soft clipping
- # can't be located internally.
+ # that cant be located internally.
def check_cigar
unless cigar =~ /^(\*|([0-9]+[MIDNSHPX=])+)$/
raise CigarError, "Bad cigar format: #{cigar}"