<s> """<STR_LIT>""" <EOL> import sys <EOL> import gzip <EOL> def solexa_char_to_sanger ( __char ) : <EOL> return chr ( ord ( __char ) - <NUM_LIT> ) <EOL> def solexa_str_to_sanger ( __qualities ) : <EOL> __new_quals = "<STR_LIT>" <EOL> for __char in __qualities : <EOL> __new_quals = "<STR_LIT>" . join ( [ __new_quals , solexa_char_to_sanger ( __char ) ] ) <EOL> return __new_quals <EOL> def return_fastq_entry ( __export_line_array , remove_bases , new_quals ) : <EOL> __name = "<STR_LIT::>" . join ( [ __export_line_array [ <NUM_LIT:0> ] , __export_line_array [ <NUM_LIT:2> ] , __export_line_array [ <NUM_LIT:3> ] , __export_line_array [ <NUM_LIT:4> ] , __export_line_array [ <NUM_LIT:5> ] ] ) <EOL> __name = "<STR_LIT:/>" . join ( [ __name , __export_line_array [ <NUM_LIT:7> ] ] ) <EOL> if new_quals : <EOL> return "<STR_LIT>" . join ( [ '<STR_LIT:@>' , __name , '<STR_LIT:\n>' , "<STR_LIT>" . join ( __export_line_array [ <NUM_LIT:8> ] [ <NUM_LIT:0> : len ( __export_line_array [ <NUM_LIT:8> ] ) - remove_bases ] ) , '<STR_LIT>' , "<STR_LIT>" . join ( __export_line_array [ <NUM_LIT:9> ] [ <NUM_LIT:0> : len ( __export_line_array [ <NUM_LIT:9> ] ) - remove_bases ] ) , '<STR_LIT:\n>' ] ) <EOL> else : <EOL> return "<STR_LIT>" . join ( [ '<STR_LIT:@>' , __name , '<STR_LIT:\n>' , "<STR_LIT>" . join ( __export_line_array [ <NUM_LIT:8> ] [ <NUM_LIT:0> : len ( __export_line_array [ <NUM_LIT:8> ] ) - remove_bases ] ) , '<STR_LIT>' , "<STR_LIT>" . join ( solexa_str_to_sanger ( __export_line_array [ <NUM_LIT:9> ] ) [ <NUM_LIT:0> : len ( __export_line_array [ <NUM_LIT:9> ] ) - remove_bases ] ) , '<STR_LIT:\n>' ] ) <EOL> def main ( args = sys . argv ) : <EOL> exp_file_nm = args [ <NUM_LIT:1> ] <EOL> fq_file_1 = gzip . open ( args [ <NUM_LIT:2> ] , '<STR_LIT:w>' ) <EOL> fq_file_2 = gzip . open ( args [ <NUM_LIT:3> ] , '<STR_LIT:w>' ) <EOL> exp_file = gzip . open ( exp_file_nm , '<STR_LIT:rb>' ) <EOL> while True : <EOL> try : <EOL> line1 = exp_file . readline ( ) . rstrip ( '<STR_LIT:\n>' ) <EOL> line2 = exp_file . readline ( ) . rstrip ( '<STR_LIT:\n>' ) <EOL> fq_file_1 . write ( return_fastq_entry ( line1 . split ( '<STR_LIT:\t>' ) , int ( args [ <NUM_LIT:4> ] ) , bool ( args [ <NUM_LIT:5> ] ) ) ) ; fq_file_2 . write ( return_fastq_entry ( line2 . split ( '<STR_LIT:\t>' ) , int ( args [ <NUM_LIT:4> ] ) , bool ( args [ <NUM_LIT:5> ] ) ) ) <EOL> except : <EOL> break <EOL> fq_file_1 . close ( ) ; fq_file_2 . close ( ) <EOL> return <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> sys . exit ( main ( sys . argv ) ) </s>
