#NEWLINE# def __init__( self , inputfile , outputfile , output_format , adapter , minsize , maxsize , Nmode ) : #NEWLINE# #INDENT# self . inputfile = motives #NEWLINE# self . outputfile = outputfile #NEWLINE# self . output_format = output_format #NEWLINE# self . adapter = adapter #NEWLINE# self . minsize = int ( minsize ) #NEWLINE# self . maxsize = int ( maxsize ) #NEWLINE# self . Nmode = Nmode #NEWLINE# def motives( sequence ) : #NEWLINE# #INDENT# 'return a list of motives for perfect (6nt) or imperfect (7nt with one mismatch) search on import string module' #NEWLINE# sequencevariants = [ sequence [ 0 : 6 ] ] #NEWLINE# dicsubst = { #NEWLINE# #INDENT# 'A' : 'TGCN' , #NEWLINE# 'T' : 'AGCN' , #NEWLINE# 'G' : 'TACN' , #NEWLINE# 'C' : 'GATN' , #NEWLINE# #UNINDENT# } #NEWLINE# for pos in enumerate ( sequence [ : 6 ] ) : #NEWLINE# #INDENT# for subst in dicsubst [ pos [ 1 ] ] : #NEWLINE# #INDENT# sequencevariants . append ( ( ( sequence [ : pos [ 0 ] ] + subst ) + sequence [ ( pos [ 0 ] + 1 ) : 7 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# return sequencevariants #NEWLINE# #UNINDENT# self . adaptmotifs = motives ( self . adapter )