def pairs_to_lists(pairs):
    """Convert list of pairs into to two tuple lists.

    Removes any SNPs with an empty match list.

    Parameters
    ----------
    pairs : list
        From filter_by_distance():
            (rsid, loc, set((rsid, loc)))

    Returns
    -------
    snp_list : list_of_tuple
    comp_list : list_of_tuple
        (rsid, loc)
    """
    query = []
    comp  = []
    for snp, loc, matches in pairs:
        if not matches:
            continue
        query.append((snp, loc))
        for snp2, loc2 in matches:
            comp.append((snp2, loc2))
    return set(query), set(comp)