From: martinahansen Date: Wed, 24 Aug 2011 21:03:15 +0000 (+0000) Subject: worked on unit tests for sam.rb X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=67a55ed9c6cd5c4ad11adb68ae18949cffcd8f59;p=biopieces.git worked on unit tests for sam.rb git-svn-id: http://biopieces.googlecode.com/svn/trunk@1499 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_ruby/lib/maasha/sam.rb b/code_ruby/lib/maasha/sam.rb index 92b8d95..0161cd7 100644 --- a/code_ruby/lib/maasha/sam.rb +++ b/code_ruby/lib/maasha/sam.rb @@ -318,6 +318,11 @@ class Sam < Filesys raise SamError, "Bad cigar with internal H: #{cigar}" end + # Check cigar soft clipping only at ends or H. + if cigar.gsub(/^[0-9]+H|[0-9]+H$/, "").gsub(/^[0-9]+S|[0-9]+S$/, "").match('S') + raise SamError, "Bad cigar with internal S: #{cigar}" + end + # Check cigar length matches sequence length. unless cigar == '*' or seq == '*' cigar_len = 0