Class FastqTools
java.lang.Object
org.biojava.nbio.sequencing.io.fastq.FastqTools
Utility methods for FASTQ formatted sequences.
- Since:
 - 3.0.3
 
- 
Method Summary
Modifier and TypeMethodDescriptionstatic Fastqconvert(Fastq fastq, FastqVariant variant) Convert the specified FASTQ formatted sequence to the specified FASTQ sequence format variant.static DNASequencecreateDNASequence(Fastq fastq) Create and return a newDNASequencefrom the specified FASTQ formatted sequence.static DNASequenceCreate and return a newDNASequencewith error probabilities from the specified FASTQ formatted sequence.static DNASequenceCreate and return a newDNASequencewith quality scores from the specified FASTQ formatted sequence.static DNASequenceCreate and return a newDNASequencewith quality scores and error probabilities from the specified FASTQ formatted sequence.createErrorProbabilities(Fastq fastq) Create and return a newQuantityFeaturefrom the error probabilities of the specified FASTQ formatted sequence.createQualityScores(Fastq fastq) Create and return a newQualityFeaturefrom the quality scores of 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
- 
createDNASequence
Create and return a newDNASequencefrom the specified FASTQ formatted sequence.- Parameters:
 fastq- FASTQ formatted sequence, must not be null- Returns:
 - a new 
DNASequencefrom the specified FASTQ formatted sequence - Throws:
 CompoundNotFoundException- if DNA sequence in fastq contains unrecognised compounds
 - 
createDNASequenceWithQualityScores
public static DNASequence createDNASequenceWithQualityScores(Fastq fastq) throws CompoundNotFoundException Create and return a newDNASequencewith quality scores from the specified FASTQ formatted sequence. The quality scores are stored in aQualityFeaturewith a type"qualityScores"the same length as the sequence.- Parameters:
 fastq- FASTQ formatted sequence, must not be null- Returns:
 - a new 
DNASequencewith quality scores from the specified FASTQ formatted sequence - Throws:
 CompoundNotFoundException- if DNA sequence in fastq contains unrecognised compounds
 - 
createDNASequenceWithErrorProbabilities
public static DNASequence createDNASequenceWithErrorProbabilities(Fastq fastq) throws CompoundNotFoundException Create and return a newDNASequencewith error probabilities from the specified FASTQ formatted sequence. The error probabilities are stored in aQuantityFeaturewith a type"errorProbabilities"the same length as the sequence.- Parameters:
 fastq- FASTQ formatted sequence, must not be null- Returns:
 - a new 
DNASequencewith error probabilities from the specified FASTQ formatted sequence - Throws:
 CompoundNotFoundException- if DNA sequence in fastq contains unrecognised compounds
 - 
createDNASequenceWithQualityScoresAndErrorProbabilities
public static DNASequence createDNASequenceWithQualityScoresAndErrorProbabilities(Fastq fastq) throws CompoundNotFoundException Create and return a newDNASequencewith quality scores and error probabilities from the specified FASTQ formatted sequence. The quality scores are stored in aQualityFeaturewith a type"qualityScores"the same length as the sequence and the error probabilities are stored in aQuantityFeaturewith a type"errorProbabilities"the same length as the sequence.- Parameters:
 fastq- FASTQ formatted sequence, must not be null- Returns:
 - a new 
DNASequencewith quality scores and error probabilities from the specified FASTQ formatted sequence - Throws:
 CompoundNotFoundException- if DNA sequence in fastq contains unrecognised compounds
 - 
createQualityScores
public static QualityFeature<AbstractSequence<NucleotideCompound>,NucleotideCompound> createQualityScores(Fastq fastq) Create and return a newQualityFeaturefrom the quality scores of the specified FASTQ formatted sequence. The quality scores feature has a type"qualityScores"and will be the same length as the sequence.- Parameters:
 fastq- FASTQ formatted sequence, must not be null- Returns:
 - a new 
QualityFeaturefrom the quality scores of the specified FASTQ formatted sequence 
 - 
createErrorProbabilities
public static QuantityFeature<AbstractSequence<NucleotideCompound>,NucleotideCompound> createErrorProbabilities(Fastq fastq) Create and return a newQuantityFeaturefrom the error probabilities of the specified FASTQ formatted sequence. The error probabilities feature has a type"errorProbabilities"and will be the same length as the sequence.- Parameters:
 fastq- FASTQ formatted sequence, must not be null- Returns:
 - a new 
QualityFeaturefrom the error probabilities of the specified FASTQ formatted sequence 
 - 
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:
 - 4.2
 
 
 -