uk.ac.sanger.cgp.standalonecsa.beans
Class AmplimerBean

java.lang.Object
  extended by uk.ac.sanger.cgp.standalonecsa.beans.AmplimerBean
All Implemented Interfaces:
java.io.Serializable

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

This object handles information pertaining to the amplimer and any associated mappings. In addition it will validate inputs such as amplimer sequence validity and coordinates

Author:
Original: kr2, $Author: kr2 $
See Also:
Serialized Form

Field Summary
static java.lang.String VALID_RESIDUES
          Static list of valid residues for DNA sequence, including ambiguity codes.
 
Constructor Summary
protected AmplimerBean()
          Creates a new instance of AmplimerBean, not for general use.
  AmplimerBean(java.lang.String amplimerName, java.lang.String amplimer, int[] roi)
          Generates a new AmplimerBean using the following parameters
  AmplimerBean(java.lang.String amplimerName, java.lang.String amplimer, java.lang.Integer roiStart, java.lang.Integer roiStop)
          Generates a new AmplimerBean using the following parameters
  AmplimerBean(java.lang.String amplimerName, java.lang.String amplimer, java.lang.String roi, CdsBean cds)
          Generates a new AmplimerBean using the following parameters
 
Method Summary
 java.lang.Integer getAmpLength()
          Gets the length of the amplimer.
 java.lang.String getAmplimer()
          Returns the currently set amplimer as a string.
 java.lang.String getAmplimer(int lineSize)
          Returns the currently set amplimer as a formatted string with width as defined by lineSize.
 java.lang.String getAmplimerName()
          Gets the amplimer name.
 java.lang.Boolean getAmplimerReversed()
          Indicated if the amplimer need to be reverse complimented to match the CDS sequence.
 CdsBean getCds()
          Gets the CdsBean object assigned to this amplimer.
 java.lang.Integer getCdsStart()
          Gets the position of the cds that the amplimer starts to match (indexed from 1).
 java.lang.Integer getCdsStartIndex()
          Gets the position of the cds that the amplimer starts to match (indexed from 0).
 java.lang.Integer getCodingStart()
          Gets the start of the coding portion of the amplimer (indexed from 1).
 java.lang.Integer getCodingStartIndex()
          Gets the start of the coding portion of the amplimer (indexed from 0).
 java.lang.Integer getCodingStop()
          Gets the stop of the coding portion of the amplimer (indexed from 1).
 java.lang.Integer getCodingStopIndex()
          Gets the stop of the coding portion of the amplimer (indexed from 0).
 java.lang.String getMapsToCds()
          The name of the CDS that this amplimer should map to.
 int[] getRoi()
          Gets the current region of interest.
 java.lang.Integer getRoiStart()
          Gets the current start position of the ROI on the amplimer.
 java.lang.Integer getRoiStop()
          Gets the current stop position of the ROI on the amplimer.
 void setAmplimer(java.lang.String amplimer)
          Set the amplimer to the provided string.
 void setAmplimerName(java.lang.String amplimerName)
          Sets the amplimer name.
 void setRoi(int[] roi)
          int[] wrapper of setRoi(Integer roiStart, Integer roiStop).
protected  void setRoi(java.lang.Integer roiStart, java.lang.Integer roiStop)
          Sets the region of interest to the provided values.
protected  void setRoi(java.lang.String roi)
          String wrapper of setRoi(Integer roiStart, Integer roiStop)
protected  void setRoiStart(java.lang.Integer roiStart)
          Sets the roi start position on the amplimer
protected  void setRoiStop(java.lang.Integer roiStop)
          Sets the roi stop position on the amplimer
 java.lang.String toString()
          Gives a basic string representation of this object.
static boolean validateResidues(java.lang.String amplimer)
          Validates that the input string only contains DNA residues recognised by AutoCSA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALID_RESIDUES

public static final java.lang.String VALID_RESIDUES
Static list of valid residues for DNA sequence, including ambiguity codes.

See Also:
Constant Field Values
Constructor Detail

AmplimerBean

protected AmplimerBean()
Creates a new instance of AmplimerBean, not for general use.


AmplimerBean

public AmplimerBean(java.lang.String amplimerName,
                    java.lang.String amplimer,
                    java.lang.String roi,
                    CdsBean cds)
Generates a new AmplimerBean using the following parameters

Parameters:
amplimerName - the name for the amplimer
amplimer - the amplimer sequence
roi - the region of interest as 2 comma separated values e.g. 15,70
cds - the CdsBean that this amplimer should map to

AmplimerBean

public AmplimerBean(java.lang.String amplimerName,
                    java.lang.String amplimer,
                    int[] roi)
Generates a new AmplimerBean using the following parameters

Parameters:
amplimerName - the name for the amplimer
amplimer - the amplimer sequence
roi - the region of interest as a 2 value int[]

AmplimerBean

public AmplimerBean(java.lang.String amplimerName,
                    java.lang.String amplimer,
                    java.lang.Integer roiStart,
                    java.lang.Integer roiStop)
Generates a new AmplimerBean using the following parameters

Parameters:
amplimerName - the name for the amplimer
amplimer - the amplimer sequence
roiStart - start position for region of interest
roiStop - stop position for region of interest
Method Detail

getAmplimer

public java.lang.String getAmplimer()
Returns the currently set amplimer as a string.

Returns:
amplimer as a string

getAmplimer

public java.lang.String getAmplimer(int lineSize)
Returns the currently set amplimer as a formatted string with width as defined by lineSize.

Parameters:
lineSize - number of characters to each line
Returns:
amplimer as a formatted string with width as defined by lineSize

setAmplimer

public void setAmplimer(java.lang.String amplimer)
Set the amplimer to the provided string.

Parameters:
amplimer - the amplimer to be set

getAmpLength

public java.lang.Integer getAmpLength()
Gets the length of the amplimer.

Returns:
length of the amplimer

setRoi

protected void setRoi(java.lang.Integer roiStart,
                      java.lang.Integer roiStop)
Sets the region of interest to the provided values. The values will be inverted if start is grater than stop. Wraps setRoiStart(Integer roiStart) and setRoiStop(Integer roiStop).

Parameters:
roiStart - the start position for the region of interest within the amplimer (index from 1)
roiStop - the stop position for the region of interest within the amplimer (index from 1)

setRoi

protected void setRoi(java.lang.String roi)
String wrapper of setRoi(Integer roiStart, Integer roiStop)

Parameters:
roi - the region of interest as 2 comma separated values e.g. 15,70

setRoi

public void setRoi(int[] roi)
int[] wrapper of setRoi(Integer roiStart, Integer roiStop).

Parameters:
roi - the region of interest as 2 comma separated values e.g. 15,70

getRoi

public int[] getRoi()
Gets the current region of interest.

Returns:
roi int[] of start and stop coordinates (indexed from 1)

getRoiStart

public java.lang.Integer getRoiStart()
Gets the current start position of the ROI on the amplimer.

Returns:
roiStart the start position on the amplimer (indexed from 1)

setRoiStart

protected void setRoiStart(java.lang.Integer roiStart)
Sets the roi start position on the amplimer

Parameters:
roiStart - the start position on the amplimer (indexed from 1)

getRoiStop

public java.lang.Integer getRoiStop()
Gets the current stop position of the ROI on the amplimer.

Returns:
roiStop the stop position on the amplimer (indexed from 1)

setRoiStop

protected void setRoiStop(java.lang.Integer roiStop)
Sets the roi stop position on the amplimer

Parameters:
roiStop - the stop position on the amplimer (indexed from 1)

getAmplimerName

public java.lang.String getAmplimerName()
Gets the amplimer name.

Returns:
amplimerName the name of the amplimer

setAmplimerName

public void setAmplimerName(java.lang.String amplimerName)
Sets the amplimer name.

Parameters:
amplimerName - the name of the amplimer

getCodingStartIndex

public java.lang.Integer getCodingStartIndex()
Gets the start of the coding portion of the amplimer (indexed from 0). When null setupCds() is called for lazy loading.

Returns:
codingStartIndex the start of the coding portion of the amplimer (indexed from 0)

getCodingStopIndex

public java.lang.Integer getCodingStopIndex()
Gets the stop of the coding portion of the amplimer (indexed from 0). When null setupCds() is called for lazy loading.

Returns:
codingStopIndex the stop of the coding portion of the amplimer (indexed from 0)

getMapsToCds

public java.lang.String getMapsToCds()
The name of the CDS that this amplimer should map to.

Returns:
mapsToCsd the name of the CDS

validateResidues

public static boolean validateResidues(java.lang.String amplimer)
Validates that the input string only contains DNA residues recognised by AutoCSA.

Parameters:
amplimer - the string to be checked for validity
Returns:
result true when all residues are valid

getCdsStartIndex

public java.lang.Integer getCdsStartIndex()
Gets the position of the cds that the amplimer starts to match (indexed from 0). When null setupCds() is called for lazy loading.

Returns:
cdsStartIndex start position in CDS (indexed from 0)

getAmplimerReversed

public java.lang.Boolean getAmplimerReversed()
Indicated if the amplimer need to be reverse complimented to match the CDS sequence.

Returns:
true when reverse compliment was required

getCds

public CdsBean getCds()
Gets the CdsBean object assigned to this amplimer.

Returns:
the CdsBean for this amplimer

getCodingStart

public java.lang.Integer getCodingStart()
Gets the start of the coding portion of the amplimer (indexed from 1). When null getCodingStartIndex() is called.

Returns:
the start of the coding portion of the amplimer (indexed from 1)

getCodingStop

public java.lang.Integer getCodingStop()
Gets the stop of the coding portion of the amplimer (indexed from 1). When null getCodingStopIndex() is called.

Returns:
the stop of the coding portion of the amplimer (indexed from 1)

getCdsStart

public java.lang.Integer getCdsStart()
Gets the position of the cds that the amplimer starts to match (indexed from 1). When null setupCds() is called for lazy loading.

Returns:
cdsStartIndex start position in CDS (indexed from 1)

toString

public java.lang.String toString()
Gives a basic string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a basic string representation of this object