Class AbstractSimpleSampleTest
- java.lang.Object
-
- fr.ens.biologie.genomique.aozan.tests.sample.AbstractSampleTest
-
- fr.ens.biologie.genomique.aozan.tests.sample.AbstractSimpleSampleTest
-
- All Implemented Interfaces:
AozanTest
,SampleTest
- Direct Known Subclasses:
FastQScreenMappedExceptRefGenomeSampleTest
,FastQScreenMappedPercentSampleTest
,GenomeNamesSampleTest
,PFClusterCountSampleTest
,RawClusterCountSampleTest
,RecoverablePFClusterCountSampleTest
,RecoverableRawClusterCountSampleTest
public abstract class AbstractSimpleSampleTest extends AbstractSampleTest
This class define a simple sample test.- Since:
- 0.8
- Author:
- Laurent Jourdren
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSimpleSampleTest(String name, String description, String columnName)
Constructor that set the field of this abstract test.protected
AbstractSimpleSampleTest(String name, String description, String columnName, String unit)
Constructor that set the field of this abstract test.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<AozanTest>
configure(TestConfiguration conf)
Configure the test.protected abstract String
getKey(int read, int readSample, int sampleId, int lane, boolean undetermined)
Get the the key in the RunData object for the value to test.protected abstract Class<?>
getValueType()
Get the type of the value.protected boolean
isValuePercent()
Test if the value is a percent.TestResult
test(RunData data, int read, int readSample, int sampleId)
Do a test.protected int
transformScore(int score, RunData data, int read, int readSample, int sampleId)
Transform the score.protected Number
transformValue(Number value, RunData data, int read, int readSample, int sampleId)
Transform the value.-
Methods inherited from class fr.ens.biologie.genomique.aozan.tests.sample.AbstractSampleTest
getColumnName, getDescription, getName, getUnit, init
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.ens.biologie.genomique.aozan.tests.AozanTest
getCollectorsNamesRequiered
-
-
-
-
Constructor Detail
-
AbstractSimpleSampleTest
protected AbstractSimpleSampleTest(String name, String description, String columnName)
Constructor that set the field of this abstract test.- Parameters:
name
- name of the testdescription
- description of the testcolumnName
- column name of the test
-
AbstractSimpleSampleTest
protected AbstractSimpleSampleTest(String name, String description, String columnName, String unit)
Constructor that set the field of this abstract test.- Parameters:
name
- name of the testdescription
- description of the testcolumnName
- column name of the testunit
- unit of the test
-
-
Method Detail
-
getKey
protected abstract String getKey(int read, int readSample, int sampleId, int lane, boolean undetermined)
Get the the key in the RunData object for the value to test.- Parameters:
read
- index of the readreadSample
- index of read without indexed readssampleId
- the id of the samplelane
- sample laneundetermined
- true if the sample is an undetermined sample- Returns:
- a String with the required key
-
transformValue
protected Number transformValue(Number value, RunData data, int read, int readSample, int sampleId)
Transform the value.- Parameters:
value
- value to transformdata
- run dataread
- index of readreadSample
- index of read without indexed readssampleId
- the sample Id- Returns:
- the transformed value
-
transformScore
protected int transformScore(int score, RunData data, int read, int readSample, int sampleId)
Transform the score.- Parameters:
score
- value to transformdata
- run dataread
- index of readreadSample
- index of read without indexed readssampleId
- the sample id- Returns:
- the transformed score
-
isValuePercent
protected boolean isValuePercent()
Test if the value is a percent.- Returns:
- true if the value is a percent
-
getValueType
protected abstract Class<?> getValueType()
Get the type of the value.- Returns:
- a Class object with the type
-
test
public TestResult test(RunData data, int read, int readSample, int sampleId)
Description copied from interface:SampleTest
Do a test.- Parameters:
data
- result objectread
- index of readreadSample
- index of read without indexed readssampleId
- the sample id of the sample to test.- Returns:
- a TestResult object with the result of the test
-
configure
public List<AozanTest> configure(TestConfiguration conf) throws AozanException
Description copied from interface:AozanTest
Configure the test.- Parameters:
conf
- the test configuration- Returns:
- list of Aozan tests
- Throws:
AozanException
-
-