import pathlib


def load_gtdb_md5sums(md5sums_file):
    """Create a dictionary from the MD5SUMS file"""
    md5_dict = {}
    with open(md5sums_file, "r") as fin:
        for line in fin:
            fields = [f.strip() for f in line.split()]
            fname = pathlib.Path(fields[1]).name
            md5_dict[fname] = fields[0]
    return md5_dict