#NEWLINE# def getPeakShift( infile ) : #NEWLINE# #INDENT# 'get peak shift for filename infile (.macs output file).\n\n    returns None if no shift found' #NEWLINE# shift = None #NEWLINE# with open ( infile , 'r' ) as ins : #NEWLINE# #INDENT# rx = re . compile ( '#2   d: (\\d+)' ) #NEWLINE# for line in ins : #NEWLINE# #INDENT# x = rx . search ( line ) #NEWLINE# if x : #NEWLINE# #INDENT# shift = int ( x . groups ( ) [ 0 ] ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return line