ur_rna.StructureEditor.models

## Class RnaScene

- java.lang.Object
- - ur_rna.StructureEditor.models.RnaScene

- All Implemented Interfaces:
    java.lang.Cloneable

      public class RnaScene
      extends java.lang.Object
      implements java.lang.Cloneable

  Encompases all the information needed to an RNA "scene" which can include one or more strands of RNA in a specific 2D layout.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `drawFlipped` Whether this nucleotides were drawn flipped (Clockwise) or normal (Counter-Clockwise)
    `SceneDrawMode` | `drawMode`
    `History<HistoryState>` | `history`
    `private java.util.List<Nuc>` | `nucs`
    `StrandList` | `strands`
    `java.lang.String` | `title`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RnaScene()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Bond` | `addBond(Bond.BondInfo bond)`
    `private Bond` | `addBond(Bond b)`
    `Bond` | `addBond(int nuc1, int nuc2, BondType type)`
    `Bond` | `addBond(Nuc nuc1, Nuc nuc2)`
    `Bond` | `addBond(Nuc nuc1, Nuc nuc2, BondType type)`
    `Strand` | `addStrand()`
    `java.util.List<Nuc>` | `allNucs()` Returns a read-only list of all nucleotides.
    `void` | `breakBond(Bond b)`
    `void` | `breakBonds(int... nucIndices)`
    `int[]` | `buildStrandIndex(int start, int gapBetweenStrands)` Creates a lookup-index where element[I] is the starting nuclotide index of the nucleotide belonging to strand[I].
    `void` | `clearBonds()`
    `void` | `colorize(SceneColorizer c)`
    `void` | `copyBonds(RnaScene copyFrom)`
    `void` | `divideStrand(Nuc n)`
    `Strand` | `firstStrand()`
    `java.util.List<Bond>` | `getBonds()`
    `java.util.List<Bond>` | `getBonds(boolean includePseudo)`
    `java.util.List<Bond>` | `getBonds(java.lang.Iterable<Nuc> region, boolean includePseudo)` Get all bonds associated with nucleotides in the specified region, which can be a Strand or a Motif etc.
    `Motif.Branch` | `getBranch(Nuc nuc)`
    `Motif.Domain` | `getDomain(Nuc nuc)`
    `java.util.List<Motif.Helix>` | `getHelices()` Returns the list of helices in the RNA scene
    `Motif.Helix` | `getHelix(Nuc nuc)`
    `Motif.Loop` | `getLoop(Nuc nuc)`
    `java.util.List<Motif.Loop>` | `getLoops()`
    `java.util.List<Motif.MultiLoop>` | `getMultiLoops(int minimumBranches, boolean includeExterior)`
    `Nuc` | `getNuc(int index)`
    `int` | `getNucCount()`
    `RnaSceneState` | `getState()`
    `Strand` | `getStrand(int strandIndex)`
    `Strand` | `getStrand(int strandIndex, boolean createIfNotExisting)`
    `boolean` | `hasBonds()`
    `void` | `identifyPseudoknots()`
    `void` | `joinStrands(Strand s1, Strand s2)`
    `void` | `loadState(RnaSceneState state)`
    `Nuc` | `nucAtSceneIndex(int index)`
    `void` | `removeNucs(Nuc[] nucs)`
    `Strand` | `secondStrand()`

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

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

- - ### Field Detail

    - #### drawFlipped

          public boolean drawFlipped

      Whether this nucleotides were drawn flipped (Clockwise) or normal (Counter-Clockwise)

    - #### drawMode

          public SceneDrawMode drawMode

    - #### history

          public History<HistoryState> history

    - #### nucs

          private java.util.List<Nuc> nucs

    - #### strands

          public StrandList strands

    - #### title

          public java.lang.String title

  - ### Constructor Detail

    - #### RnaScene

          public RnaScene()

  - ### Method Detail

    - #### addBond

          public Bond addBond(Bond.BondInfo bond)

    - #### addBond

          private Bond addBond(Bond b)

    - #### addBond

          public Bond addBond(int nuc1,
                              int nuc2,
                              BondType type)

    - #### addBond

          public Bond addBond(Nuc nuc1,
                              Nuc nuc2)

    - #### addBond

          public Bond addBond(Nuc nuc1,
                              Nuc nuc2,
                              BondType type)

    - #### addStrand

          public Strand addStrand()

    - #### allNucs

          public java.util.List<Nuc> allNucs()

      Returns a read-only list of all nucleotides.

    - #### breakBond

          public void breakBond(Bond b)

    - #### breakBonds

          public void breakBonds(int... nucIndices)

    - #### buildStrandIndex

          public int[] buildStrandIndex(int start,
                                        int gapBetweenStrands)

      Creates a lookup-index where element[I] is the starting nuclotide index of the nucleotide belonging to strand[I]. For example: 3 strands with size 10, 5, and 8: `buildStrandIndex(0, 0) => int[] { 0, 10, 15 }` .. i.e. nucs: { S1{0-9}, S2{10-14}, S3{15-22} } `buildStrandIndex(0, 3) => int[] { 0, 13, 21 }` .. i.e. nucs: { S1{0-9}, S2{13-17}, S3{21-28} } `buildStrandIndex(1, 3) => int[] { 1, 14, 22 }` .. i.e. nucs: { S1{1-10}, S2{14-18}, S3{22-29} }
      Parameters:
        `start` - The desired index of the first nucleotide in the first strand.
        `gapBetweenStrands` - The number of index positions to skip between strands (i.e. if inter-molecular linkers need to be inserted)
      Returns:
        An integer array with each element[I] equal to the overall position of the first nucleotide in strand[I]

    - #### clearBonds

          public void clearBonds()

    - #### colorize

          public void colorize(SceneColorizer c)

    - #### copyBonds

          public void copyBonds(RnaScene copyFrom)

    - #### divideStrand

          public void divideStrand(Nuc n)

    - #### firstStrand

          public Strand firstStrand()

    - #### getBonds

          public java.util.List<Bond> getBonds()

    - #### getBonds

          public java.util.List<Bond> getBonds(boolean includePseudo)

    - #### getBonds

          public java.util.List<Bond> getBonds(java.lang.Iterable<Nuc> region,
                                               boolean includePseudo)

      Get all bonds associated with nucleotides in the specified region, which can be a Strand or a Motif etc.

    - #### getBranch

          public Motif.Branch getBranch(Nuc nuc)

    - #### getDomain

          public Motif.Domain getDomain(Nuc nuc)

    - #### getHelices

          public java.util.List<Motif.Helix> getHelices()

      Returns the list of helices in the RNA scene

    - #### getHelix

          public Motif.Helix getHelix(Nuc nuc)

    - #### getLoop

          public Motif.Loop getLoop(Nuc nuc)

    - #### getLoops

          public java.util.List<Motif.Loop> getLoops()

    - #### getMultiLoops

          public java.util.List<Motif.MultiLoop> getMultiLoops(int minimumBranches,
                                                               boolean includeExterior)

    - #### getNuc

          public Nuc getNuc(int index)

    - #### getNucCount

          public int getNucCount()

    - #### getState

          public RnaSceneState getState()

    - #### getStrand

          public Strand getStrand(int strandIndex)

    - #### getStrand

          public Strand getStrand(int strandIndex,
                                  boolean createIfNotExisting)

    - #### hasBonds

          public boolean hasBonds()

    - #### identifyPseudoknots

          public void identifyPseudoknots()

    - #### joinStrands

          public void joinStrands(Strand s1,
                                  Strand s2)

    - #### loadState

          public void loadState(RnaSceneState state)

    - #### nucAtSceneIndex

          public Nuc nucAtSceneIndex(int index)

    - #### removeNucs

          public void removeNucs(Nuc[] nucs)

    - #### secondStrand

          public Strand secondStrand()