FileIt<RefGTRec>, SampleFileIt<RefGTRec>, java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<RefGTRec>public class RefIt extends java.lang.Object implements SampleFileIt<RefGTRec>
Class RefIt represents an iterator whose next()
method returns an object storing data from a VCF record with
phased, non-missing genotypes.
Instances of class RefIt are not thread-safe.
Methods of this class will terminate the Java Virtual Machine with an error message if an I/O error or file format error is detected.
| Modifier and Type | Field | Description |
|---|---|---|
static int |
MAX_EM_BUFFER_SIZE |
The default number of
GTRec objects that are
stored in a buffer. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Terminates the iteration and releases any system resources that
are held by this object.
|
static RefIt |
create(FileIt<java.lang.String> strIt) |
Create and returns a new
RefIt instance from the specified
iterator. |
static RefIt |
create(FileIt<java.lang.String> strIt,
Filter<java.lang.String> sampleFilter,
Filter<Marker> markerFilter,
int bufferSize) |
Create and returns a new
RefIt instance from the specified
objects. |
java.io.File |
file() |
Returns the file from which the data are read, or
null if the data are read from standard input or are
computed data. |
boolean |
hasNext() |
Returns
true if the iteration has more elements, and returns
false otherwise. |
RefGTRec |
next() |
Returns the next element in the iteration.
|
static RefGTRec |
recodeIfLowFreq(RefGTRec rec) |
|
void |
remove() |
The
remove method is not supported by this iterator. |
Samples |
samples() |
Returns the list of samples.
|
java.lang.String |
toString() |
Returns a string representation of
this. |
public static final int MAX_EM_BUFFER_SIZE
GTRec objects that are
stored in a buffer.public static RefIt create(FileIt<java.lang.String> strIt)
RefIt instance from the specified
iterator.strIt - an iterator that returns lines of a VCF fileRefIt instancejava.lang.IllegalArgumentException - if a format error is detected in a
line of a VCF file returned by strItjava.lang.NullPointerException - if strIt == nullpublic static RefIt create(FileIt<java.lang.String> strIt, Filter<java.lang.String> sampleFilter, Filter<Marker> markerFilter, int bufferSize)
RefIt instance from the specified
objects.strIt - an iterator that returns lines of a VCF filesampleFilter - a sample filter or nullmarkerFilter - a marker filter or nullbufferSize - the buffer sizeRefIt instancejava.lang.IllegalArgumentException - if a format error is detected in a
line of a VCF file returned by strIttjava.lang.IllegalArgumentException - if bufferSize < 1java.lang.NullPointerException - if strIt == nullpublic void close()
FileItclose(), further
invocations of close() have no effect.public boolean hasNext()
true if the iteration has more elements, and returns
false otherwise.hasNext in interface java.util.Iterator<RefGTRec>true if the iteration has more elementspublic RefGTRec next()
next in interface java.util.Iterator<RefGTRec>java.util.NoSuchElementException - if the iteration has no more elementspublic void remove()
remove method is not supported by this iterator.remove in interface java.util.Iterator<RefGTRec>java.lang.UnsupportedOperationException - if this method is invokedpublic java.io.File file()
FileItnull if the data are read from standard input or are
computed data.public Samples samples()
SampleFileItsamples in interface SampleFileIt<RefGTRec>public java.lang.String toString()
FileItthis. The exact
details of the representation are unspecified and subject to change.