<s> '''<STR_LIT>''' <EOL> import sys <EOL> import CGAT . Experiment as E <EOL> import CGAT . IOTools as IOTools <EOL> import CGAT . Fastq as Fastq <EOL> def main ( argv = None ) : <EOL> """<STR_LIT>""" <EOL> if not argv : <EOL> argv = sys . argv <EOL> parser = E . OptionParser ( <EOL> version = "<STR_LIT>" , <EOL> usage = globals ( ) [ "<STR_LIT>" ] ) <EOL> parser . add_option ( <EOL> "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , type = "<STR_LIT>" , <EOL> choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> parser . add_option ( <EOL> "<STR_LIT>" , dest = "<STR_LIT>" , type = "<STR_LIT>" , <EOL> choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT>" , type = "<STR_LIT:string>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . set_defaults ( <EOL> change_format = None , <EOL> guess_format = None , <EOL> pattern = "<STR_LIT>" <EOL> ) <EOL> ( options , args ) = E . Start ( parser , argv = argv ) <EOL> c = E . Counter ( ) <EOL> outfile_seq = IOTools . openFile ( options . pattern % "<STR_LIT>" , "<STR_LIT:w>" ) <EOL> outfile_qual = IOTools . openFile ( options . pattern % "<STR_LIT>" , "<STR_LIT:w>" ) <EOL> if options . change_format : <EOL> iter = Fastq . iterate_convert ( options . stdin , <EOL> format = options . change_format , <EOL> guess = options . guess_format ) <EOL> else : <EOL> iter = Fastq . iterate ( options . stdin ) <EOL> for record in iter : <EOL> c . input += <NUM_LIT:1> <EOL> outfile_seq . write ( "<STR_LIT>" % ( record . identifier , record . seq ) ) <EOL> outfile_qual . write ( "<STR_LIT>" % ( record . identifier , record . quals ) ) <EOL> c . output += <NUM_LIT:1> <EOL> outfile_seq . close ( ) <EOL> outfile_qual . close ( ) <EOL> E . info ( "<STR_LIT:%s>" % str ( c ) ) <EOL> E . Stop ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> sys . exit ( main ( sys . argv ) ) </s>
