QualityScoreAndErrorGenerator
Date: 2014-10-01

artificialFastqGenerator

## Class QualityScoreAndErrorGenerator

- java.lang.Object
- - artificialFastqGenerator.QualityScoreAndErrorGenerator

-     public class QualityScoreAndErrorGenerator
      extends java.lang.Object

  An instance of this class can be used to generate (1) ASCII encodings of Phred quality scores for bases in reads; (2) base-call errors. (1) is done by taking quality scores from a pre-existing FASTQ file, and (2) by generating an error with a probability that depends on the base's phred score. Copyright (C) 2012 The Institute of Cancer Research (ICR). This file is part of ArtificialFastqGenerator v1.0.0. ArtificialFastqGenerator is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Public License along with this program. If not, see Authour's contact email: Matthew.Frampton@icr.ac.uk

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char[]` | `encodedSangerQualityScores`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QualityScoreAndErrorGenerator(int readLength, boolean useRealQualityScores, boolean simulateErrorInRead, java.lang.String fastq1ForQualityScoresPath, java.lang.String fastq2ForQualityScoresPath)` Initialise a new QualityScoreAndErrorGenerator object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getNumACGTBasesCalled()` Get the number of ACGT bases.
    `long` | `getNumBaseCallErrors()` Get the number of base call errors that have been simulated.
    `java.util.ArrayList<char[]>` | `getQualityScoresAndGenotypesRead(boolean isLeft, java.util.ArrayList<Nucleobase> nucleobases)` Get the encoded phred quality scores and the genotypes read.
    `void` | `resetNumBaseCallErrors()` Reset the number of simulated base call errors to 0.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### encodedSangerQualityScores

          public static final char[] encodedSangerQualityScores

  - ### Constructor Detail

    - #### QualityScoreAndErrorGenerator

          public QualityScoreAndErrorGenerator(int readLength,
                                       boolean useRealQualityScores,
                                       boolean simulateErrorInRead,
                                       java.lang.String fastq1ForQualityScoresPath,
                                       java.lang.String fastq2ForQualityScoresPath)

      Initialise a new QualityScoreAndErrorGenerator object.
      Parameters:
        `readLength` - - the length of each read.
        `useRealQualityScores` - - true if using quality scores from an existing fastq file, else false.
        `simulateErrorInRead` - - true if simulating error in reads, else false.
        `fastq1ForQualityScoresPath` - - the 1st fastq file whose quality scores are used.
        `fastq2ForQualityScoresPath` - - the 2nd fastq file whose quality scores are used.

  - ### Method Detail

    - #### getQualityScoresAndGenotypesRead

          public java.util.ArrayList<char[]> getQualityScoresAndGenotypesRead(boolean isLeft,
                                                                     java.util.ArrayList<Nucleobase> nucleobases)

      Get the encoded phred quality scores and the genotypes read. If the read is right-end, then it should align to the -ive strand, so reverse nucleobases, and read their complements.
      Parameters:
        `isLeft` - - true if the read is a left read, else false.
        `nucleobases` - - human reference sequence nucleobases which the read is a read of.
      Returns:
        finalQualityScoresAndGenotypesRead - an ArrayList of char arrays containing the final quality scores and the genotypes that get read.

    - #### getNumBaseCallErrors

          public long getNumBaseCallErrors()

      Get the number of base call errors that have been simulated.
      Returns:
        numBaseCallErrors - the number of bases for which base calls have been simulated.

    - #### resetNumBaseCallErrors

          public void resetNumBaseCallErrors()

      Reset the number of simulated base call errors to 0.

    - #### getNumACGTBasesCalled

          public long getNumACGTBasesCalled()

      Get the number of ACGT bases.
      Returns:
        numACGTBaseCalls - the number of ACGT bases that have been called.