def getRGs(bam):
    RG = []
    if 'RG' in bam.header:
        for headRG in bam.header['RG']:
            RG.append(headRG['ID'])
    return RG
The field stats api allows one to find statistical properties of a
dataset/ETHPy150Open adamewing/bamsurgeon/bamsurgeon/replacereads.py/getRGs--crossover with--dataset/ETHPy150Open elastic/elasticsearch-py/elasticsearch/client/__init__.py/Elasticsearch.field_stats