public class FastqReader extends java.lang.Object implements java.util.Iterator<FastqRecord>, java.lang.Iterable<FastqRecord>, java.io.Closeable
Modifier and Type | Class and Description |
---|---|
protected static class |
FastqReader.LineType
Enum of the types of lines we see in Fastq.
|
Constructor and Description |
---|
FastqReader(java.io.BufferedReader reader) |
FastqReader(java.io.File file) |
FastqReader(java.io.File file,
boolean skipBlankLines)
Constructor
|
FastqReader(java.io.File file,
java.io.BufferedReader reader) |
FastqReader(java.io.File file,
java.io.BufferedReader reader,
boolean skipBlankLines)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkLine(java.lang.String line,
FastqReader.LineType kind)
Checks that the line is neither null (representing EOF) or empty (blank line in file).
|
void |
close() |
protected java.lang.String |
error(java.lang.String msg)
Generates an error message with line number information.
|
java.io.File |
getFile() |
int |
getLineNumber() |
boolean |
hasNext() |
java.util.Iterator<FastqRecord> |
iterator()
WARNING: Despite the fact that this class implements Iterable, calling iterator() method does not
start iteration from the beginning of the file.
|
FastqRecord |
next() |
void |
remove() |
java.lang.String |
toString() |
public FastqReader(java.io.File file)
public FastqReader(java.io.File file, boolean skipBlankLines)
file
- of FASTQ to read read. Will be opened with htsjdk.samtools.util.IOUtil.openFileForBufferedReadingskipBlankLines
- should we skip blank lines ?public FastqReader(java.io.BufferedReader reader)
public FastqReader(java.io.File file, java.io.BufferedReader reader, boolean skipBlankLines)
file
- Name of FASTQ being read, or null if not known.reader
- input reader . Will be closed by the close methodskipBlankLines
- should we skip blank lines ?public FastqReader(java.io.File file, java.io.BufferedReader reader)
public boolean hasNext()
hasNext
in interface java.util.Iterator<FastqRecord>
public FastqRecord next()
next
in interface java.util.Iterator<FastqRecord>
public void remove()
remove
in interface java.util.Iterator<FastqRecord>
public java.util.Iterator<FastqRecord> iterator()
iterator
in interface java.lang.Iterable<FastqRecord>
public int getLineNumber()
public java.io.File getFile()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
protected void checkLine(java.lang.String line, FastqReader.LineType kind)
protected java.lang.String error(java.lang.String msg)
public java.lang.String toString()
toString
in class java.lang.Object