def rgSetToListOfDict(RGset, LB, SM, PL, PU, PG):
    """Convert the set of RG tags to a list of dictionaries ready to be add
    to the original bam header.
    
    Output list will look like:
    [{'ID': 'myid1',
         'SM': 'test' ...},
        {'ID': 'myid2',
         'LB': 'test',
         'SM': 'test' ...},
        {'ID': 'myid3',
         'SM': 'test' ...}]    
    """
    dlist= []
    for rg in RGset:
        dlist.append({'ID': rg, 'LB': LB, 'SM': SM, 'PL': PL, 'PU': PU, 'PG': PG})
    return dlist