# Class BedFileIterator

java.lang.Object
org.snpeff.fileIterator.FileIterator<Variant>
org.snpeff.fileIterator.MarkerFileIterator<Variant>
org.snpeff.fileIterator.VariantFileIterator
org.snpeff.fileIterator.BedFileIterator

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

public class BedFileIterator extends VariantFileIterator
Opens a sequence change file and iterates over all intervals in BED format. Reference: http://genome.ucsc.edu/FAQ/FAQformat.html#format1 BED lines have three required fields and nine additional optional fields. The number of fields per line must be consistent throughout any single set of data in an annotation track. The first three required BED fields are: 1. chrom - The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671). 2. chromStart - The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0. 3. chromEnd - The ending position of the feature in the chromosome or scaffold. The chromEnd base is not included in the display of the feature. For example, the first 100 bases of a chromosome are defined as chromStart=0, chromEnd=100, and span the bases numbered 0-99. There are 9 additional optional BED fields, but we only use one: 4. name - Defines the name of the BED line. This label is displayed to the left of the BED line in the Genome Browser window when the track is open to full display mode or directly to the left of the item in pack mode. 5. score - A score used for that interval

Author:
  pcingola

## Field Summary

### Fields inherited from class MarkerFileIterator

`createChromos, genome, ignoreChromosomeErrors, inOffset`

### Fields inherited from class FileIterator

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

## Constructor Summary

Constructors
Constructor
Description
`BedFileIterator(String fileName)`
`BedFileIterator(String fileName, Genome genome)`

## Method Summary

Modifier and Type
Method
Description
`static Markers`
`load(String bedFileName, boolean verbose)`
`protected Variant`
`readNext()`
Read next element

### Methods inherited from class MarkerFileIterator

`getChromosome, getGenome, init, isIgnoreChromosomeErrors, loadMarkers, parsePosition, sanityCheckChromo, setCreateChromos, setIgnoreChromosomeErrors, setInOffset`

### Methods inherited from class FileIterator

`close, countNewLineChars, getFilePointer, getLine, getLineNum, guessNewLineChars, hasNext, hasSeek, isDebug, iterator, load, next, readLine, 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`

## Constructor Details

### BedFileIterator

public BedFileIterator(String fileName)

### BedFileIterator

public BedFileIterator(String fileName, Genome genome)

## Method Details

### load

public static Markers load(String bedFileName, boolean verbose)

### readNext

protected Variant readNext()
Description copied from class: `FileIterator`
Read next element

Specified by:
  `readNext` in class `FileIterator<Variant>`