# Distance measures between Secondary Structures

  Functions

  int vrna_bp_distance_pt(const short *pt1, const short *pt2)
    #include <ViennaRNA/structures/metrics.h>

    Compute the “base pair” distance between two pair tables pt1 and pt2 of secondary structures.

    The pair tables should have the same length. dist = number of base pairs in one structure but not in the other same as edit distance with open-pair close-pair as move-set

    SWIG Wrapper Notes:

      This function is available as an overloaded method bp_distance(). See, e.g. `RNA.bp_distance()` in the Python API.

    See also

    vrna_bp_distance()

    Parameters:

      - pt1 – First structure in dot-bracket notation

      - pt2 – Second structure in dot-bracket notation

    Returns:

      The base pair distance between pt1 and pt2

  int vrna_bp_distance(const char *str1, const char *str2)
    #include <ViennaRNA/structures/metrics.h>

    Compute the “base pair” distance between two secondary structures s1 and s2.

    This is a wrapper around vrna_bp_distance_pt(). The sequences should have the same length. dist = number of base pairs in one structure but not in the other same as edit distance with open-pair close-pair as move-set

    SWIG Wrapper Notes:

      This function is available as an overloaded method bp_distance(). Note that the SWIG wrapper takes two structure in dot-bracket notation and converts them into pair tables using vrna_ptable_from_string(). The resulting pair tables are then internally passed to vrna_bp_distance_pt(). To control which kind of matching brackets will be used during conversion, the optional argument `options` can be used. See also the description of vrna_ptable_from_string() for available options. (default: VRNA_BRACKETS_RND). See, e.g. `RNA.bp_distance()` in the Python API.

    See also

    vrna_bp_distance_pt()

    Parameters:

      - str1 – First structure in dot-bracket notation

      - str2 – Second structure in dot-bracket notation

    Returns:

      The base pair distance between str1 and str2

  double vrna_dist_mountain(const char *str1, const char *str2, unsigned int p)
    #include <ViennaRNA/structures/metrics.h>