Package org.biojava.bio.program.fastq
Class FastqTools
java.lang.Object
org.biojava.bio.program.fastq.FastqTools
Utility methods for FASTQ formatted sequences.
- Since:
- 1.8.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic Fastqconvert(Fastq fastq, FastqVariant variant) Convert the specified FASTQ formatted sequence to the specified FASTQ sequence format variant.static SymbolListCreate and return a new DNASymbolListfrom the specified FASTQ formatted sequence.static SequencecreateDNASequence(Fastq fastq) Create and return a new DNASequencefrom the specified FASTQ formatted sequence.static PhredSequencecreatePhredSequence(Fastq fastq) Create and return a newPhredSequencefrom the specified FASTQ formatted sequence.static SymbolListcreateQualityScores(Fastq fastq) Create and return a newSymbolListof quality scores from the specified FASTQ formatted sequence.static Distribution[]createSymbolDistribution(Fastq fastq) Create and return a new array of symbolDistributions from the specified FASTQ formatted sequence.errorProbabilities(Fastq fastq) Return the error probabilities from the specified FASTQ formatted sequence.static double[]errorProbabilities(Fastq fastq, double[] errorProbabilities) Copy the error probabilities from the specified FASTQ formatted sequence into the specified double array.qualityScores(Fastq fastq) Return the quality scores from the specified FASTQ formatted sequence.static int[]qualityScores(Fastq fastq, int[] qualityScores) Copy the quality scores from the specified FASTQ formatted sequence into the specified int array.
-
Method Details
-
createDNA
Create and return a new DNASymbolListfrom the specified FASTQ formatted sequence.- Parameters:
fastq- FASTQ formatted sequence, must not be null- Returns:
- a new DNA
SymbolListfrom the specified FASTQ formatted sequence - Throws:
IllegalSymbolException- if an illegal symbol is found
-
createQualityScores
Create and return a newSymbolListof quality scores from the specified FASTQ formatted sequence.- Parameters:
fastq- FASTQ formatted sequence, must not be null- Returns:
- a new
SymbolListof quality scores from the specified FASTQ formatted sequence - Throws:
IllegalSymbolException- if an illegal symbol is found
-
createDNASequence
Create and return a new DNASequencefrom the specified FASTQ formatted sequence.- Parameters:
fastq- FASTQ formatted sequence, must not be null- Returns:
- a new
Sequencefrom the specified FASTQ formatted sequence - Throws:
IllegalSymbolException- if an illegal symbol is found
-
createPhredSequence
public static PhredSequence createPhredSequence(Fastq fastq) throws IllegalAlphabetException, IllegalSymbolException Create and return a newPhredSequencefrom 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
PhredSequencefrom the specified FASTQ formatted sequence - Throws:
IllegalAlphabetException- if an illegal alphabet is usedIllegalSymbolException- if an illegal symbol is found
-
createSymbolDistribution
public static Distribution[] createSymbolDistribution(Fastq fastq) throws IllegalAlphabetException, IllegalSymbolException Create and return a new array of symbolDistributions 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 usedIllegalSymbolException- if an illegal symbol is found
-
qualityScores
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
Copy the quality scores from the specified FASTQ formatted sequence into the specified int array.- Parameters:
fastq- FASTQ formatted sequence, must not be nullqualityScores- 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
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
Copy the error probabilities from the specified FASTQ formatted sequence into the specified double array.- Parameters:
fastq- FASTQ formatted sequence, must not be nullerrorProbabilities- 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
Convert the specified FASTQ formatted sequence to the specified FASTQ sequence format variant.- Parameters:
fastq- FASTQ formatted sequence, must not be nullvariant- 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
-