public class RefIt extends java.lang.Object implements SampleFileIt<VcfEmission>
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 and Description |
---|---|
static int |
DEFAULT_EM_BUFFER_SIZE
The default number of
VcfEmission objects that are
stored in a buffer. |
static java.util.function.BiFunction<VcfHeader,java.lang.String,VcfEmission> |
toRef |
Modifier and Type | Method and 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. |
VcfEmission |
next()
Returns the next element in the iteration.
|
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 DEFAULT_EM_BUFFER_SIZE
VcfEmission
objects that are
stored in a buffer.public static final java.util.function.BiFunction<VcfHeader,java.lang.String,VcfEmission> toRef
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 strIt
java.lang.NullPointerException
- if strIt == null
public 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 null
markerFilter
- a marker filter or null
bufferSize
- the buffer sizeRefIt
instancejava.lang.IllegalArgumentException
- if a format error is detected in a
line of a VCF file returned by strItt
java.lang.IllegalArgumentException
- if bufferSize < 1
java.lang.NullPointerException
- if strIt == null
public void close()
FileIt
close
, further
invocations of close()
have no effect.close
in interface FileIt<VcfEmission>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean hasNext()
true
if the iteration has more elements, and returns
false
otherwise.hasNext
in interface java.util.Iterator<VcfEmission>
true
if the iteration has more elementspublic VcfEmission next()
next
in interface java.util.Iterator<VcfEmission>
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<VcfEmission>
java.lang.UnsupportedOperationException
- if this method is invokedpublic java.io.File file()
FileIt
null
if the data are read from standard input or are
computed data.file
in interface FileIt<VcfEmission>
null
if the data are read from standard input or are
computed datapublic Samples samples()
SampleFileIt
samples
in interface SampleFileIt<VcfEmission>
public java.lang.String toString()
FileIt
this
. The exact
details of the representation are unspecified and subject to change.toString
in interface FileIt<VcfEmission>
toString
in class java.lang.Object
this