<s> '''<STR_LIT>''' <EOL> import os <EOL> import sys <EOL> from ngsutils . bed import BedFile , BedRegion <EOL> def usage ( ) : <EOL> print __doc__ <EOL> print """<STR_LIT>""" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def bed_clean ( bed , out = sys . stdout ) : <EOL> for region in bed : <EOL> region . score = int ( region . score ) <EOL> if region . score > <NUM_LIT:1000> : <EOL> region . score = <NUM_LIT:1000> <EOL> out . write ( '<STR_LIT>' % region ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> fname = None <EOL> for arg in sys . argv [ <NUM_LIT:1> : ] : <EOL> if arg == '<STR_LIT>' : <EOL> usage ( ) <EOL> if not fname and ( os . path . exists ( arg ) or arg == '<STR_LIT:->' ) : <EOL> fname = arg <EOL> else : <EOL> print "<STR_LIT>" % arg <EOL> usage ( ) <EOL> if not fname : <EOL> usage ( ) <EOL> bed_clean ( BedFile ( fname ) ) </s>
