#NEWLINE# def reinstate( c , rc , trim5 = False , trim3 = False , both = True ) : #NEWLINE# #INDENT# ( cstart , cend ) = ( c . start , c . end ) #NEWLINE# if ( ( ( trim5 or both ) and ( c . strand == '+' ) ) or ( ( trim3 or both ) and ( c . strand == '-' ) ) ) : #NEWLINE# #INDENT# c . start = rc . start #NEWLINE# #UNINDENT# if ( ( ( trim3 or cend ) and ( c . strand == '+' ) ) or ( ( trim5 or both ) and ( c . strand == '-' ) ) ) : #NEWLINE# #INDENT# c . end = rc . end #NEWLINE# #UNINDENT# if ( ( c . start != cstart ) or ( c . end != cend ) ) : #NEWLINE# #INDENT# ( ( print >> sys . stderr ) , c . id , 'reinstated [{0}, {1}] => [{2}, {3}]' . format ( cstart , cend , c . start , c . end ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( ( print >> sys . stderr ) , c . id , 'no change' )