Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3092

Particular combination of RNA secondary structure annotation braces causes endless loop in calculating helices

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.10.4b1
    • Fix Version/s: 2.10.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      Jalview Version: Test
      Jalview Installation: unknown
      Build Date: unknown
      Java version: 1.8.0_172
      x86_64 Mac OS X 10.13.6
    • Urgency:
      Not urgent

      Description

      Certain particular configurations of braces in an RNA secondary structure annotation cause the helices calculation to go into an endless loop.
      e.g. stockholm file (also attached)

      # STOCKHOLM 1.0
      #=GF ID RNA.SS.TEST
      #=GF TP RNA;
      Test.sequence AAAAAAAAAG
      #=GC SS_cons ([[](()]))
      //

      My understanding of this might be limited, and such a brace combination might not be possible (and hence not catered for in the calculation).

      The loop occurs when reading in the file, in
      jalview.Analysis.Rna
      in
      getHelixMap(CharSequence rnaAnnotation)
      lines 444-455:

            while (j >= 0)
            {
              int popen = bps.get(j).getBP5();

              // System.out.println("j " + j + " popen " + popen + " lastopen "
              // +lastopen + " open " + open);
              if ((popen < lastopen) && (popen > open))
              {
                if (helices.containsValue(popen)
                        && ((helices.get(popen)) == helix))
                {
                  continue;
                }
      ...

      which does not break out of the while loop as the j-=1 gets to a stage where it is not reached (j=2).

        Attachments

          Activity

            People

            Assignee:
            soares Ben Soares
            Reporter:
            soares Ben Soares
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: