def match_cluster(record, cluster, dist=300):
    """
    Determine whether DiscPair cluster matches a VCF record of interest.

    Checks if pairs exist which match the record's strandedness, then checks
    whether the min/max coord of these pairs is within a specified distance
    of the record's coordinates.

    Arguments
    ---------
    record : pysam.VariantRecord
    cluster : list of DiscPair
    dist : int, optional

    Returns
    -------
    match : bool
    """
    r_start, r_end = record.pos, record.stop

    if record.info['STRANDS'] == '++':
        # Choose max start/end of ++ pairs
        c_start = max((p.posA for p in cluster if (
            p.strandA == '+')), default=None)
        if c_start is None:
            # If no ++ pairs present, return False
            return False
        c_end = max(p.posB for p in cluster if (p.strandB == '+'))
    elif record.info['STRANDS'] == '--':
        # Choose min start/end of -- pairs
        c_start = min((p.posA for p in cluster if (
            p.strandA == '-')), default=None)
        if c_start is None:
            # If no -- pairs present, return False
            return False
        c_end = min(p.posB for p in cluster if (p.strandB == '-'))
    else:
        strands = record.info['STRANDS']
        raise Exception('Invalid inversion orientation: {0}'.format(strands))

    # Test if cluster start/end are sufficiently close to record start/end
    return abs(r_start - c_start) < dist and abs(r_end - c_end) < dist