ChromAb
Class Pattern

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

public class Pattern
extends java.lang.Object

This class is responsible for most of the work involved in analyzing a final mFISH pattern in terms of the multigraph model. The basic fields of the class are a pattern string and a label map. The label map is a sequential list of the chromosome fragments involved in the aberration. It is stored as an array of LabelCent objects, each of which store a label and a boolean flag indicating a centromere The pattern string gives the final arrangement of the chromosome fragments in the "standard form." For instance, the pattern (w'::y)(:y':)(w::y) would have a pattern string (1::2)(:3:)(4::5) and a label map label_map[1]: label = w, centromere = true; label_map[2]: label = y, centromere = false, etc. The vertices of the multigraph are i and -i, where (i, -i) is the chromosome edge numbered i. The class contains methods for determining final edges, and, for complete patterns, may find all consistent initial edge configurations, a record of the cycles structures taken over all initial edge configurations, the obligate cycle (the minimum cycle structure in the cycle record), and may perform these last two from a static MC approach over a specified number of configuration samplings.


Field Summary
private  CycleRecord cycle_record
           
private  EdgeList final_edges
           
private  InitialEdgeLists init_els
           
private  java.util.Vector[] initial_edge_list_vectors
           
private  LabelCent[] label_map
           
private  java.util.Vector labels
           
private  int length
           
private  java.lang.String pattern_string
           
private  int record_progress
           
private  int record_progress_max
           
static java.lang.String test_pattern
           
 
Constructor Summary
Pattern(java.lang.String pattern)
          Constructor produces a pattern object from the "classical" abberation pattern format, for instance "(2'::5)(:2:)(5'::2)"
Pattern(java.lang.String pattern_string, LabelCent[] label_map)
          Constructor produces a pattern object from a "standard" string, and a label map.
 
Method Summary
 CycleRecord cycleRecord()
          Returns a Cycle Record containing cycles over all possible configurations
 EdgeList finalEdges()
          Returns an EdgeList object composed of the final DSB edges for the pattern.
 LabelCent[] getLabelMap()
          Returns the label map
 java.util.Vector getLabels()
          Gets a Vector of the labels in the pattern.
 int getLength()
          The number of fragments in this pattern.
 java.lang.String getPatternString()
          Returns the pattern string.
 InitialEdgeLists initialEdgeLists()
          Returns the InitialEdgeLists object associated to this aberration pattern.
static void main(java.lang.String[] args)
           
 CycleRecord monteCarloRecord(int iterations)
          Returns a Cycle Record generated by sampling the space of initial edge configurations the number of times specified.
 int numberOfConfigurations()
          Returns the number of possible initial edge configurations
 int numberOfLabels()
          Returns the number of labels involved in the aberration.
 Cycle obligateCycle()
          Returns the obligate cycle generated by sampling all possible configurations.
 Cycle obligateCycleMC(int max)
          Returns the obligate cycle, if the number of configurations is less then max.
 java.lang.String toString()
           
static boolean validInputPattern(java.lang.String pattern)
          Checks if a string is a valid mFISH pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pattern_string

private java.lang.String pattern_string

label_map

private LabelCent[] label_map

length

private int length

labels

private java.util.Vector labels

final_edges

private EdgeList final_edges

initial_edge_list_vectors

private java.util.Vector[] initial_edge_list_vectors

init_els

private InitialEdgeLists init_els

record_progress

private int record_progress

record_progress_max

private int record_progress_max

cycle_record

private CycleRecord cycle_record

test_pattern

public static java.lang.String test_pattern
Constructor Detail

Pattern

public Pattern(java.lang.String pattern_string,
               LabelCent[] label_map)
Constructor produces a pattern object from a "standard" string, and a label map.

Parameters:
pattern_string - "standard" pattern string.
label_map - label map associated to the pattern string.

Pattern

public Pattern(java.lang.String pattern)
Constructor produces a pattern object from the "classical" abberation pattern format, for instance "(2'::5)(:2:)(5'::2)"

Parameters:
pattern - an aberration pattern in the "classical" notation.
Method Detail

getLength

public int getLength()
The number of fragments in this pattern. It is one less than the size of the label_map.

Returns:
number of fragments in the pattern

getPatternString

public java.lang.String getPatternString()
Returns the pattern string.

Returns:
string signifying the final pattern of the chromosome fragments.

getLabelMap

public LabelCent[] getLabelMap()
Returns the label map


getLabels

public java.util.Vector getLabels()
Gets a Vector of the labels in the pattern. First call initializes the private field Vector labels. Returns a vector of the labels involved in the aberration.


numberOfLabels

public int numberOfLabels()
Returns the number of labels involved in the aberration.


finalEdges

public EdgeList finalEdges()
Returns an EdgeList object composed of the final DSB edges for the pattern. This is determined directly from the pattern string.

Returns:
EdgeList of final edges

initialEdgeLists

public InitialEdgeLists initialEdgeLists()
Returns the InitialEdgeLists object associated to this aberration pattern. This object implements Enumeration and can be used to cycle through all possible initial edge configurations. This can also be used to determine the number of possible initial edge configurations.

Returns:
InitialEdgeLists built from EdgeTrees for each label.

cycleRecord

public CycleRecord cycleRecord()
Returns a Cycle Record containing cycles over all possible configurations

Returns:
CycleRecord containing cycles over all possible configurations.

monteCarloRecord

public CycleRecord monteCarloRecord(int iterations)
Returns a Cycle Record generated by sampling the space of initial edge configurations the number of times specified.

Parameters:
iterations - number of samples of space of intial edge configurations.
Returns:
an MC CycleRecord for the specified iterations.

obligateCycle

public Cycle obligateCycle()
Returns the obligate cycle generated by sampling all possible configurations.

Returns:
obligate cycle structure

obligateCycleMC

public Cycle obligateCycleMC(int max)
Returns the obligate cycle, if the number of configurations is less then max. Otherwise, it samples the space of configurations max times and returns the lowest Cycle found.

Returns:
monte carlo obligate cycle.

numberOfConfigurations

public int numberOfConfigurations()
Returns the number of possible initial edge configurations

Returns:
number of possible initial edge configurations

toString

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

validInputPattern

public static boolean validInputPattern(java.lang.String pattern)
Checks if a string is a valid mFISH pattern. That is, rearranged chromosomes are contained in parentheses. Each fragment has a label. "::" indicate a manifest misrejoining. (:3:) indicate a ring. Anything not conforming to this standard will return false. NOTE -- this does not assure all manifest breaks.

Parameters:
pattern - mFISH input string
Returns:
true if valid mFISH, false otherwise.

main

public static void main(java.lang.String[] args)