def build_inverse_barcode_map(seqs):
 inverse_map = {}
 map_count = defaultdict(int)
 for (label, seq) in seqs:
  (map_id, seq_id) = label.split()[:2]
  map_id = map_id.split('_')[0]
  inverse_map[seq_id] = map_id
  map_count[map_id] += 1
 return (inverse_map, map_count)

def build_inverse_barcode_map ( seqs ) : inverse_map = { } map_count = defaultdict ( int ) for ( label , seq ) in seqs : ( map_id , seq_id ) = label . split ( ) [ : 2 ] map_id = map_id . split ( '_' ) [ 0 ] inverse_map [ seq_id ] = map_id map_count [ map_id ] += 1 return ( inverse_map , map_count )
build a map from fasta header from split_libraries .