com.objex.progeny.anywhere.data
Class Chromosome

java.lang.Object
  extended by com.objex.progeny.anywhere.data.Chromosome
All Implemented Interfaces:
java.io.Serializable

public class Chromosome
extends java.lang.Object
implements java.io.Serializable

A chromosome contains a set of genetic markers placed at specific genetic distances between one another. The genetic distance can be measured in terms of base pairs
or in terms of centimorgans (cM) Chromosome is a java bean so that it can be be used to store and/or transfer data through serialization.

See Also:
ChromosomeMarker, Allele, Serialized Form

Constructor Summary
Chromosome()
          Creates a new Chromosome instance.
 
Method Summary
 void addMarker(ChromosomeMarker marker)
          Adds the specified marker to the list of markers making up this Chromosome exists.
 Chromosome cloneChromosome()
           
 int getId()
           
 ChromosomeMarker getMarker(java.lang.String name)
           
 java.util.Map<java.lang.String,ChromosomeMarker> getMarkers()
          Get a map of markers within this chromosome.
 java.lang.String getName()
          Getter for property name.
 int getNextMarkerSequence()
          Getter for property nextMarkerSequence.
 java.util.Iterator<ChromosomeMarker> iterator()
           
 int markersCount()
           
 void setId(int id)
          Sets a new ID for the chromosome
 void setMarkers(java.util.Map<java.lang.String,ChromosomeMarker> rhs)
          Set the list/map of markers for this chromosome.
 void setName(java.lang.String rhs)
          Setter for property name.
 void setNextMarkerSequence(int rhs)
          Setter for property nextMarkerSequence.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chromosome

public Chromosome()
Creates a new Chromosome instance. A chromosome with default name of "1" is created

Method Detail

toString

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

getMarker

public ChromosomeMarker getMarker(java.lang.String name)
Parameters:
name - The marker ID or name
Returns:
A Marker whose name is specified or NULL if no such marker with that name exists

addMarker

public void addMarker(ChromosomeMarker marker)
Adds the specified marker to the list of markers making up this Chromosome exists.

Parameters:
marker - The new marker to be added

getMarkers

public java.util.Map<java.lang.String,ChromosomeMarker> getMarkers()
Get a map of markers within this chromosome. The marker name is the key used to retrieve markers form the map.

Returns:
Amap of markers within this chromosome. The marker name is the key used to retrieve markers form the map. The map is an ordered treemap where the markers are ordered by sequence number

setMarkers

public void setMarkers(java.util.Map<java.lang.String,ChromosomeMarker> rhs)
Set the list/map of markers for this chromosome. The marker name is the key used to retrieve markers form the map.

Parameters:
rhs - A map containg the new markers for the chromosome

getName

public java.lang.String getName()
Getter for property name. Default ID/Name for chromosome is "1"

Returns:
Value of property name. The name of the Chromosome e.g. X, Y or some other ID

setName

public void setName(java.lang.String rhs)
Setter for property name. Sets the name of the Chromosome e.g. X, Y or some other ID. Default ID/Name for chromosome is "1"

Parameters:
rhs - New value of property name.

getNextMarkerSequence

public int getNextMarkerSequence()
Getter for property nextMarkerSequence.

Returns:
Value of property nextMarkerSequence.

setNextMarkerSequence

public void setNextMarkerSequence(int rhs)
Setter for property nextMarkerSequence.

Parameters:
rhs - New value of property nextMarkerSequence.

cloneChromosome

public Chromosome cloneChromosome()
Returns:
create a new Chromosome with the same marker sets and alleles and this chromosome

markersCount

public int markersCount()
Returns:
Number of markers on this chromosome

iterator

public java.util.Iterator<ChromosomeMarker> iterator()
Returns:
An iterator of markers on this chromsome in marker sequence order

getId

public int getId()
Returns:
The chromosome ID

setId

public void setId(int id)
Sets a new ID for the chromosome

Parameters:
id - The new ID for the chromosome