org.biojava.bio.program.fastq
Class SangerFastqReader

java.lang.Object
  extended by org.biojava.bio.program.fastq.SangerFastqReader
All Implemented Interfaces:
FastqReader

public final class SangerFastqReader
extends java.lang.Object

Reader for FastqVariant.FASTQ_SANGER formatted sequences.


Constructor Summary
SangerFastqReader()
           
 
Method Summary
protected  FastqVariant getVariant()
          Return the FASTQ sequence format variant for this reader.
 java.lang.Iterable<Fastq> read(java.io.File file)
          Read zero or more FASTQ formatted sequences from the specified file.
 java.lang.Iterable<Fastq> read(java.io.InputStream inputStream)
          Read zero or more FASTQ formatted sequences from the specified input stream.
 java.lang.Iterable<Fastq> read(java.net.URL url)
          Read zero or more FASTQ formatted sequences from the specified url.
protected  void validateDescription(FastqBuilder builder, java.lang.String description, int lineNumber)
          Validate the specified description.
protected  void validateQuality(FastqBuilder builder, java.lang.String quality, int lineNumber)
          Validate the specified quality scores.
protected  void validateRepeatDescription(FastqBuilder builder, java.lang.String repeatDescription, int lineNumber)
          Validate the specified repeat description.
protected  void validateSequence(FastqBuilder builder, java.lang.String sequence, int lineNumber)
          Validate the specified sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SangerFastqReader

public SangerFastqReader()
Method Detail

getVariant

protected FastqVariant getVariant()
Return the FASTQ sequence format variant for this reader.

Returns:
the FASTQ sequence format variant for this reader

validateDescription

protected void validateDescription(FastqBuilder builder,
                                   java.lang.String description,
                                   int lineNumber)
                            throws java.io.IOException
Validate the specified description.

Parameters:
builder - FASTQ formatted sequence builder, will not be null
description - description to validate, will not be null
lineNumber - current line number in input stream
Throws:
java.io.IOException - if the specified description is not valid

validateSequence

protected void validateSequence(FastqBuilder builder,
                                java.lang.String sequence,
                                int lineNumber)
                         throws java.io.IOException
Validate the specified sequence.

Parameters:
builder - FASTQ formatted sequence builder, will not be null
sequence - sequence to validate, will not be null
lineNumber - current line number in input stream
Throws:
java.io.IOException - if the specified sequence is not valid

validateRepeatDescription

protected void validateRepeatDescription(FastqBuilder builder,
                                         java.lang.String repeatDescription,
                                         int lineNumber)
                                  throws java.io.IOException
Validate the specified repeat description.

Parameters:
builder - FASTQ formatted sequence builder, will not be null
repeatDescription - repeat description to validate, will not be null
lineNumber - current line number in input stream
Throws:
java.io.IOException - if the specified repeat description is not valid

validateQuality

protected void validateQuality(FastqBuilder builder,
                               java.lang.String quality,
                               int lineNumber)
                        throws java.io.IOException
Validate the specified quality scores.

Parameters:
builder - FASTQ formatted sequence builder, will not be null
quality - quality scores to validate, will not be null
lineNumber - current line number in input stream
Throws:
java.io.IOException - if the specified quality scores are not valid

read

public final java.lang.Iterable<Fastq> read(java.io.File file)
                                     throws java.io.IOException
Read zero or more FASTQ formatted sequences from the specified file.

Specified by:
read in interface FastqReader
Parameters:
file - file to read from, must not be null
Returns:
zero or more FASTQ formatted sequences read from the specified file
Throws:
java.io.IOException - if an IO error occurs

read

public final java.lang.Iterable<Fastq> read(java.net.URL url)
                                     throws java.io.IOException
Read zero or more FASTQ formatted sequences from the specified url.

Specified by:
read in interface FastqReader
Parameters:
url - URL to read from, must not be null
Returns:
zero or more FASTQ formatted sequences read from the specified url
Throws:
java.io.IOException - if an IO error occurs

read

public final java.lang.Iterable<Fastq> read(java.io.InputStream inputStream)
                                     throws java.io.IOException
Read zero or more FASTQ formatted sequences from the specified input stream.

Specified by:
read in interface FastqReader
Parameters:
inputStream - input stream to read from, must not be null
Returns:
zero or more FASTQ formatted sequences read from the specified input stream
Throws:
java.io.IOException - if an IO error occurs