# 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 invalid input: '&'invalid input: '&' ((binIndex + 1) % maxXbins == 0)) { xOffset = 0; yOffset += blockSize } else xOffset += blockSize

## Nested Class Summary

### Nested classes/interfaces inherited from class AbstractIlluminaPositionFileReader

`AbstractIlluminaPositionFileReader.PositionInfo`

## Field Summary

### Fields inherited from class AbstractIlluminaPositionFileReader

`MAX_POS, MIN_POS, S_LOCS_FILE`

## Constructor Summary

Constructors
Constructor
Description
`ClocsFileReader(File clocsFile)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`boolean`
`hasNext()`
Return true if the file has more elements to return, false otherwise
`protected String`
`makeExceptionMsg()`
Create a string that will be included in any NoSuchElementException thrown by the next() method
`protected AbstractIlluminaPositionFileReader.PositionInfo`
`unsafeNextInfo()`
Grab the next set of offset values, decompress them.

### Methods inherited from class AbstractIlluminaPositionFileReader

`getFile, getLane, getTile, next, remove`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface htsjdk.samtools.util.CloseableIterator

`stream, toList`

### Methods inherited from interface Iterator

`forEachRemaining`

## Constructor Details

### ClocsFileReader

public ClocsFileReader(File clocsFile)

## Method Details

### unsafeNextInfo

protected AbstractIlluminaPositionFileReader.PositionInfo unsafeNextInfo()
Grab the next set of offset values, decompress them.

Specified by:
  `unsafeNextInfo` in class `AbstractIlluminaPositionFileReader`
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 class `AbstractIlluminaPositionFileReader`

### 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 interface `Iterator<AbstractIlluminaPositionFileReader.PositionInfo>`
Specified by:
  `hasNext` in class `AbstractIlluminaPositionFileReader`

### close

public void close()