Package picard.illumina.parser.readers
Class ClocsFileReader
- java.lang.Object
-
- picard.illumina.parser.readers.AbstractIlluminaPositionFileReader
-
- picard.illumina.parser.readers.ClocsFileReader
-
- All Implemented Interfaces:
htsjdk.samtools.util.CloseableIterator<AbstractIlluminaPositionFileReader.PositionInfo>
,Closeable
,AutoCloseable
,Iterator<AbstractIlluminaPositionFileReader.PositionInfo>
public class ClocsFileReader extends AbstractIlluminaPositionFileReader
The clocs file format is one of 3 Illumina formats(pos, locs, and clocs) that stores position data exclusively. clocs files store position data for successive clusters, compressed in bins as follows: Byte 0 : unused Byte 1-4 : unsigned int numBins The rest of the file consists of bins/blocks, where a bin consists of an integer indicating number of blocks, followed by that number of blocks and a block consists of an x-y coordinate pair. In otherwords: for each bin byte 1: Unsigned int numBlocks for each block: byte 1 : byte xRelativeCoordinate byte 2 : byte yRelativeCoordinate Actual x and y values are computed using the following algorithm xOffset = yOffset = 0 imageWidth = 2048 blockSize = 25 maxXbins:Int = Math.Ceiling((double)ImageWidth/(double)blockSize) for each bin: for each location: x = convert.ToSingle(xRelativeCoordinate/10f + xoffset) y = convert.toSingle(yRelativeCoordinate/10f + yoffset) if (binIndex > 0 && ((binIndex + 1) % maxXbins == 0)) { xOffset = 0; yOffset += blockSize } else xOffset += blockSize
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class picard.illumina.parser.readers.AbstractIlluminaPositionFileReader
AbstractIlluminaPositionFileReader.PositionInfo
-
-
Field Summary
-
Fields inherited from class picard.illumina.parser.readers.AbstractIlluminaPositionFileReader
MAX_POS, MIN_POS, S_LOCS_FILE
-
-
Constructor Summary
Constructors Constructor Description ClocsFileReader(File clocsFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
Return true if the file has more elements to return, false otherwiseprotected String
makeExceptionMsg()
Create a string that will be included in any NoSuchElementException thrown by the next() methodprotected AbstractIlluminaPositionFileReader.PositionInfo
unsafeNextInfo()
Grab the next set of offset values, decompress them.-
Methods inherited from class picard.illumina.parser.readers.AbstractIlluminaPositionFileReader
getFile, getLane, getTile, next, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
ClocsFileReader
public ClocsFileReader(File clocsFile)
-
-
Method Detail
-
unsafeNextInfo
protected AbstractIlluminaPositionFileReader.PositionInfo unsafeNextInfo()
Grab the next set of offset values, decompress them.- Specified by:
unsafeNextInfo
in classAbstractIlluminaPositionFileReader
- Returns:
- the position information of the next offset values
-
makeExceptionMsg
protected String makeExceptionMsg()
Description copied from class:AbstractIlluminaPositionFileReader
Create a string that will be included in any NoSuchElementException thrown by the next() method- Specified by:
makeExceptionMsg
in classAbstractIlluminaPositionFileReader
-
hasNext
public boolean hasNext()
Description copied from class:AbstractIlluminaPositionFileReader
Return true if the file has more elements to return, false otherwise- Specified by:
hasNext
in interfaceIterator<AbstractIlluminaPositionFileReader.PositionInfo>
- Specified by:
hasNext
in classAbstractIlluminaPositionFileReader
-
close
public void close()
-
-