# Backtracking MFE structures

Backtracking related interfaces

  Functions

  unsigned int vrna_bt_f(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/exterior.h>
  unsigned int vrna_bt_exterior_f5(vrna_fold_compound_t *fc, unsigned int j, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/exterior.h>
  unsigned int vrna_bt_exterior_f3(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/exterior.h>
  unsigned int vrna_bt_exterior_f3_pp(vrna_fold_compound_t *fc, unsigned int *i, unsigned int maxdist)
    #include <ViennaRNA/backtrack/exterior.h>
  int vrna_backtrack_from_intervals(vrna_fold_compound_t *fc, vrna_bp_stack_t *bp_stack, sect bt_stack[], int s)
    #include <ViennaRNA/backtrack/global.h>

    Backtrack a secondary structure with pre-evaluated structure components.

  float vrna_backtrack5(vrna_fold_compound_t *fc, unsigned int length, char *structure)
    #include <ViennaRNA/backtrack/global.h>

    Backtrack an MFE (sub)structure.

    This function allows one to backtrack the MFE structure for a (sub)sequence

    SWIG Wrapper Notes:

      This function is attached as overloaded method `backtrack()` to objects of type `fold_compound`. The parameter `length` defaults to the total length of the RNA sequence and may be omitted. The parameter `structure` is returned along with the MFE und must not be provided. See e.g. `RNA.fold_compound.backtrack()` in the Python API.

    See also

    vrna_mfe(), vrna_pbacktrack5()

    Note

    On error, the function returns INF / 100. and stores the empty string in `structure`.

    Parameters:

      - fc – fold compound

      - length – The length of the subsequence, starting from the 5’ end

      - structure – A pointer to the character array where the secondary structure in dot-bracket notation will be written to. (Must have size of at least $p length + 1)

    Pre:

      Requires pre-filled MFE dynamic programming matrices, i.e. one has to call vrna_mfe() prior to calling this function

    Returns:

      The minimum free energy (MFE) for the specified `length` in kcal/mol and a corresponding secondary structure in dot-bracket notation (stored in `structure`)

  int vrna_bt_hairpin(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, int en, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/hairpin.h>

    Backtrack a hairpin loop closed by \( (i,j) \).

    Note

    This function is polymorphic! The provided vrna_fold_compound_t may be of type VRNA_FC_TYPE_SINGLE or VRNA_FC_TYPE_COMPARATIVE

  int vrna_bt_stacked_pairs(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, int *en, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/internal.h>

    Backtrack a stacked pair closed by \( (i,j) \).

  int vrna_bt_internal_loop(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, int en, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/internal.h>

    Backtrack an internal loop closed by \( (i,j) \).

  unsigned int vrna_bt_m(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/multibranch.h>
  unsigned int vrna_bt_multibranch_loop(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, int en, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/multibranch.h>

    Backtrack the decomposition of a multi branch loop closed by \( (i,j) \).

    Parameters:

      - fc – The vrna_fold_compound_t filled with all relevant data for backtracking

      - i – 5’ position of base pair closing the loop (will be set to 5’ position of leftmost decomposed block upon successful backtracking)

      - j – 3’ position of base pair closing the loop (will be set to 3’ position of rightmost decomposed block upon successful backtracking)

      - k – Split position that delimits leftmost from rightmost block, [i,k] and [k+1, j], respectively. (Will be set upon successful backtracking)

      - en – The energy contribution of the substructure enclosed by \( (i,j) \)

      - component1 – Type of leftmost block (1 = ML, 2 = C)

      - component2 – Type of rightmost block (1 = ML, 2 = C)

    Returns:

      1, if backtracking succeeded, 0 otherwise.

  unsigned int vrna_bt_multibranch_split(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, vrna_bps_t bp_stack, vrna_bts_t bt_stack)
    #include <ViennaRNA/backtrack/multibranch.h>