Class AbstractSimpleSampleTest

    • 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 test
        description - description of the test
        columnName - 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 test
        description - description of the test
        columnName - column name of the test
        unit - 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 read
        readSample - index of read without indexed reads
        sampleId - the id of the sample
        lane - sample lane
        undetermined - 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 transform
        data - run data
        read - index of read
        readSample - index of read without indexed reads
        sampleId - 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 transform
        data - run data
        read - index of read
        readSample - index of read without indexed reads
        sampleId - 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 object
        read - index of read
        readSample - index of read without indexed reads
        sampleId - the sample id of the sample to test.
        Returns:
        a TestResult object with the result of the test