ChromAb
Class FragDecom

java.lang.Object
  |
  +--ChromAb.FragDecom

public class FragDecom
extends java.lang.Object

Class generates a fragment decomposition from a pattern for a specified label. The class stores four EdgeLists, one for each type of fragment (TC, TNC, NTC, or NTNC). This requires that all manifest breaks are present, specifically, that no edge has more than one centromere or more than one telomere, i.e. (y) is not allowed. Methods are those used for obtaining a reduced fragment decomposition.


Field Summary
private  EdgeList[] edgeList
           
private  java.lang.String label
           
static int NTC
           
static int NTNC
           
static int TC
           
static int TNC
           
 
Constructor Summary
FragDecom(FragDecom fd)
          Constructor makes a new FragDecom from another one by making new copies of the edgeList for each category.
FragDecom(Pattern p, java.lang.String label)
          Constructor takes a Pattern object and a specified label.
 
Method Summary
 void addEdge(int[] edge, int type)
          Add an edge to FD type.
 void addEdge(int a, int b, int type)
          Add an edge to FD type.
 int[] freeEnds(int type)
          Returns an integer array of all the free ends of the specified type.
 int[] getEdge(int index, int type)
          Returns the edge at an index of the specified type
 int[] getEdgeIncidentOn(int vertex)
          Returns the edge incident on a vertex
 int[] getEdgeIncidentOn(int vertex, int type)
          Returns the edge incident on a vertex in the specified FD type.
 EdgeList getEdgeList(int type)
          Returns the EdgeList for the specified type
 java.lang.String getLabel()
          Returns the label with respect to which this fragment decomposition was taken
 int number(int type)
          Returns the number of edges in the specified category.
 int numberOfFreeEnds()
          Returns the number of free ends
 void removeEdge(int[] edge)
          Remove the specified edge for the fragment decomposition
 void removeEdge(int[] edge, int type)
          Removes the specified edge from the specified type
 void removeEdgeIncidentOn(int vertex, int type)
          Removes the edge incident on a vertex for a particular FD type
 void replacePartner(int vertex, int new_partner, int old_type, int new_type)
          Replaces the partner of a vertex with a new vertex and changes the type.
 void replaceVertex(int vertex, int new_vertex, int old_type, int new_type)
          Changes the value of vertex and changes the type of its edge.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TC

public static final int TC
See Also:
Constant Field Values

TNC

public static final int TNC
See Also:
Constant Field Values

NTC

public static final int NTC
See Also:
Constant Field Values

NTNC

public static final int NTNC
See Also:
Constant Field Values

edgeList

private EdgeList[] edgeList

label

private java.lang.String label
Constructor Detail

FragDecom

public FragDecom(Pattern p,
                 java.lang.String label)
Constructor takes a Pattern object and a specified label. If the label does not occur in the pattern, all EdgeLists will be empty. This requires, also, that the Pattern have all manifest misrejoinings.

Parameters:
p - final aberration pattern with all manifest misrejoinings.
label - String with respect to which to perform the decomposition.

FragDecom

public FragDecom(FragDecom fd)
Constructor makes a new FragDecom from another one by making new copies of the edgeList for each category. Modifications make to this fragment decomposition within this class will not effect the original.

Parameters:
fd - fragment decomposition to clone.
Method Detail

number

public int number(int type)
Returns the number of edges in the specified category.

Parameters:
type - FD type

numberOfFreeEnds

public int numberOfFreeEnds()
Returns the number of free ends

Returns:
number of free ends

getLabel

public java.lang.String getLabel()
Returns the label with respect to which this fragment decomposition was taken

Returns:
label with respect to which this fragment decomposition was taken.

freeEnds

public int[] freeEnds(int type)
Returns an integer array of all the free ends of the specified type.

Parameters:
type - FD type
Returns:
all free ends of specified type.

getEdgeList

public EdgeList getEdgeList(int type)
Returns the EdgeList for the specified type

Parameters:
type - FD type
Returns:
EdgeList for the specified type

removeEdge

public void removeEdge(int[] edge,
                       int type)
Removes the specified edge from the specified type

Parameters:
edge - edge to remove
type - FD type

removeEdge

public void removeEdge(int[] edge)
Remove the specified edge for the fragment decomposition

Parameters:
edge - edge to remove

removeEdgeIncidentOn

public void removeEdgeIncidentOn(int vertex,
                                 int type)
Removes the edge incident on a vertex for a particular FD type

Parameters:
vertex - vertex whose edge we'd like to remove
type - FD type

replacePartner

public void replacePartner(int vertex,
                           int new_partner,
                           int old_type,
                           int new_type)
Replaces the partner of a vertex with a new vertex and changes the type. The placement (1st or 2nd position) of vertex is preserved in the new edge.

Parameters:
vertex - vertex whose partner we'd like to change
new_partner - value of new partner
old_type - initial FD type of edge incident on vertex.
new_type - new FD type of edge (vertex, new_partner)

replaceVertex

public void replaceVertex(int vertex,
                          int new_vertex,
                          int old_type,
                          int new_type)
Changes the value of vertex and changes the type of its edge. The placement (1st or 2nd position) of vertex's partner is preserved in the new edge.

Parameters:
vertex - vertex we'd like to change
new_vertex - value we'd like to change it to
old_type - initial FD type of edge incident on vertex
new_type - new FD type of edge (new_vertex, vertex's partner)

addEdge

public void addEdge(int[] edge,
                    int type)
Add an edge to FD type.

Parameters:
edge - edge to enter (note that edges are copied into the fragment decomposition by value, so edges may be added without fear of how manipulations to the FragDecom object might alter them.)
type - FD type

addEdge

public void addEdge(int a,
                    int b,
                    int type)
Add an edge to FD type.

Parameters:
a - first vertex
b - second vertex
type - FD type

getEdge

public int[] getEdge(int index,
                     int type)
Returns the edge at an index of the specified type

Parameters:
index - index of edge
type - FD type
Returns:
edge at index of specified type.

getEdgeIncidentOn

public int[] getEdgeIncidentOn(int vertex,
                               int type)
Returns the edge incident on a vertex in the specified FD type.

Parameters:
vertex - vertex to search for
type - FD type return edge incident on vertex.

getEdgeIncidentOn

public int[] getEdgeIncidentOn(int vertex)
Returns the edge incident on a vertex

Parameters:
vertex - vertex to search for
Returns:
edge incident on vertex.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object