Class FastqTools

java.lang.Object
org.biojava.bio.program.fastq.FastqTools

public final class FastqTools extends Object
Utility methods for FASTQ formatted sequences.
Since:
1.8.2
  • Method Details

    • createDNA

      public static SymbolList createDNA(Fastq fastq) throws IllegalSymbolException
      Create and return a new DNA SymbolList from the specified FASTQ formatted sequence.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      Returns:
      a new DNA SymbolList from the specified FASTQ formatted sequence
      Throws:
      IllegalSymbolException - if an illegal symbol is found
    • createQualityScores

      Create and return a new SymbolList of quality scores from the specified FASTQ formatted sequence.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      Returns:
      a new SymbolList of quality scores from the specified FASTQ formatted sequence
      Throws:
      IllegalSymbolException - if an illegal symbol is found
    • createDNASequence

      Create and return a new DNA Sequence from the specified FASTQ formatted sequence.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      Returns:
      a new Sequence from the specified FASTQ formatted sequence
      Throws:
      IllegalSymbolException - if an illegal symbol is found
    • createPhredSequence

      Create and return a new PhredSequence from the specified FASTQ formatted sequence. Only Sanger variant FASTQ formatted sequences are supported.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null and must be Sanger variant
      Returns:
      a new PhredSequence from the specified FASTQ formatted sequence
      Throws:
      IllegalAlphabetException - if an illegal alphabet is used
      IllegalSymbolException - if an illegal symbol is found
    • createSymbolDistribution

      Create and return a new array of symbol Distributions from the specified FASTQ formatted sequence. Only Sanger variant FASTQ formatted sequences are supported.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null and must be Sanger variant
      Returns:
      a new array of symbol Distributions from the specified FASTQ formatted sequence
      Throws:
      IllegalAlphabetException - if an illegal alphabet is used
      IllegalSymbolException - if an illegal symbol is found
    • qualityScores

      public static Iterable<Integer> qualityScores(Fastq fastq)
      Return the quality scores from the specified FASTQ formatted sequence.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      Returns:
      the quality scores from the specified FASTQ formatted sequence
    • qualityScores

      public static int[] qualityScores(Fastq fastq, int[] qualityScores)
      Copy the quality scores from the specified FASTQ formatted sequence into the specified int array.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      qualityScores - int array of quality scores, must not be null and must be the same length as the FASTQ formatted sequence quality
      Returns:
      the specified int array of quality scores
    • errorProbabilities

      public static Iterable<Double> errorProbabilities(Fastq fastq)
      Return the error probabilities from the specified FASTQ formatted sequence.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      Returns:
      the error probabilities from the specified FASTQ formatted sequence
    • errorProbabilities

      public static double[] errorProbabilities(Fastq fastq, double[] errorProbabilities)
      Copy the error probabilities from the specified FASTQ formatted sequence into the specified double array.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      errorProbabilities - double array of error probabilities, must not be null and must be the same length as the FASTQ formatted sequence quality
      Returns:
      the specified double array of error probabilities
    • convert

      public static Fastq convert(Fastq fastq, FastqVariant variant)
      Convert the specified FASTQ formatted sequence to the specified FASTQ sequence format variant.
      Parameters:
      fastq - FASTQ formatted sequence, must not be null
      variant - FASTQ sequence format variant, must not be null
      Returns:
      the specified FASTQ formatted sequence converted to the specified FASTQ sequence format variant
      Since:
      1.9.3