# Class VcfIndex

java.lang.Object
org.snpsift.annotate.VcfIndex

public class VcfIndex extends Object
An index for a VCF file

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`INDEX_EXT`
`static int`
`INDEX_FORMAT_VERSION`
`static int`
`SHOW_EVERY`

## Constructor Summary

Constructors
Constructor
Description
`VcfIndex(String fileName)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(org.snpeff.vcf.VcfEntry ve, long filePos)`
Add an interval parse from 'line'
`void`
`close()`
Close file and free memory
`org.snpeff.interval.Genome`
`getGenome()`
`VcfIndexDataChromo`
`getOrCreate(String chromosome)`
Get IntervalFileChromo by chromosome name.
`VcfIndexTree`
`getTree(String chromosome)`
`org.snpeff.fileIterator.VcfFileIterator`
`getVcf()`
`VcfIndexDataChromo`
`getVcfIndexChromo(String chromosome)`
`void`
`index()`
Load or create index
`protected void`
`loadIndex(String indexFile)`
Load index form a file
`void`
`open()`
Open file
`org.snpeff.interval.Markers`
`query(org.snpeff.interval.Marker marker)`
Query interval forest
`org.snpeff.vcf.VcfEntry`
`read(long fileIdx)`
Read a VcfEntry at position 'fileIdx'
`org.snpeff.vcf.VcfEntry`
`read(MarkerFile markerFile)`
Read a VcfEntry referenced by 'markerFile'
`void`
`save(String indexFile)`
Save index file
`void`
`setDebug(boolean debug)`
`void`
`setMaxBlockSize(int maxBlockSize)`
`void`
`setVerbose(boolean verbose)`
`String`
`toString()`
`String`
`toStringAll()`
Show all entries

### Methods inherited from class Object

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

## Field Details

### INDEX_FORMAT_VERSION

public static int INDEX_FORMAT_VERSION

### SHOW_EVERY

public static int SHOW_EVERY

### INDEX_EXT

public static final String INDEX_EXT

See Also:
  - Constant Field Values

## Constructor Details

### VcfIndex

public VcfIndex(String fileName)

## Method Details

### add

public void add(org.snpeff.vcf.VcfEntry ve, long filePos)
Add an interval parse from 'line'

### close

public void close()
Close file and free memory

### getGenome

public org.snpeff.interval.Genome getGenome()

### getOrCreate

public VcfIndexDataChromo getOrCreate(String chromosome)
Get IntervalFileChromo by chromosome name. Create a new one if it doesn't exists

### getTree

public VcfIndexTree getTree(String chromosome)

### getVcf

public org.snpeff.fileIterator.VcfFileIterator getVcf()

### getVcfIndexChromo

public VcfIndexDataChromo getVcfIndexChromo(String chromosome)

### index

public void index()
Load or create index

### loadIndex

protected void loadIndex(String indexFile)
Load index form a file

### open

public void open()
Open file

### query

public org.snpeff.interval.Markers query(org.snpeff.interval.Marker marker)
Query interval forest

### read

public org.snpeff.vcf.VcfEntry read(long fileIdx)
Read a VcfEntry at position 'fileIdx'

### read

public org.snpeff.vcf.VcfEntry read(MarkerFile markerFile)
Read a VcfEntry referenced by 'markerFile'

### save

public void save(String indexFile)
Save index file

### setDebug

public void setDebug(boolean debug)

### setMaxBlockSize

public void setMaxBlockSize(int maxBlockSize)

### setVerbose

public void setVerbose(boolean verbose)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toStringAll

public String toStringAll()
Show all entries