def filter_contacts(cmap, threshold=0.2):
    """Remove low score contacts from contact prediction list.

    :param cmap: Contact prediction map.
    :type cmap: :class:`~conkit.core.contactmap.ContactMap`
    :param threshold: Threshold, defaults to 0.2.
    :type threshold: float, optional

    """
    cmap.sort('raw_score', reverse=True, inplace=True)
    cnt = 0
    for contact in cmap:
        if contact.raw_score < threshold:
            break
        else:
            cnt = cnt+1

    return cmap[:cnt-1]