def split_lib_transform(header):
 if header.startswith('>'):
  header = header[1:]
 fields = header.split()
 lib_id = fields[0]
 qual_id = fields[1]
 bc = fields[2].split('=')[1]
 return (' '.join([lib_id, ('read_id=' + qual_id), ('barcode=' + bc)]), qual_id)

def split_lib_transform ( header ) : if header . startswith ( '>' ) : header = header [ 1 : ] fields = header . split ( ) lib_id = fields [ 0 ] qual_id = fields [ 1 ] bc = fields [ 2 ] . split ( '=' ) [ 1 ] return ( ' ' . join ( [ lib_id , ( 'read_id=' + qual_id ) , ( 'barcode=' + bc ) ] ) , qual_id )
transform header of split_libraries .