def illumina_data_to_fastq(record_data, number_of_bases=None):
 seq_index = 8
 qual_index = 9
 pass_filter_index = 10
 try:
  pass_filter = int(record_data[pass_filter_index])
 except IndexError:
  pass_filter = 2
 if (number_of_bases is None):
  seq = record_data[seq_index].replace('.', 'N')
  qual = record_data[qual_index]
 else:
  seq = record_data[seq_index][:number_of_bases].replace('.', 'N')
  qual = record_data[qual_index][:number_of_bases]
 header = ('%s_%s:%s:%s:%s:%s#%s/%s' % (record_data[0], record_data[1], record_data[2], record_data[3], record_data[4], record_data[5], record_data[6], record_data[7]))
 return (('@%s\n%s\n+\n%s' % (header, seq, qual)), pass_filter)

def illumina_data_to_fastq ( record_data , number_of_bases = None ) : seq_index = 8 qual_index = 9 pass_filter_index = 10 try : pass_filter = int ( record_data [ pass_filter_index ] ) except IndexError : pass_filter = 2 if ( number_of_bases is None ) : seq = record_data [ seq_index ] . replace ( '.' , 'N' ) qual = record_data [ qual_index ] else : seq = record_data [ seq_index ] [ : number_of_bases ] . replace ( '.' , 'N' ) qual = record_data [ qual_index ] [ : number_of_bases ] header = ( '%s_%s:%s:%s:%s:%s#%s/%s' % ( record_data [ 0 ] , record_data [ 1 ] , record_data [ 2 ] , record_data [ 3 ] , record_data [ 4 ] , record_data [ 5 ] , record_data [ 6 ] , record_data [ 7 ] ) ) return ( ( '@%s\n%s\n+\n%s' % ( header , seq , qual ) ) , pass_filter )
given data from an illumina qseq file .