def read_ld_score(b, ancestries, anc_to_ldscore, expect_bgz, prefix):
    """ Read LD score files. Expects that there is one file per ancestry, *not* split per chromosome.

    Parameters
    ----------
    b : :obj:`Batch`
    ancestries : `list` 
        Ancestry abbreviations compatible with `anc_to_ldscore`
    anc_to_ldscore : `function`
        Function that outputs an ldscore address taking in an ancestry abbreviation
    expect_bgz : `bool`
        If True, will expect bgz suffix for .ldscore files. Otherwise will expect .gz.
    prefix : `str`
        Prefix of file names that correspond to all ldscore files. For example, for
        the file ld.ldscore.gz, the prefix is ld.

    Returns
    -------
    :obj: `Batch`, :obj: `Dictionary`mapping ancestries to ld score files
    """
    ldscore_file_dict = {}
    ldsc_suffix = f'.ldscore.{"b" if expect_bgz else ""}gz'
    for anc in ancestries:
        this_adr = anc_to_ldscore(anc)
        ig = b.read_input_group(**{'l2.ldscore.gz': this_adr + '.' + prefix + ldsc_suffix,
                                   'l2.M_5_50': this_adr + '.' + prefix + '.M_5_50',
                                   'l2.M': this_adr + '.' + prefix + '.M'})
        ldscore_file_dict.update({anc: ig})
    return b, ldscore_file_dict