#NEWLINE# def scanadapt( self , adaptmotives = [ ] , sequence = '' , qscore = '' ) : #NEWLINE# #INDENT# 'scans sequence for adapter motives' #NEWLINE# match_position = sequence . rfind ( adaptmotives [ 0 ] ) #NEWLINE# if ( match_position != ( - 1 ) ) : #NEWLINE# #INDENT# return ( sequence [ : match_position ] , qscore [ : match_position ] ) #NEWLINE# #UNINDENT# for motif in adaptmotives [ 1 : ] : #NEWLINE# #INDENT# match_position = sequence . rfind ( motif ) #NEWLINE# if ( match_position != ( - 1 ) ) : #NEWLINE# #INDENT# return ( sequence [ : match_position ] , qscore [ : match_position ] ) #NEWLINE# #UNINDENT# #UNINDENT# return ( sequence , qscore )