def iseq_to_qseq_fields(line, barcode_in_header, barcode_length, barcode_qual_c='b'):
 record = line.strip().split(':')
 (rec_0_1, rec_0_2) = record[0].split('_')
 (rec_4_1, rec_4_23) = record[4].split('#')
 (rec_4_2, rec_4_3) = rec_4_23.split('/')
 if barcode_in_header:
  barcode = rec_4_2[:barcode_length]
  sequence = record[5]
  barcode_qual = (barcode_qual_c * barcode_length)
  sequence_qual = record[6]
 else:
  barcode = record[5][:barcode_length]
  sequence = record[5][barcode_length:]
  barcode_qual = record[6][:barcode_length]
  sequence_qual = record[6][barcode_length:]
 return ((rec_0_1, rec_0_2, record[1], record[2], record[3], rec_4_1, rec_4_2, rec_4_3), sequence, sequence_qual, barcode, barcode_qual)

def iseq_to_qseq_fields ( line , barcode_in_header , barcode_length , barcode_qual_c = 'b' ) : record = line . strip ( ) . split ( ':' ) ( rec_0_1 , rec_0_2 ) = record [ 0 ] . split ( '_' ) ( rec_4_1 , rec_4_23 ) = record [ 4 ] . split ( '#' ) ( rec_4_2 , rec_4_3 ) = rec_4_23 . split ( '/' ) if barcode_in_header : barcode = rec_4_2 [ : barcode_length ] sequence = record [ 5 ] barcode_qual = ( barcode_qual_c * barcode_length ) sequence_qual = record [ 6 ] else : barcode = record [ 5 ] [ : barcode_length ] sequence = record [ 5 ] [ barcode_length : ] barcode_qual = record [ 6 ] [ : barcode_length ] sequence_qual = record [ 6 ] [ barcode_length : ] return ( ( rec_0_1 , rec_0_2 , record [ 1 ] , record [ 2 ] , record [ 3 ] , rec_4_1 , rec_4_2 , rec_4_3 ) , sequence , sequence_qual , barcode , barcode_qual )
split an illumina sequence line into qseq fields .