Body: <p>I am trying to understand the Zuker Algorithm.</p>
  <p>What is happening during initialisation? I know in Nussinov the diagonal is filled with 0s. Are the diagonals filled with infinite energy during Zuker´s initialisation?</p>
  <p>Also, what is happening during recursion?</p>
  <p>I know unlike Nussinov, Zuker pays attention to stacking energies and loop structures, not individual basepairs. But how? How does the algorithm calculate the energies for stacking and loop structures at position 1 if there is no info about its neighbors yet?</p>
  <p>I understand there are 2 matrices - V and W. Is it correct that V is part of W? And is it correct that V keeps information about stack interactions and how much energy a stack of base pairs contributes - like keeping score on a multiplier?</p>
  <p>Is there a code or example (I would prefer R), which demonstrates how the algorithm goes over a sequence? Like a demonstration. I thought of one myself, but I am not sure if its correct:</p>
  <pre><code>sequence &lt;- c(1, 2, 3, 4, 5,6,7,8,9,10,11,12,13,14,15)
  
  n &lt;- length(sequence)
  
  for (l in 2:n) {
     for (i in 1:(n - l + 1)) {
        j &lt;- i + l - 1
        cat(&quot;i =&quot;, i, &quot;j =&quot;, j, &quot;\n&quot;)
     }
  }
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-02T00:04:22.653Z
Comments.Text: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comments.UserDisplayName: Community
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-02T08:03:18.087Z
Comments.Text: I am using RNAFold (http://rna.tbi.univie.ac.at/cgi-bin/RNAWebSuite/RNAfold.cgi). I am suppose to write a shor text after my work and I am having diffuculties understanding certain espects of Zuker`s Algorithm. Nussinov is easy to understand and visualize on paper. And i was wondering how would implement Zuker in R or Python for example or how one would fill a dotplot using Zuker.
Comments.UserDisplayName: Serij
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-02T14:30:04.773Z
Comments.Text: May i ask.. Whats the graph theory code in Python. I found some Python code on Github which is suppose to simulate Zuker, but if its not the correct Zuker Algorithm, then I would like to know.
Comments.UserDisplayName: Serij
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-03T20:30:23.860Z
Comments.Text: Graph theory code for RNA structure is a separate question. This question is about Zuker's code - I don't know it - I thought Zuker used graph theory (which I know) but used matrix algebra instead. It's easy to get hold of the code just download the `src` for MFold and especially RNAfold. RNAfold is in C.
Comments.UserDisplayName: M__
Tags: <r><rna><algorithms><rna-structure>
Title: What is happening in the Zuker-Algorithm
ThreadText: # What is happening in the Zuker-Algorithm
  
  (Asked by: username_0 on 2023-09-02)
  
  I am trying to understand the Zuker Algorithm.
  
  What is happening during initialisation? I know in Nussinov the diagonal is filled with 0s. Are the diagonals filled with infinite energy during Zuker´s initialisation?
  
  Also, what is happening during recursion?
  
  I know unlike Nussinov, Zuker pays attention to stacking energies and loop structures, not individual basepairs. But how? How does the algorithm calculate the energies for stacking and loop structures at position 1 if there is no info about its neighbors yet?
  
  I understand there are 2 matrices - V and W. Is it correct that V is part of W? And is it correct that V keeps information about stack interactions and how much energy a stack of base pairs contributes - like keeping score on a multiplier?
  
  Is there a code or example (I would prefer R), which demonstrates how the algorithm goes over a sequence? Like a demonstration. I thought of one myself, but I am not sure if its correct:
  
  ```
  sequence <- c(1, 2, 3, 4, 5,6,7,8,9,10,11,12,13,14,15)
  
  n <- length(sequence)
  
  for (l in 2:n) {
     for (i in 1:(n - l + 1)) {
        j <- i + l - 1
        cat("i =", i, "j =", j, "\n")
     }
  }
  
  ```
  
  **Tags:** r, rna, algorithms, rna-structure
  
  > **Comments:**
  > **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
  > **username_0**: I am using RNAFold (http://rna.tbi.univie.ac.at/cgi-bin/RNAWebSuite/RNAfold.cgi). I am suppose to write a shor text after my work and I am having diffuculties understanding certain espects of Zuker`s Algorithm. Nussinov is easy to understand and visualize on paper. And i was wondering how would implement Zuker in R or Python for example or how one would fill a dotplot using Zuker.  
  > **username_0**: May i ask.. Whats the graph theory code in Python. I found some Python code on Github which is suppose to simulate Zuker, but if its not the correct Zuker Algorithm, then I would like to know.  
  > **username_2**: Graph theory code for RNA structure is a separate question. This question is about Zuker's code - I don't know it - I thought Zuker used graph theory (which I know) but used matrix algebra instead. It's easy to get hold of the code just download the `src` for MFold and especially RNAfold. RNAfold is in C.  
  
  ---
  
  ## 0 answers
  
  