fr.orsay.lri.varna.models.naView
Class NAView

java.lang.Object
  extended by fr.orsay.lri.varna.models.naView.NAView

public class NAView
extends Object


Field Summary
private  double _h
           
private  ArrayList<InterfaceVARNAListener> _listeVARNAListener
           
private  double angleinc
           
private  double ANUM
           
(package private)  double BACKBONE_DISTANCE
           
private  ArrayList<Base> bases
           
private  boolean debug
           
(package private)  double HELIX_FACTOR
           
private  double lencut
           
private  int loop_count
           
private  ArrayList<Loop> loops
           
private  int MAXITER
           
private  int nbase
           
private  boolean noIterationFailureYet
           
private  int nregion
           
private  double RADIUS_REDUCTION_FACTOR
           
private  ArrayList<Region> regions
           
private  Radloop rlphead
           
private  Loop root
           
 
Constructor Summary
NAView()
           
 
Method Summary
private  boolean connected_connection(Connection cp, Connection cpnext)
          Determines if the connections cp and cpnext are connected
private  void construct_circle_segment(int start, int end)
          Draws the segment of residue between the bases numbered start through end, where start and end are presumed to be part of a base pairing region.
private  void construct_extruded_segment(Connection cp, Connection cpnext)
          Constructs the segment between cp and cpnext as a circle if possible.
private  Loop construct_loop(int ibase)
          Starting at residue ibase, recursively constructs the loop containing said base and all deeper bases.
private  int depth(Loop lp)
          Determines the depth of loop, lp.
private  void determine_depths()
          Determine the depth of all loops.
private  void determine_radius(Loop lp, double lencut)
          For the loop pointed to by lp, determine the radius of the loop that will ensure that each base around the loop will have a separation of at least lencut around the circle.
private  void dump_loops()
          Displays all the loops.
private  void find_center_for_arc(double n, double b)
          Given n points to be placed equidistantly and equiangularly on a polygon which has a chord of length, b, find the distance, h, from the midpoint of the chord for the center of polygon.
private  void find_central_loop()
          Find node of greatest branching that is deepest.
private  int find_ic_middle(int icstart, int icend, Connection anchor_connection, Connection acp, Loop lp)
          Finds the middle of a set of connected connectors.
private  void find_regions()
          Identifies the regions in the structure.
private  void generate_region(Connection cp)
          Generates the coordinates for the base pairing region of a connection given the position of the starting base pair.
private  void infoBasesExtracted()
           
private  void infoBasesMate()
           
private  void infoRegions()
           
private  void infoRoot()
           
private  void infoStructure(ArrayList<Integer> pair_table)
           
private  double maxf2(double x1, double x2)
           
private  double minf2(double x1, double x2)
           
 int naview_xy_coordinates(ArrayList<Short> pair_table2, ArrayList<Double> x, ArrayList<Double> y)
           
private  void read_in_bases(ArrayList<Integer> pair_table)
           
private  void traverse_loop(Loop lp, Connection anchor_connection)
          This is the workhorse of the display program.
 void warningEmition(String warningMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANUM

private final double ANUM
See Also:
Constant Field Values

MAXITER

private final int MAXITER
See Also:
Constant Field Values

bases

private ArrayList<Base> bases

nbase

private int nbase

nregion

private int nregion

loop_count

private int loop_count

root

private Loop root

loops

private ArrayList<Loop> loops

regions

private ArrayList<Region> regions

rlphead

private Radloop rlphead

lencut

private double lencut

RADIUS_REDUCTION_FACTOR

private final double RADIUS_REDUCTION_FACTOR
See Also:
Constant Field Values

debug

private boolean debug

angleinc

private double angleinc

_h

private double _h

_listeVARNAListener

private ArrayList<InterfaceVARNAListener> _listeVARNAListener

noIterationFailureYet

private boolean noIterationFailureYet

HELIX_FACTOR

double HELIX_FACTOR

BACKBONE_DISTANCE

double BACKBONE_DISTANCE
Constructor Detail

NAView

public NAView()
Method Detail

naview_xy_coordinates

public int naview_xy_coordinates(ArrayList<Short> pair_table2,
                                 ArrayList<Double> x,
                                 ArrayList<Double> y)
                          throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

infoStructure

private void infoStructure(ArrayList<Integer> pair_table)

infoBasesMate

private void infoBasesMate()

infoRegions

private void infoRegions()

infoBasesExtracted

private void infoBasesExtracted()

infoRoot

private void infoRoot()

read_in_bases

private void read_in_bases(ArrayList<Integer> pair_table)

find_regions

private void find_regions()
Identifies the regions in the structure.


construct_loop

private Loop construct_loop(int ibase)
                     throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Starting at residue ibase, recursively constructs the loop containing said base and all deeper bases.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

dump_loops

private void dump_loops()
Displays all the loops.


find_central_loop

private void find_central_loop()
Find node of greatest branching that is deepest.


determine_depths

private void determine_depths()
Determine the depth of all loops.


depth

private int depth(Loop lp)
Determines the depth of loop, lp. Depth is defined as the minimum distance to a leaf loop where a leaf loop is one that has only one or no connections.


traverse_loop

private void traverse_loop(Loop lp,
                           Connection anchor_connection)
                    throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
This is the workhorse of the display program. The algorithm is recursive based on processing individual loops. Each base pairing region is displayed using the direction given by the circle diagram, and the connections between the regions is drawn by equally spaced points. The radius of the loop is set to minimize the square error for lengths between sequential bases in the loops. The "correct" length for base links is 1. If the least squares fitting of the radius results in loops being less than 1/2 unit apart, then that segment is extruded. The variable, anchor_connection, gives the connection to the loop processed in an previous level of recursion.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

determine_radius

private void determine_radius(Loop lp,
                              double lencut)
For the loop pointed to by lp, determine the radius of the loop that will ensure that each base around the loop will have a separation of at least lencut around the circle. If a segment joining two connectors will not support this separation, then the flag, extruded, will be set in the first of these two indicators. The radius is set in lp. The radius is selected by a least squares procedure where the sum of the squares of the deviations of length from the ideal value of 1 is used as the error function.


connected_connection

private boolean connected_connection(Connection cp,
                                     Connection cpnext)
Determines if the connections cp and cpnext are connected


find_ic_middle

private int find_ic_middle(int icstart,
                           int icend,
                           Connection anchor_connection,
                           Connection acp,
                           Loop lp)
                    throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Finds the middle of a set of connected connectors. This is normally the middle connection in the sequence except if one of the connections is the anchor, in which case that connection will be used.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

generate_region

private void generate_region(Connection cp)
                      throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Generates the coordinates for the base pairing region of a connection given the position of the starting base pair.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

construct_circle_segment

private void construct_circle_segment(int start,
                                      int end)
                               throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Draws the segment of residue between the bases numbered start through end, where start and end are presumed to be part of a base pairing region. They are drawn as a circle which has a chord given by the ends of two base pairing regions defined by the connections.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

construct_extruded_segment

private void construct_extruded_segment(Connection cp,
                                        Connection cpnext)
                                 throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Constructs the segment between cp and cpnext as a circle if possible. However, if the segment is too large, the lines are drawn between the two connecting regions, and bases are placed there until the connecting circle will fit.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

find_center_for_arc

private void find_center_for_arc(double n,
                                 double b)
                          throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Given n points to be placed equidistantly and equiangularly on a polygon which has a chord of length, b, find the distance, h, from the midpoint of the chord for the center of polygon. Positive values mean the center is within the polygon and the chord, whereas negative values mean the center is outside the chord. Also, the radial angle for each polygon side is returned in theta. The procedure uses a bisection algorithm to find the correct value for the center. Two equations are solved, the angles around the center must add to 2*Math.PI, and the sides of the polygon excluding the chord must have a length of 1.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm

minf2

private double minf2(double x1,
                     double x2)

maxf2

private double maxf2(double x1,
                     double x2)

warningEmition

public void warningEmition(String warningMessage)
                    throws fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm