Skip to main content
. 2024 May 23;15(6):670. doi: 10.3390/genes15060670
Algorithm 1 Knotify_V2.0—The variation of Knotify+ Algorithm for the inclusion of Hairpin loops
  • Require: 

    RNA sequence S, Tuning parameters P

  • Ensure: 

    Predicted structure R, Free energy E, Execution time D

  •   1:

    # Initialization and Inputs

  •   2:

    S input RNA sequence

  •   3:

    P tuning parameters

  •   4:

     

  •   5:

    # Stage 1: Detect Core Stems

  •   6:

    Parse S using Earley Grammar

  •   7:

    C Candidate positions for core stems in S

  •   8:

     

  •   9:

    # Stage 2: Annotate Core Stems

  • 10:

    for each candidate c in C do

  • 11:

        Annotate c with core stems, considering bulges and/or internal loops

  • 12:

    end for

  • 13:

    A Annotated candidates

  • 14:

     

  • 15:

    # Stage 3: Apply Criteria

  • 16:

    M Max stems in A

  • 17:

    A Filter A by stems M

  • 18:

    Compute MFE and sort A in a ascending order

  • 19:

     

  • 20:

    # Stage 4: Identify Hairpins

  • 21:

    for each candidate a in A do

  • 22:

        Identify hairpins in a

  • 23:

        Generate variants V with/without hairpins in the loops

  • 24:

    end for

  • 25:

     

  • 26:

    # Stage 5: Final Selection

  • 27:

    Reapply max stems and MFE criteria on V

  • 28:

     

  • 29:

    R,E Candidate with min MFE in V, and its energy value

  • 30:

    D Calculate execution time

  • 31:

     

  • 32:

    # Final outputs

  • 33:

    return  R,E,D