E - the type of elements in the window corresponding to this
window iterator.FileIt<Window<E>>, SampleFileIt<Window<E>>, java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<Window<E>>public class WindowIt<E extends GTRec> extends java.lang.Object implements SampleFileIt<Window<E>>
Class WindowIt represents a sliding window of VCF recList.
Instances of class WindowIt are not thread-safe.
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Releases any I/O resources controlled by this object.
|
java.io.File |
file() |
Returns the file from which VCF recList are read, or returns
null if the source is standard input. |
GeneticMap |
genMap() |
Returns the genetic map.
|
boolean |
hasNext() |
Returns
true if the sliding window of VCF recList can advance
and returns false otherwise. |
static <E extends GTRec> |
newInstance(java.util.function.Supplier<SampleFileIt<E>> supplier,
GeneticMap genMap,
float windowCM,
float overlapCM) |
Constructs and returns a new
WindowIt instance for
the specified data. |
Window<E> |
next() |
Advances the sliding window of VCF recList, and returns the advanced
window as a
RefGTRec[] object. |
Samples |
samples() |
Returns the list of samples.
|
java.lang.String |
toString() |
Returns a string representation of
this. |
public static <E extends GTRec> WindowIt<E> newInstance(java.util.function.Supplier<SampleFileIt<E>> supplier, GeneticMap genMap, float windowCM, float overlapCM)
WindowIt instance for
the specified data.E - the type of elements in windows for the returned
window iterator.supplier - the object which supplies the SampleFileIt which
reads input datagenMap - the genetic mapwindowCM - the requested window length in cMoverlapCM - the requested overlap in cM between consecutive
windows on the same chromosomeWindowIt instance for the specified datajava.lang.IllegalArgumentException - if a format error is detected in the
input filejava.lang.IllegalArgumentException - if
overlap < 0 || Float.isFinite(overlap) == falsejava.lang.IllegalArgumentException - if
window <= overlap || Float.isFinite(window) == falsejava.lang.NullPointerException - if it == null || genMap == nullpublic GeneticMap genMap()
public boolean hasNext()
true if the sliding window of VCF recList can advance
and returns false otherwise.public Window<E> next()
RefGTRec[] object.next in interface java.util.Iterator<E extends GTRec>java.lang.IllegalArgumentException - if a format error in the input data
is detectedjava.lang.IllegalArgumentException - if
windowCm <= this.overlap() || Float.isFinite(windowCm) == falsejava.lang.IllegalStateException - if
this.canAdvanceWindow() == falsepublic java.io.File file()
null if the source is standard input.public Samples samples()
samples in interface SampleFileIt<E extends GTRec>public void close()
public java.lang.String toString()
this. The exact
details of the representation are unspecified and subject to change.