def read_len(f):
    """Read a 'LEN' file and return a mapping from chromosome to length"""
    mapping = dict()
    for line in f:
        fields = line.split()
        mapping[fields[0]] = int(fields[1])
    return mapping
