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

java.lang.Object
  extended by uk.ac.sanger.cgp.standalonecsa.beans.ExperimentBean
All Implemented Interfaces:
java.lang.Comparable

public class ExperimentBean
extends java.lang.Object
implements java.lang.Comparable

Holds all information regarding an experiment (sequencing trace). Many of the boolean fields are provided for use by the Velocity Template engine as null cannot be tested for in the return of a method (velocity assumes that the method does not exist if it returns null).

Author:
Original: kr2, $Author: kr2 $

Constructor Summary
ExperimentBean(uk.ac.sanger.cgp.autocsa.interfaces.TraceDetailsInterface tdi)
          Creates a new instance of ExperimentBean.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getAmplimerName()
          Gets the amplimer name
 ExperimentBean getComplimentExp()
          The ExperimentBean of any compliment experiment, requires correct use of runNumber for experiment pairing.
 java.lang.String getComplimentFileName()
          The file name of any compliment experiment, requires correct use of runNumber for experiment pairing.
 uk.ac.sanger.cgp.autocsa.beans.CSAOutput getCompResult()
          Get the result of a comparison.
 java.lang.Float getCsaSelectionScore()
          Get csaSelectionScore.
 int getCsaSelectionScorePrim()
          Get csaSelectionScore as a primitive int.
 uk.ac.sanger.cgp.autocsa.interfaces.CsaTraceInterface getCsaTrace()
          Get the CsaTrace object.
 java.lang.String getDnaName()
          Get the DNA/sample name.
 CsaError getError()
          Get any CsaError that may have been handled during analysis.
 java.lang.Throwable getException()
          Get any exception that may have been handled on the creation of a CsaError.
 java.lang.String getFileNoPath()
          Returns the name of the file linked to this experiment with no path.
 java.lang.String getFileNoPathOrExtension()
          Gets the filename with no path or extension.
 java.lang.Integer getRunNumber()
          Get run of this experiment, used to pair sense and antisense experiments when multiple sequence traces are provided.
 int getStrandPreFlaggingCountStatus()
          Flagging parameter, here for convenience.
 uk.ac.sanger.cgp.autocsa.interfaces.TraceDetailsInterface getTraceDetails()
          Get the TraceDetails object
 java.lang.String getTraceStatus()
          Textual description of the experiment status.
 java.lang.String getUniqueNameForFile()
          Returns a unique name for a result.
 java.lang.String getUniqueNameForVariant()
          Returns a unique name for a variant see setVariantToRender(Mutation variantToRender).
 java.util.Map getVariantGroups()
          Get the map of different classes of variant.
 uk.ac.sanger.cgp.autocsa.beans.Mutation getVariantToRender()
          Get the current variant being rendered.
 int hashCode()
           
 boolean isBest()
          Applies to wildtype traces only, indicates if this is the current best wildtype experiment based on csaSelectionScore.
 boolean isCompared()
          Indicates if the experiment has been used in a comparison.
 boolean isComplimentPresent()
          Indicates that a compliment experiment is avilable, requires correct use of runNumber for experiment pairing.
 boolean isFlagAssessed()
          True when flagging has been attempted on this experiment.
 boolean isOthersPresent()
          Indicates when non-substitution variants are available.
 boolean isSense()
          True when this experiment was sequenced in the sense direction (with respect to the amplimer sequence).
 boolean isSubsPresent()
          Indicates when substitution variants are available.
 boolean isWildtype()
          True when a wildtype experiment.
 void setAmplimerName(java.lang.String amplimerName)
          Set the amplimerName to the provided string
 void setBest(boolean best)
          Set this experiment as best.
 void setComplimentExp(ExperimentBean complimentExp)
          Set the ExperimentBean of any compliment experiment, requires correct use of runNumber for experiment pairing.
 void setCompResult(uk.ac.sanger.cgp.autocsa.beans.CSAOutput compResult)
          Set the CSAOutput, result of a comparison.
 void setCsaSelectionScore(java.lang.Float csaSelectionScore)
          Set csaSelectionScore.
 void setCsaTrace(uk.ac.sanger.cgp.autocsa.interfaces.CsaTraceInterface csaTrace)
          Set the CsaTrace object.
 void setDnaName(java.lang.String dnaName)
          Set the dna name
 void setError(CsaError error)
          Set any CsaError that may have been handled during analysis.
 void setError(CsaError error, java.lang.Throwable exception)
          Set any CsaError that may have been handled during analysis, along with any associated exception.
 void setFlagAssessed(boolean flagAssessed)
          True when flagging has been attempted on this experiment.
 void setOthersPresent(boolean othersPresent)
          Set indicator for when non-substitution variants are available.
 void setRunNumber(java.lang.Integer runNumber)
          Set run of this experiment, used to pair sense and antisense experiments when multiple sequence traces are provided.
 void setRunNumber(java.lang.String runNumber)
          Set run of this experiment, used to pair sense and antisense experiments when multiple sequence traces are provided.
 void setSense(char direction)
          Set the sequencing direction with respect to the amplimer.
 void setStrandPreFlaggingCountStatus(int strandPreFlaggingCountStatus)
          Flagging parameter, here for convenience.
 void setSubsPresent(boolean subsPresent)
          Set indicator for when substitution variants are available.
 void setTraceDetails(uk.ac.sanger.cgp.autocsa.interfaces.TraceDetailsInterface traceDetails)
          Set the TraceDetails object
 void setTraceStatus(java.lang.String traceStatus)
          Set a textual description of the experiment status.
 void setVariantToRender(uk.ac.sanger.cgp.autocsa.beans.Mutation variantToRender)
          Set the variant to be rendered.
 void setWildtype(boolean wildtype)
          Set the wildtype indicator
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExperimentBean

public ExperimentBean(uk.ac.sanger.cgp.autocsa.interfaces.TraceDetailsInterface tdi)
Creates a new instance of ExperimentBean. The basic components of the object are constructed from the file name contained in the TraceDetails object.

Parameters:
tdi - a TraceDetails object populated with filePositionFromRoot
Method Detail

getFileNoPathOrExtension

public java.lang.String getFileNoPathOrExtension()
Gets the filename with no path or extension.

Returns:
string representation of the filename with no path or extension

getAmplimerName

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

Returns:
the amplimer name as a string

setAmplimerName

public void setAmplimerName(java.lang.String amplimerName)
Set the amplimerName to the provided string

Parameters:
amplimerName - the name of the amplimer associated with this experiment

getDnaName

public java.lang.String getDnaName()
Get the DNA/sample name.

Returns:
the name of the DNA/sample associated with this experiment

setDnaName

public void setDnaName(java.lang.String dnaName)
Set the dna name

Parameters:
dnaName - the name of the DNA/sample associated with this experiment

isSense

public boolean isSense()
True when this experiment was sequenced in the sense direction (with respect to the amplimer sequence).

Returns:
true when this experiment was sequenced in the sense direction

setSense

public void setSense(char direction)
Set the sequencing direction with respect to the amplimer.

Parameters:
direction - f for sense/forward, r for antisense/reverse

getUniqueNameForVariant

public java.lang.String getUniqueNameForVariant()
Returns a unique name for a variant see setVariantToRender(Mutation variantToRender).

Returns:
a unique name suitable for files

getUniqueNameForFile

public java.lang.String getUniqueNameForFile()
Returns a unique name for a result. Constructed from - getDnaName() - getRunNumber() - getTraceDetails().getForwardOrReverseStrand()

Returns:
a unique name suitable for files

getRunNumber

public java.lang.Integer getRunNumber()
Get run of this experiment, used to pair sense and antisense experiments when multiple sequence traces are provided.

Returns:
run number of this experiment

setRunNumber

public void setRunNumber(java.lang.String runNumber)
Set run of this experiment, used to pair sense and antisense experiments when multiple sequence traces are provided. Wraps setRunNumber(Integer runNumber)

Parameters:
runNumber - run number of this experiment

setRunNumber

public void setRunNumber(java.lang.Integer runNumber)
Set run of this experiment, used to pair sense and antisense experiments when multiple sequence traces are provided.

Parameters:
runNumber - run number of this experiment

getTraceDetails

public uk.ac.sanger.cgp.autocsa.interfaces.TraceDetailsInterface getTraceDetails()
Get the TraceDetails object

Returns:
the TraceDetails object

setTraceDetails

public void setTraceDetails(uk.ac.sanger.cgp.autocsa.interfaces.TraceDetailsInterface traceDetails)
Set the TraceDetails object

Parameters:
traceDetails - the TraceDetails object

isWildtype

public boolean isWildtype()
True when a wildtype experiment.

Returns:
true when a wildtype experiment

setWildtype

public void setWildtype(boolean wildtype)
Set the wildtype indicator

Parameters:
wildtype - true when wildtype sample/DNA

getFileNoPath

public java.lang.String getFileNoPath()
Returns the name of the file linked to this experiment with no path.

Returns:
the name of the file linked to this experiment with no path

getError

public CsaError getError()
Get any CsaError that may have been handled during analysis.

Returns:
a CsaError

setError

public void setError(CsaError error)
Set any CsaError that may have been handled during analysis.

Parameters:
error - a CsaError

setError

public void setError(CsaError error,
                     java.lang.Throwable exception)
Set any CsaError that may have been handled during analysis, along with any associated exception.

Parameters:
error - a CsaError
exception - any exception that was thrown when this type of CsaError was created

getException

public java.lang.Throwable getException()
Get any exception that may have been handled on the creation of a CsaError.

Returns:
some form of exception

getCsaSelectionScorePrim

public int getCsaSelectionScorePrim()
Get csaSelectionScore as a primitive int.

Returns:
an int representation of csaSelectionScore

getCsaSelectionScore

public java.lang.Float getCsaSelectionScore()
Get csaSelectionScore.

Returns:
csaSelectionScore

setCsaSelectionScore

public void setCsaSelectionScore(java.lang.Float csaSelectionScore)
Set csaSelectionScore.

Parameters:
csaSelectionScore - csaSelectionScore

getCsaTrace

public uk.ac.sanger.cgp.autocsa.interfaces.CsaTraceInterface getCsaTrace()
Get the CsaTrace object.

Returns:
the CsaTrace object

setCsaTrace

public void setCsaTrace(uk.ac.sanger.cgp.autocsa.interfaces.CsaTraceInterface csaTrace)
Set the CsaTrace object.

Parameters:
csaTrace - a CsaTrace implementation

getCompResult

public uk.ac.sanger.cgp.autocsa.beans.CSAOutput getCompResult()
Get the result of a comparison.

Returns:
a CSAOutput object

setCompResult

public void setCompResult(uk.ac.sanger.cgp.autocsa.beans.CSAOutput compResult)
Set the CSAOutput, result of a comparison.

Parameters:
compResult - a CSAOutput object

isCompared

public boolean isCompared()
Indicates if the experiment has been used in a comparison.

Returns:
true when used in a comparison

getTraceStatus

public java.lang.String getTraceStatus()
Textual description of the experiment status.

Returns:
textual description of the experiment status

setTraceStatus

public void setTraceStatus(java.lang.String traceStatus)
Set a textual description of the experiment status.

Parameters:
traceStatus - textual description of the experiment status

isBest

public boolean isBest()
Applies to wildtype traces only, indicates if this is the current best wildtype experiment based on csaSelectionScore.

Returns:
true when current best wildtype

setBest

public void setBest(boolean best)
Set this experiment as best.

Parameters:
best - true when best wildtype experiment

getComplimentFileName

public java.lang.String getComplimentFileName()
The file name of any compliment experiment, requires correct use of runNumber for experiment pairing.

Returns:
the file name of any compliment experiment

getComplimentExp

public ExperimentBean getComplimentExp()
The ExperimentBean of any compliment experiment, requires correct use of runNumber for experiment pairing.

Returns:
an ExperimentBean of any compliment experiment

setComplimentExp

public void setComplimentExp(ExperimentBean complimentExp)
Set the ExperimentBean of any compliment experiment, requires correct use of runNumber for experiment pairing.

Parameters:
complimentExp - an ExperimentBean of any compliment experiment

isComplimentPresent

public boolean isComplimentPresent()
Indicates that a compliment experiment is avilable, requires correct use of runNumber for experiment pairing.

Returns:
true when a compliment experiment is available

getVariantToRender

public uk.ac.sanger.cgp.autocsa.beans.Mutation getVariantToRender()
Get the current variant being rendered.

Returns:
the variant being rendered

getVariantGroups

public java.util.Map getVariantGroups()
Get the map of different classes of variant.

Returns:
a map of variants

setVariantToRender

public void setVariantToRender(uk.ac.sanger.cgp.autocsa.beans.Mutation variantToRender)
Set the variant to be rendered.

Parameters:
variantToRender - variant to render

isSubsPresent

public boolean isSubsPresent()
Indicates when substitution variants are available.

Returns:
true when substitution variants are available

setSubsPresent

public void setSubsPresent(boolean subsPresent)
Set indicator for when substitution variants are available.

Parameters:
subsPresent - true when substitution variants are available

isOthersPresent

public boolean isOthersPresent()
Indicates when non-substitution variants are available.

Returns:
true when non-substitution variants are available

setOthersPresent

public void setOthersPresent(boolean othersPresent)
Set indicator for when non-substitution variants are available.

Parameters:
othersPresent - true when non-substitution variants are available

getStrandPreFlaggingCountStatus

public int getStrandPreFlaggingCountStatus()
Flagging parameter, here for convenience. Indicates if trace is:
- Pass
- Useful
- Useless
- Fail
See Constants.PreFlagging

Returns:
constant controlled status, see Constants.PreFlagging

setStrandPreFlaggingCountStatus

public void setStrandPreFlaggingCountStatus(int strandPreFlaggingCountStatus)
Flagging parameter, here for convenience. Indicates if trace is:
- Pass
- Useful
- Useless
- Fail
See Constants.PreFlagging

Parameters:
strandPreFlaggingCountStatus - constant controlled status, see Constants.PreFlagging

isFlagAssessed

public boolean isFlagAssessed()
True when flagging has been attempted on this experiment.

Returns:
true when flagging has been attempted on this experiment

setFlagAssessed

public void setFlagAssessed(boolean flagAssessed)
True when flagging has been attempted on this experiment.

Parameters:
flagAssessed - true when flagging has been attempted on this experiment

toString

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

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object