Package vcf
Class RestrictedVcfWindow
java.lang.Object
vcf.RestrictedVcfWindow
- All Implemented Interfaces:
Closeable,AutoCloseable
Class RestrictedVcfWindow represents a sliding window of VCF
records.
Instances of class RestrictedVcfWindow are not thread.safe.
-
Constructor Summary
ConstructorsConstructorDescriptionRestrictedVcfWindow(SampleFileIt<? extends GTRec> it) Construct a newRestrictedVcfWindowinstance. -
Method Summary
Modifier and TypeMethodDescriptionGTRec[]advanceWindow(Markers nextMarkers) Advances the sliding marker window, and returns the advanced window as aGTRec[]object.voidclose()Releases any I/O resources controlled by this object.intReturns the number of VCF records in the union of the current window and all previous windows.file()Returns the file from which VCF records are read, or returnsnullif the source is standard input.intnSamples()Returns the number of samples.intoverlap()Returns the number of VCF records in the overlap between the current window and the previous window.samples()Returns the list of samples.toString()Returns a string representation ofthis.
-
Constructor Details
-
RestrictedVcfWindow
Construct a newRestrictedVcfWindowinstance.- Parameters:
it- an iterator that returns VCF records.- Throws:
IllegalArgumentException- ifit.hasNext() == falseIllegalArgumentException- if a format error is detected in a VCF recordNullPointerException- ifit == null
-
-
Method Details
-
advanceWindow
Advances the sliding marker window, and returns the advanced window as aGTRec[]object. The returned array will have lengthmarkers.nMarkers(). Markers not found in the data source will havenullentries in the returned array.- Parameters:
nextMarkers- the set of markers in the advanced window- Returns:
- the advanced marker window
- Throws:
IllegalArgumentException- ifmarkers.nMarkers() == 0IllegalArgumentException- if any two of the specified markers are on different chromosomesIllegalArgumentException- if specified markers are inconsistent with a sliding marker windowIllegalArgumentException- if the specified markers do not advance the current marker windowIllegalArgumentException- if a format error is detected in a VCF recordIllegalArgumentException- if the input data does not contain any of the specified markersNullPointerException- ifnextMarkers == null
-
file
Returns the file from which VCF records are read, or returnsnullif the source is standard input.- Returns:
- the file from which VCF records are read, or
nullif the source is standard input
-
samples
Returns the list of samples.- Returns:
- the list of samples
-
nSamples
public int nSamples()Returns the number of samples.- Returns:
- the number of samples
-
overlap
public int overlap()Returns the number of VCF records in the overlap between the current window and the previous window. Returns 0 if the current window is the first window.- Returns:
- the number of VCF records in the overlap between the current window and the previous window
-
cumMarkerCnt
public int cumMarkerCnt()Returns the number of VCF records in the union of the current window and all previous windows.- Returns:
- the number of VCF records in the union of the current window and all previous windows
-
close
public void close()Releases any I/O resources controlled by this object.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toString
Returns a string representation ofthis. The exact details of the representation are unspecified and subject to change.
-