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 newRestrictedVcfWindow
instance. -
Method Summary
Modifier and TypeMethodDescriptionGTRec[]
advanceWindow
(Markers nextMarkers) Advances the sliding marker window, and returns the advanced window as aGTRec[]
object.void
close()
Releases any I/O resources controlled by this object.int
Returns 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 returnsnull
if the source is standard input.int
nSamples()
Returns the number of samples.int
overlap()
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 newRestrictedVcfWindow
instance.- Parameters:
it
- an iterator that returns VCF records.- Throws:
IllegalArgumentException
- ifit.hasNext() == false
IllegalArgumentException
- 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 havenull
entries in the returned array.- Parameters:
nextMarkers
- the set of markers in the advanced window- Returns:
- the advanced marker window
- Throws:
IllegalArgumentException
- ifmarkers.nMarkers() == 0
IllegalArgumentException
- 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 returnsnull
if the source is standard input.- Returns:
- the file from which VCF records are read, or
null
if 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
toString
Returns a string representation ofthis
. The exact details of the representation are unspecified and subject to change.
-