ca.cas.painting
Class WholeChromPaint

java.lang.Object
  extended by ca.cas.painting.WholeChromPaint
All Implemented Interfaces:
Paint

public class WholeChromPaint
extends java.lang.Object
implements Paint

A whole chromosome Paint. This class can be used to simulate any whole chromosome painting scheme (such mFISH, FISH, 2-FISH, any mapping from the set of chromosomes to a set of colors). Also includes functionality for counterstaining and centromere probes. Defaults are no counterstain and centromere probes.


Constructor Summary
WholeChromPaint(boolean track_centromeres, boolean counterstain, java.lang.String counterstain_label)
          creates a whole chromosome paint.
 
Method Summary
 Fragment agglomerate(Fragment first, Fragment second)
          Determines whether the two fragments span a cryptic break.
 boolean appearsWhole(FPChrom fpchrom)
          Returns true if the final pattern chromosome appears whole.
 boolean counterstain()
          returns true if the paint uses a counterstain
 boolean hasCentromere(long source, long target, long centromere)
          returns true if source and target are on opposite sides of centromere.
 boolean isCounterstained(Fragment frag)
          Returns true if the fragment is counterstained.
 boolean isOriented()
          returns true if the Painting scheme is oriented.
 Fragment paint(AbEdge chrom_edge)
          returns the same result as paint(chrom_edge.getSource(), chrom_edge.getTarget())
 Fragment paint(AbVertex source, AbVertex target)
          returns the fragment associated to the chromatin edge that would span the source and target vertices.
 java.lang.String setPaint(Chromosome c, java.lang.String label)
          creates a whole chromosome paint with centromere probes and no counterstain.
 boolean trackCentromeres()
          returns true if the Paint records centromeres
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WholeChromPaint

public WholeChromPaint(boolean track_centromeres,
                       boolean counterstain,
                       java.lang.String counterstain_label)
creates a whole chromosome paint.

Parameters:
track_centromeres - keep track of centromeres
counterstain - counterstain unpainted chromosomes.
counterstain_label - what ``paint'' to apply to counterstained chromosomes.
Method Detail

setPaint

public java.lang.String setPaint(Chromosome c,
                                 java.lang.String label)
creates a whole chromosome paint with centromere probes and no counterstain. public WholeChromPaint() { } /** sets the paint label from a chromosome.

Parameters:
c - chromosome
label - label for that chromosome
Returns:
previous label associated with c, or null if there was no label for c.

isOriented

public boolean isOriented()
Description copied from interface: Paint
returns true if the Painting scheme is oriented. For instance, FISH is unoreinted, but banding is oriented. In particular, if paint(AbVertex, AbVertex) is independent of the order then the Paint is unoriented.

Specified by:
isOriented in interface Paint
Returns:
true if the Paint is oriented, else false.

counterstain

public boolean counterstain()
Description copied from interface: Paint
returns true if the paint uses a counterstain

Specified by:
counterstain in interface Paint
Returns:
true if the paint uses a counterstain, else false.

trackCentromeres

public boolean trackCentromeres()
Description copied from interface: Paint
returns true if the Paint records centromeres

Specified by:
trackCentromeres in interface Paint
Returns:
true if the paint records centromere, else false.

paint

public Fragment paint(AbEdge chrom_edge)
Description copied from interface: Paint
returns the same result as paint(chrom_edge.getSource(), chrom_edge.getTarget())

Specified by:
paint in interface Paint
Parameters:
chrom_edge - chromatin edge
Returns:
painted version of chromatin edge

paint

public Fragment paint(AbVertex source,
                      AbVertex target)
returns the fragment associated to the chromatin edge that would span the source and target vertices. if they are not on the same chromosome, the method returns null. if they are on the same chromosome, it returns a Fragment with a label accorded by this paint to that chromosome, a length according to the difference between the source and target vertex locations, and a centromere flag according to whether these two locations fall on opposite sides of the chromosome.

Specified by:
paint in interface Paint
Parameters:
source - source vertex
target - target vertex
Returns:
Fragment label associated to the chromatin edge that would span the source and target vertices.

agglomerate

public Fragment agglomerate(Fragment first,
                            Fragment second)
Determines whether the two fragments span a cryptic break. In a whole chromosome paint, this happens when they both have the same label and there is no more than one centromere between them. If this is true, then the method returns a Fragment with the same label, a centromere if either fragment had a centromere, and a length equal to the sum of the two lengths.

Specified by:
agglomerate in interface Paint
Parameters:
first - first fragment
second - second fragment
Returns:
agglomeration of the two fragments, or if not agglomerable, null

appearsWhole

public boolean appearsWhole(FPChrom fpchrom)
Returns true if the final pattern chromosome appears whole. This is true if the chromosome is not a ring, has only one fragment and that fragment has a centromere (if we're tracking centromeres). This method will need some work before we use it to paint circular genomes.

Specified by:
appearsWhole in interface Paint
Parameters:
fpchrom - final pattern chromosome
Returns:
true if the final pattern chromosome appears whole

isCounterstained

public boolean isCounterstained(Fragment frag)
Returns true if the fragment is counterstained. In particular, if it has the counterstain as its label.

Specified by:
isCounterstained in interface Paint
Parameters:
frag - fragment
Returns:
true if the fragment is counterstained.

hasCentromere

public boolean hasCentromere(long source,
                             long target,
                             long centromere)
returns true if source and target are on opposite sides of centromere.

Parameters:
source -
target -
centromere -
Returns:
true if centromere lies between source and target, else false.