Skip to content

metrics

calculate_match

calculate_match(coords1: float | ndarray = None, coords2: float | ndarray = None, coords_rmsd_reference: float | ndarray = None) -> float | ndarray

Calculate the match score(s) between two sets of coordinates given a reference rmsd

Parameters:

  • coords1 (float | ndarray, default: None ) –

    The first set of coordinates

  • coords2 (float | ndarray, default: None ) –

    The second set of coordinates

  • coords_rmsd_reference (float | ndarray, default: None ) –

    The reference RMSD to compare each pair of coordinates against

Returns: The match score(s)

Source code in symdesign/structure/fragment/metrics.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@jit(nopython=True)  # , cache=True)
def calculate_match(coords1: float | np.ndarray = None, coords2: float | np.ndarray = None,
                    coords_rmsd_reference: float | np.ndarray = None) -> float | np.ndarray:
    """Calculate the match score(s) between two sets of coordinates given a reference rmsd

    Args:
        coords1: The first set of coordinates
        coords2: The second set of coordinates
        coords_rmsd_reference: The reference RMSD to compare each pair of coordinates against
    Returns:
        The match score(s)
    """
    # rmsds = _rmsd(coords1, coords2)
    # # Calculate Guide Atom Overlap Z-Value
    # z_values = rmsds / coords_rmsd_reference
    # # filter z_values by passing threshold
    return match_score_from_z_value(_rmsd(coords1, coords2) / coords_rmsd_reference)

rmsd_z_score

rmsd_z_score(coords1: float | ndarray = None, coords2: float | ndarray = None, coords_rmsd_reference: float | ndarray = None) -> float | ndarray

Calculate the overlap between two sets of coordinates given a reference rmsd

Parameters:

  • coords1 (float | ndarray, default: None ) –

    The first set of coordinates

  • coords2 (float | ndarray, default: None ) –

    The second set of coordinates

  • coords_rmsd_reference (float | ndarray, default: None ) –

    The reference RMSD to compare each pair of coordinates against

Returns: The overlap z-value

Source code in symdesign/structure/fragment/metrics.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@jit(nopython=True)  # , cache=True)
def rmsd_z_score(coords1: float | np.ndarray = None, coords2: float | np.ndarray = None,
                 coords_rmsd_reference: float | np.ndarray = None) -> float | np.ndarray:
    """Calculate the overlap between two sets of coordinates given a reference rmsd

    Args:
        coords1: The first set of coordinates
        coords2: The second set of coordinates
        coords_rmsd_reference: The reference RMSD to compare each pair of coordinates against
    Returns:
        The overlap z-value
    """
    #         max_z_value: The z-score deviation threshold of the overlap to be considered a match
    # Calculate Guide Atom Overlap Z-Value
    return _rmsd(coords1, coords2) / coords_rmsd_reference

z_value_from_match_score

z_value_from_match_score(match_score: float | ndarray) -> float | ndarray

Given a match score, convert to a z-value. sqrt(1/match_score - 1)

Source code in symdesign/structure/fragment/metrics.py
86
87
88
89
@jit(nopython=True)  # , cache=True)
def z_value_from_match_score(match_score: float | np.ndarray) -> float | np.ndarray:
    """Given a match score, convert to a z-value. sqrt(1/match_score - 1)"""
    return np.sqrt(1/match_score - 1)

match_score_from_z_value

match_score_from_z_value(z_value: float | ndarray) -> float | ndarray

Return the match score from a fragment z-value -> 1 / (1 + z_value**2). Bounded between 0 and 1

Source code in symdesign/structure/fragment/metrics.py
92
93
94
95
@jit(nopython=True)  # , cache=True)
def match_score_from_z_value(z_value: float | np.ndarray) -> float | np.ndarray:
    """Return the match score from a fragment z-value -> 1 / (1 + z_value**2). Bounded between 0 and 1"""
    return 1 / (1 + z_value**2)