public class ReadsReader extends Object implements Iterator<Reads.ReadEntry>, Iterable<Reads.ReadEntry>, Closeable
| Constructor and Description |
|---|
ReadsReader(File file)
Initialize the reader.
|
ReadsReader(InputStream stream)
Initialize the reader.
|
ReadsReader(long start,
long end,
it.unimi.dsi.fastutil.io.FastBufferedInputStream stream)
Initialize the reader to read a segment of the input.
|
ReadsReader(long start,
long end,
String path)
Initialize the reader to read a segment of the input.
|
ReadsReader(String path)
Initialize the reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static byte[] |
decodeQualityScores(Reads.ReadEntry entry)
Decode the quality scores in this entry to qualityScores MutableString.
|
static void |
decodeSequence(Reads.ReadEntry entry,
it.unimi.dsi.lang.MutableString sequence)
Decode the sequence in this entry to the sequence MutableString.
|
static void |
decodeSequence(Reads.ReadEntry entry,
it.unimi.dsi.lang.MutableString sequence,
boolean decodePair)
Decode the sequence in this entry to the sequence MutableString.
|
static String |
getBasename(String filename)
Return the basename corresponding to the input reads filename.
|
static String[] |
getBasenames(String... filenames)
Return the basenames corresponding to the input filenames.
|
Properties |
getMetaData()
After reading the first entry, this getter will return the meta-data associated with
this read collection.
|
boolean |
hasNext()
Returns true if the input has more sequences.
|
Iterator<Reads.ReadEntry> |
iterator()
Make the reader "iterable" for java "for each" loops and such.
|
Reads.ReadEntry |
next()
Returns the next read entry from the input stream.
|
void |
remove()
This operation is not supported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingforEach, spliteratorpublic ReadsReader(String path) throws IOException
path - Path to the input fileIOException - If an error occurs reading the inputpublic ReadsReader(File file) throws IOException
file - The input fileIOException - If an error occurs reading the inputpublic ReadsReader(InputStream stream)
stream - Stream over the inputpublic ReadsReader(long start,
long end,
String path)
throws IOException
hasNext() and next().start - Start offset in the input fileend - End offset in the input filepath - Path to the input fileIOException - If an error occurs reading the inputpublic ReadsReader(long start,
long end,
it.unimi.dsi.fastutil.io.FastBufferedInputStream stream)
throws IOException
hasNext() and next().start - Start offset in the input fileend - End offset in the input filestream - Stream over the input fileIOException - If an error occurs reading the input.public boolean hasNext()
hasNext in interface Iterator<Reads.ReadEntry>public final Reads.ReadEntry next()
next in interface Iterator<Reads.ReadEntry>public void remove()
remove in interface Iterator<Reads.ReadEntry>public static void decodeSequence(Reads.ReadEntry entry, it.unimi.dsi.lang.MutableString sequence)
entry - The entry which provides the sequence in encoded format.sequence - Where to write the decoded sequence.public static void decodeSequence(Reads.ReadEntry entry, it.unimi.dsi.lang.MutableString sequence, boolean decodePair)
entry - The entry which provides the sequence in encoded format.sequence - Where to write the decoded sequence.decodePair - True: decodes the pair sequence. False: decodes the primary sequence.public static byte[] decodeQualityScores(Reads.ReadEntry entry)
entry - The entry which provides the sequence in encoded format.public Iterator<Reads.ReadEntry> iterator()
iterator in interface Iterable<Reads.ReadEntry>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic static String getBasename(String filename)
filename - The name of the file to get the basename forpublic static String[] getBasenames(String... filenames)
filenames - The names of the files to get the basnames forpublic Properties getMetaData()
Copyright © 2017 Campagne Laboratory. All rights reserved.