<s> '''<STR_LIT>''' <EOL> class Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __str__ ( self ) : <EOL> return str ( self . message ) <EOL> def _get_message ( self , message ) : <EOL> return self . _message <EOL> def _set_message ( self , message ) : <EOL> self . _message = message <EOL> message = property ( _get_message , _set_message ) <EOL> class ParsingError ( Error ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message , line = None ) : <EOL> if line : <EOL> self . message = message + "<STR_LIT>" + line <EOL> else : <EOL> self . message = message <EOL> class Match : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . mName = None <EOL> self . contig = None <EOL> self . start = <NUM_LIT:0> <EOL> self . strand = "<STR_LIT:+>" <EOL> self . mPairInsert = <NUM_LIT:0> <EOL> self . mPairFlag = <NUM_LIT:0> <EOL> self . mQuality = <NUM_LIT:0> <EOL> self . mQualitySingle = <NUM_LIT:0> <EOL> self . mQualityAlternative = <NUM_LIT:0> <EOL> self . mNMismatches = <NUM_LIT:0> <EOL> self . mMismatchQuality = <NUM_LIT:0> <EOL> self . mNMismatch0 = <NUM_LIT:0> <EOL> self . mNMismatch1 = <NUM_LIT:0> <EOL> self . mLength = <NUM_LIT:0> <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT:\t>" . join ( map ( str , ( self . mName , <EOL> self . contig , <EOL> self . start + <NUM_LIT:1> , <EOL> self . strand , <EOL> self . mPairInsert , <EOL> self . mPairFlag , <EOL> self . mQuality , <EOL> self . mQualitySingle , <EOL> self . mQualityAlternative , <EOL> self . mNMismatches , <EOL> self . mMismatchQuality , <EOL> self . mNMismatch0 , <EOL> self . mNMismatch1 , <EOL> self . mLength ) ) ) <EOL> def fromTable ( self , data ) : <EOL> if len ( data ) == <NUM_LIT> : <EOL> ( self . mName , <EOL> self . contig , <EOL> self . start , <EOL> self . strand , <EOL> self . mPairInsert , <EOL> self . mPairFlag , <EOL> self . mQuality , <EOL> self . mQualitySingle , <EOL> self . mQualityAlternative , <EOL> self . mNMismatches , <EOL> self . mMismatchQuality , <EOL> self . mNMismatches0 , <EOL> self . mNMismatches1 , <EOL> self . mLength ) = data <EOL> ( self . start , <EOL> self . mPairInsert , <EOL> self . mPairFlag , <EOL> self . mQuality , <EOL> self . mQualitySingle , <EOL> self . mQualityAlternative , <EOL> self . mNMismatches , <EOL> self . mMismatchQuality , <EOL> self . mNMismatches0 , <EOL> self . mNMismatches1 , <EOL> self . mLength ) = map ( int , ( self . start , <EOL> self . mPairInsert , <EOL> self . mPairFlag , <EOL> self . mQuality , <EOL> self . mQualitySingle , <EOL> self . mQualityAlternative , <EOL> self . mNMismatches , <EOL> self . mMismatchQuality , <EOL> self . mNMismatches0 , <EOL> self . mNMismatches1 , <EOL> self . mLength ) ) <EOL> self . start -= <NUM_LIT:1> <EOL> def iterator ( infile ) : <EOL> """<STR_LIT>""" <EOL> while <NUM_LIT:1> : <EOL> line = infile . readline ( ) <EOL> if not line : <EOL> raise StopIteration <EOL> if line [ <NUM_LIT:0> ] == "<STR_LIT:#>" : <EOL> continue <EOL> if line . startswith ( "<STR_LIT>" ) : <EOL> continue <EOL> match = Match ( ) <EOL> match . fromTable ( line [ : - <NUM_LIT:1> ] . split ( ) ) <EOL> yield match </s>
