# Class MarkerFileIterator<M extends Marker>

java.lang.Object
org.snpeff.fileIterator.FileIterator<M>
org.snpeff.fileIterator.MarkerFileIterator<M>

All Implemented Interfaces:
  `Iterable<M>, Iterator<M>`

Direct Known Subclasses:
  `GenericMarkerFileIterator, Gff3FileIterator, MotifFileIterator, RegulationFileIterator, VariantFileIterator, VcfFileIterator, VcfHapMapFileIterator`

public abstract class MarkerFileIterator<M extends Marker> extends FileIterator<M>
Opens a Marker file and iterates over all markers

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`createChromos`
`protected Genome`
`genome`
`protected boolean`
`ignoreChromosomeErrors`
`protected int`
`inOffset`

### Fields inherited from class FileIterator

`autoClose, countNewLineChars, debug, fileName, fileSize, line, lineNum, next, nextLine, reader, verbose`

## Constructor Summary

Constructors
Constructor
Description
`MarkerFileIterator(BufferedReader reader, int inOffset)`
`MarkerFileIterator(String fileName, int inOffset)`
`MarkerFileIterator(String fileName, Genome genome, int inOffset)`

## Method Summary

Modifier and Type
Method
Description
`Chromosome`
`getChromosome(String chromoName)`
Find chromosome 'chromoName'.
`Genome`
`getGenome()`
`protected void`
`init(String fileName, int inOffset)`
Initialize
`boolean`
`isIgnoreChromosomeErrors()`
`Markers`
`loadMarkers()`
`int`
`parsePosition(String posStr)`
Parse a string as a 'position'.
`void`
`sanityCheckChromo(String chromoName, Chromosome chromo)`
Sanity check
`void`
`setCreateChromos(boolean createChromos)`
`void`
`setIgnoreChromosomeErrors(boolean ignoreChromosomeErrors)`
`void`
`setInOffset(int inOffset)`

### Methods inherited from class FileIterator

`close, countNewLineChars, getFilePointer, getLine, getLineNum, guessNewLineChars, hasNext, hasSeek, isDebug, iterator, load, next, readLine, readNext, ready, remove, seek, setAutoClose, setDebug, setVerbose, toString`

### Methods inherited from class Object

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

### Methods inherited from interface Iterable

`forEach, spliterator`

### Methods inherited from interface Iterator

`forEachRemaining`

## Field Details

### createChromos

protected boolean createChromos

### genome

protected Genome genome

### ignoreChromosomeErrors

protected boolean ignoreChromosomeErrors

### inOffset

protected int inOffset

## Constructor Details

### MarkerFileIterator

public MarkerFileIterator(BufferedReader reader, int inOffset)

### MarkerFileIterator

public MarkerFileIterator(String fileName, Genome genome, int inOffset)

### MarkerFileIterator

public MarkerFileIterator(String fileName, int inOffset)

## Method Details

### getChromosome

public Chromosome getChromosome(String chromoName)
Find chromosome 'chromoName'. If it does not exists and 'createChromos' is true, the chromosome is created

### getGenome

public Genome getGenome()

### init

protected void init(String fileName, int inOffset)
Initialize

Overrides:
  `init` in class `FileIterator<M extends Marker>`
Parameters:
  `fileName` - : Can be null (no file is opened)

### isIgnoreChromosomeErrors

public boolean isIgnoreChromosomeErrors()

### loadMarkers

public Markers loadMarkers()

### parsePosition

public int parsePosition(String posStr)
Parse a string as a 'position'. Note: It subtracts 'inOffset' so that all coordinates are zero-based

### sanityCheckChromo

public void sanityCheckChromo(String chromoName, Chromosome chromo)
Sanity check

### setCreateChromos

public void setCreateChromos(boolean createChromos)

### setIgnoreChromosomeErrors

public void setIgnoreChromosomeErrors(boolean ignoreChromosomeErrors)

### setInOffset

public void setInOffset(int inOffset)