Return a list of tuples indicating the start and end points of the loops
    that were sampled in the given directory.

def load_resfile(directory, resfile_path=None):
    """
    Return a list of tuples indicating the start and end points of the loops
    that were sampled in the given directory.
    """

    if resfile_path is None:
        workspace = workspace_from_dir(directory)
        resfile_path = workspace.resfile_path

    from klab.rosetta.input_files import Resfile
    return Resfile(resfile_path)