ur_rna.StructureEditor.services.fileIO

## Class RnaFileIO.NucIndexConverter

- java.lang.Object
- - ur_rna.StructureEditor.services.fileIO.RnaFileIO.NucIndexConverter

- Direct Known Subclasses:
    RnaFileIO.NucIndexConverter.DoubleStrand, RnaFileIO.NucIndexConverter.MultiStrand
  Enclosing class:
    RnaFileIO

      abstract static class RnaFileIO.NucIndexConverter
      extends java.lang.Object

  The backend uses "III" (or some other character in extended nucleobase alphabets) to indicate an inter-molecular linker. I.e. a single sequence actually encodes two (or potentially more) RNA molecules. In this Java interface, each molecule is stored in a separate "Strand" in an RnaScene. This class builds an index that helps convert between the two representations by storing the position at which an "I" is encountered (which ends the first strand) as well as the position when the next valid base is encountered (which starts the second strand). Usually, there are three consecutive "I" characters, but this function assumes that that number is subject to change, which is why both the start and end positions of each linker are stored.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RnaFileIO.NucIndexConverter.DoubleStrand`
    `static class` | `RnaFileIO.NucIndexConverter.MultiStrand`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RnaFileIO.NucIndexConverter` | `SingleStrand`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NucIndexConverter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private static int` | `countLinkers(char[] sequence)`
    `static RnaFileIO.NucIndexConverter` | `create(java.lang.String sequence)`
    `abstract int` | `getBackendIndex(Nuc sceneNuc)`
    `abstract Nuc` | `getSceneNuc(RnaScene scene, int backendIndex)`
    `private static void` | `readLinkers(char[] sequence, int[] linkers)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SingleStrand

          public static final RnaFileIO.NucIndexConverter SingleStrand

  - ### Constructor Detail

    - #### NucIndexConverter

          NucIndexConverter()

  - ### Method Detail

    - #### countLinkers

          private static int countLinkers(char[] sequence)

    - #### create

          public static RnaFileIO.NucIndexConverter create(java.lang.String sequence)

    - #### getBackendIndex

          public abstract int getBackendIndex(Nuc sceneNuc)

    - #### getSceneNuc

          public abstract Nuc getSceneNuc(RnaScene scene,
                                          int backendIndex)

    - #### readLinkers

          private static void readLinkers(char[] sequence,
                                          int[] linkers)