ArtificialFastqGenerationUtils
Date: 2014-10-01

artificialFastqGenerator

## Class ArtificialFastqGenerationUtils

- java.lang.Object
- - artificialFastqGenerator.ArtificialFastqGenerationUtils

-     public class ArtificialFastqGenerationUtils
      extends java.lang.Object

  ArtificialFastqGenerationUtils consists exclusively of static utility methods that are used in artificial fastq generation. 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 java.util.Random` | `randNumGenerator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ArtificialFastqGenerationUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `calculateTargetCoverageFromGCcontent(double GCcontent)` Deprecated.
    `static double` | `generateRandomDoubleBetween0And1()` Generates a random double between 0 and 1.
    `static char[]` | `getAlternateGenotypes(char genotype)` Return a char array containing the alternate genotypes.
    `static int` | `getRandomIntWithinRange(int mean, double standardDeviation, int minimum, int maximum)` Generates a pseudo-random number from a normal distribution, but with a minimum and maximum value.
    `static java.lang.String` | `getStackTraceString(java.lang.Exception e)` Generate a stack trace string for an exception object.
    `static int` | `getTargetCoverageViaGaussFuncOfGCcont(double GCcontent, double coverageMeanPeak, double coverageMeanPeakGCcontent, double coverageMeanGCcontentSpread, double coverageSDdividedByMean)` This method calculates a region's target coverage from its GC content.
    `static boolean` | `isACGT(char genotype)` Check if a genotype (represented as a char) is A/C/G/T.
    `static boolean` | `isGC(char genotype)` Check if a genotype (represented as a char) is G/C.
    `static <T extends AbstractRead> void` | `setRedundantReadToNull(T redundantRead)` Set the sequence field of Read and BabyRead objects to null and then also set the object to null.

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

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

- - ### Field Detail

    - #### randNumGenerator

          public static java.util.Random randNumGenerator

  - ### Constructor Detail

    - #### ArtificialFastqGenerationUtils

          public ArtificialFastqGenerationUtils()

  - ### Method Detail

    - #### isACGT

          public static boolean isACGT(char genotype)

      Check if a genotype (represented as a char) is A/C/G/T.
      Parameters:
        `genotype` - - the genotype whose type we are checking.
      Returns:
        isACGT - true if the genotype is A/C/G/T, else false.

    - #### isGC

          public static boolean isGC(char genotype)

      Check if a genotype (represented as a char) is G/C.
      Parameters:
        `genotype` - - the genotype whose type we are checking.
      Returns:
        isGC - true if the genotype is G/C, else false.

    - #### getAlternateGenotypes

          public static char[] getAlternateGenotypes(char genotype)

      Return a char array containing the alternate genotypes.
      Parameters:
        `genotype` - - genotype for which we want the alternatives.
      Returns:
        alternateGenotypes - the alternative genotypes.

    - #### getRandomIntWithinRange

          public static int getRandomIntWithinRange(int mean,
                                    double standardDeviation,
                                    int minimum,
                                    int maximum)

      Generates a pseudo-random number from a normal distribution, but with a minimum and maximum value.
      Parameters:
        `mean` - - the population mean.
        `standardDeviation` - - the population standard deviation.
        `minimum` - - the minimum possible value.
        `maximum` - - the maximum possible value.
      Returns:
        randomIntWithinRange - the integer from the bounded normal distribution.

    - #### getTargetCoverageViaGaussFuncOfGCcont

          public static int getTargetCoverageViaGaussFuncOfGCcont(double GCcontent,
                                                  double coverageMeanPeak,
                                                  double coverageMeanPeakGCcontent,
                                                  double coverageMeanGCcontentSpread,
                                                  double coverageSDdividedByMean)

      This method calculates a region's target coverage from its GC content. It uses a normal distribution to model target coverage levels for a given GC content. Hence it first calculates the mean and standard deviation of this distribution, and then samples from it. It calculates the mean via a Gaussian function f(x) = ae^-((x-b)^2/2c^2) where a is the height of the curve's peak (coverage mean peak), b is the position of the centre of the peak (coverage mean peak GC content), and c controls the width of the bell (coverage mean GC content spread). It calculates the standard deviation as a multiple of the mean.
      Parameters:
        `GCcontent` -
        `coverageMeanPeak` -
        `coverageMeanPeakGCcontent` -
        `coverageMeanGCcontentSpread` -
        `coverageSDdividedByMean` -
      Returns:
        targetCoverage

    - #### generateRandomDoubleBetween0And1

          public static double generateRandomDoubleBetween0And1()

      Generates a random double between 0 and 1.
      Returns:
        randomNumberBtwn0And1 - a pseudo-random double between 0 and 1.

    - #### getStackTraceString

          public static java.lang.String getStackTraceString(java.lang.Exception e)

      Generate a stack trace string for an exception object.
      Parameters:
        `e` - - the exception object.
      Returns:
        stackTraceString - the stack trace string for e.

    - #### setRedundantReadToNull

          public static <T extends AbstractRead> void setRedundantReadToNull(T redundantRead)

      Set the sequence field of Read and BabyRead objects to null and then also set the object to null. This is for helping Java to garbage collect redundant Read and BabyRead objects.
      Parameters:
        `redundantRead` -

    - #### calculateTargetCoverageFromGCcontent

          @Deprecated
          public static int calculateTargetCoverageFromGCcontent(double GCcontent)

      Deprecated.