ur_rna.StructureEditor.models

## Class Motif.Helix

- java.lang.Object
- - ur_rna.StructureEditor.models.Motif.Helix

- All Implemented Interfaces:
    java.lang.Iterable<Nuc>, IMotif, INucGroup
  Enclosing class:
    Motif

      public static class Motif.Helix
      extends java.lang.Object
      implements IMotif

  A helix represents a series of adjacent nucleotides which are all paired to a another series of adjacent nucleotides on the same RNA strand or a different RNA strand.

  From this definition, it follows that a helix may be composed of either inter- or intra-molecular pairs but never both, and that a helix can include bases from at most two RNA strands.

  Due to this definition, the only information required to store a helix unambiguously are the first and last bases of the series on either strand. Let these be called n5 and n3 (for the 5' and 3' bases respectively). It follows that n5 must belong to same strand as n3. Similarly n5.pairedTo must belong to the same strand as n3.pairedTo, but this is not necessarily the same strand that n5 and n3 belong to.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) Nuc` | `nuc5` The 5'-most nucleotide in the helix.
    `(package private) int` | `pairCount` The number of basepairs in the helix.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Helix(Nuc nuc5, int pairCount)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private static boolean` | `bondIsNextInHelix(Bond prev, Bond current, ObjTools.RefInt orientation)` Determines whether the "current" bond is immediately after the "prev" bond in a helix.
    `static java.util.List<Motif.Helix>` | `findAll(RnaScene scene)` Find all distinct helices in specified list of strands.
    `Bond` | `first()`
    `java.util.Collection<Nuc>` | `getBases()` Get a set of all nucleotides included in the group.
    `static Motif.Helix` | `getHelix(Nuc nuc)` Return the helix that contains the given nuc or null if nuc is not in a helix (ie.
    `Bond` | `getPair(int index)`
    `RnaScene` | `getScene()`
    `boolean` | `isClockwise()`
    `protected static boolean` | `isHelixBond(Bond b)`
    `boolean` | `isHybrid()` Whether or not the helix contains inter-molecular pairs (i.e.
    `boolean` | `isParallel()`
    `Bond` | `last()`
    `Bond` | `lastPair()`
    `int` | `size()` Get the number of base-pairs in the helix (which is half the number of nucleotides).

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

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

    - ### Methods inherited from interface ur_rna.StructureEditor.models.INucGroup

      `iterator, transformAll`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### nuc5

          Nuc nuc5

      The 5'-most nucleotide in the helix.

    - #### pairCount

          int pairCount

      The number of basepairs in the helix.

  - ### Constructor Detail

    - #### Helix

          protected Helix(Nuc nuc5,
                          int pairCount)

  - ### Method Detail

    - #### bondIsNextInHelix

          private static boolean bondIsNextInHelix(Bond prev,
                                                   Bond current,
                                                   ObjTools.RefInt orientation)

      Determines whether the "current" bond is immediately after the "prev" bond in a helix. Specifically: 1. current.type must be a valid helix bond (base pair) 2. The "from" nucleotides (current.nuc1 and prev.nuc1) must be on the same strand. 3. The "to" nucleotides (current.nuc2 and prev.nuc2) must be on the same strand (but not necessarily the same strand as nuc1) 4. The "from" nucleotide of current must be positioned immediately after that of "prev". (i.e. current.nuc1.index == prev.nuc1.index + 1) 5. The "to" nucleotide of current must be positioned immediately after OR before that of "prev". (i.e. current.nuc2.index == prev.nuc1.index +/- 1) (whether it is +1 or -1 will depend on the orientation of the second in the helix strand relative to the first.) 6. If the orientation of the second strand to the first is known (which will always be the case when at least two adjacent bonds have been identified) then the orientation between this bond and the last must match the one previously determined (e.g. from the preceding two bonds).

    - #### findAll

          public static java.util.List<Motif.Helix> findAll(RnaScene scene)

      Find all distinct helices in specified list of strands.
      Returns:
        a list of helices.

    - #### first

          public Bond first()

    - #### getBases

          public java.util.Collection<Nuc> getBases()

      Description copied from interface: `INucGroup`
      Get a set of all nucleotides included in the group.
      Specified by:
        `getBases` in interface `INucGroup`
      Returns:
        a Collection of nucleotides.

    - #### getHelix

          public static Motif.Helix getHelix(Nuc nuc)

      Return the helix that contains the given nuc or null if nuc is not in a helix (ie. it is unpaired)

    - #### getPair

          public Bond getPair(int index)

    - #### getScene

          public RnaScene getScene()

    - #### isClockwise

          public boolean isClockwise()

    - #### isHelixBond

          protected static boolean isHelixBond(Bond b)

    - #### isHybrid

          public boolean isHybrid()

      Whether or not the helix contains inter-molecular pairs (i.e. a hybridization of two distinct strands).
      Returns:
        true if n5.strand is different than n3.strand and false otherwise.

    - #### isParallel

          public boolean isParallel()

    - #### last

          public Bond last()

    - #### lastPair

          public Bond lastPair()

    - #### size

          public int size()

      Get the number of base-pairs in the helix (which is half the number of nucleotides).
      Returns:
        The number of base-pairs in the helix.