Package vcf
Class AllData
- java.lang.Object
-
- vcf.AllData
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceWindowCm()Advances the sliding window of VCF records.static AllDataallData(java.util.function.Supplier<SampleFileIt<RefGTRec>> supplier, SampleFileIt<GTRec> targIt, Par par)Constructs and returns a newAllDatainstance from VCF recList returned by the specifiedSampleFileItobjects.SamplesallSamples()Returns a list of all target and reference samples.booleancanAdvanceWindow()Returnstrueif the sliding window of VCF records can advance and returnsfalseotherwise.voidclose()Releases any I/O resources controlled by this object.GeneticMapgenMap()Returns the genetic map.booleanlastWindowOnChrom()Returnstrueif the current window of VCF records is the last window for the chromosome and returnsfalseotherwise.intmarkerIndex(int nonRefIndex)Returns the marker index corresponding to the specified target data marker.Markersmarkers()Returns the list of markers in the current window.intnAllSamples()Returns the total number of reference and target samples.intnextOverlapStart()Returns the first marker index in the overlap between this marker window and the next marker window.intnMarkers()Returns the number of markers in the current window.intnMarkersSoFar()Returns the number of markers in the union of the current window and all previous windows.intnRefSamples()Returns the number of reference samples.intnTargetMarkers()Returns the number of target data markers in the current window.intnTargetMarkersSoFar()Returns the number of target VCF records in the union of the current window and all previous windows.intnTargetSamples()Returns the number of target samples.intoverlap()Returns the number of VCF records in the overlap between the current window and the previous window.Pedigreeped()Returns the pedigree.RefGTrefGT()Returns the phased, nonmissing reference genotype data for the current window, ornullif there are no reference datajava.util.List<HapPair>refHapPairs()Returns a list of the reference haplotype pairs for the current window.SamplesrefSamples()Returns the list of reference samples, ornullif there are no reference samples.java.util.List<HapPair>restrictedRefHapPairs()Returns a list of reference haplotype pairs that are restricted to the target data markers in the current window.RefGTrestrictRefGT()Returns the phased, nonmissing reference genotype data for the target data markers in the current window.inttargetMarkerIndex(int refIndex)Returns the target data marker index corresponding to the specified marker, or returns -1 if no corresponding target data marker exists.MarkerstargetMarkers()Returns the list of target data markers in the current window.inttargetOverlap()Returns the number of target data markers in the overlap between the current marker window and the previous marker window.SamplestargetSamples()Returns the list of target samples.GTtargGT()Returns the genotype likelihoods for the target samples restricted to the target data markers in the current window.java.lang.StringtoString()Returns a string representation ofthis.intwindowIndex()Returns the current window index.
-
-
-
Method Detail
-
allData
public static AllData allData(java.util.function.Supplier<SampleFileIt<RefGTRec>> supplier, SampleFileIt<GTRec> targIt, Par par)
Constructs and returns a newAllDatainstance from VCF recList returned by the specifiedSampleFileItobjects.- Parameters:
supplier- an object to supply the reference file iteratortargIt- an iterator that returns target VCF recListpar- the command line parameters- Returns:
- a new
AllDatainstance - Throws:
java.lang.IllegalArgumentException- if either the reference data or target data contain no samplesjava.lang.IllegalArgumentException- if a format error is detected in a string VCF recordjava.lang.IllegalArgumentException- ifoverlap < 0 || Float.isFinite(overlap) == falsejava.lang.IllegalArgumentException- ifwindow <= overlap || Float.isFinite(window) == falsejava.lang.NullPointerException- ifrefIt == null || targetIt == null || genMap == null
-
genMap
public GeneticMap genMap()
Description copied from interface:DataReturns the genetic map.
-
lastWindowOnChrom
public boolean lastWindowOnChrom()
Description copied from interface:DataReturnstrueif the current window of VCF records is the last window for the chromosome and returnsfalseotherwise.- Specified by:
lastWindowOnChromin interfaceData- Returns:
trueif the current window of VCF records is the last window for the chromosome
-
canAdvanceWindow
public boolean canAdvanceWindow()
Description copied from interface:DataReturnstrueif the sliding window of VCF records can advance and returnsfalseotherwise.- Specified by:
canAdvanceWindowin interfaceData- Returns:
trueif the sliding window of VCF records can advance
-
advanceWindowCm
public void advanceWindowCm()
Description copied from interface:DataAdvances the sliding window of VCF records.- Specified by:
advanceWindowCmin interfaceData
-
windowIndex
public int windowIndex()
Description copied from interface:DataReturns the current window index. The first window has index 1.- Specified by:
windowIndexin interfaceData- Returns:
- the current window index
-
targetOverlap
public int targetOverlap()
Description copied from interface:DataReturns the number of target data markers in the overlap between the current marker window and the previous marker window. Returns 0 if the current marker window is the first marker window.- Specified by:
targetOverlapin interfaceData- Returns:
- the number of target data markers in the overlap between the current marker window and the previous marker window
-
overlap
public int overlap()
Description copied from interface:DataReturns 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.
-
nextOverlapStart
public int nextOverlapStart()
Description copied from interface:DataReturns the first marker index in the overlap between this marker window and the next marker window. Returnsthis.nMarkers()if the next marker window is from a different chromosome.- Specified by:
nextOverlapStartin interfaceData- Returns:
- the first marker index in the overlap between this marker window and the next marker window
-
nTargetMarkers
public int nTargetMarkers()
Description copied from interface:DataReturns the number of target data markers in the current window.- Specified by:
nTargetMarkersin interfaceData- Returns:
- the number of target data markers in the current window
-
nTargetMarkersSoFar
public int nTargetMarkersSoFar()
Description copied from interface:DataReturns the number of target VCF records in the union of the current window and all previous windows.- Specified by:
nTargetMarkersSoFarin interfaceData- Returns:
- the number of target VCF records in the union of the current window and all previous windows
-
targetMarkers
public Markers targetMarkers()
Description copied from interface:DataReturns the list of target data markers in the current window.- Specified by:
targetMarkersin interfaceData- Returns:
- the list of target data markers in the current window
-
nMarkers
public int nMarkers()
Description copied from interface:DataReturns the number of markers in the current window.
-
nMarkersSoFar
public int nMarkersSoFar()
Description copied from interface:DataReturns the number of markers in the union of the current window and all previous windows.- Specified by:
nMarkersSoFarin interfaceData- Returns:
- the number of markers in the union of the current window and all previous windows
-
markers
public Markers markers()
Description copied from interface:DataReturns the list of markers in the current window.
-
targetMarkerIndex
public int targetMarkerIndex(int refIndex)
Description copied from interface:DataReturns the target data marker index corresponding to the specified marker, or returns -1 if no corresponding target data marker exists. Indices are with respect to the current window.- Specified by:
targetMarkerIndexin interfaceData- Parameters:
refIndex- a marker index- Returns:
- the target data marker index corresponding to the specified marker, or returns -1 if no corresponding target data marker exists
-
markerIndex
public int markerIndex(int nonRefIndex)
Description copied from interface:DataReturns the marker index corresponding to the specified target data marker. Indices are with respect to the current window.- Specified by:
markerIndexin interfaceData- Parameters:
nonRefIndex- a target data marker index- Returns:
- the marker index corresponding to the specified target data marker
-
nTargetSamples
public int nTargetSamples()
Description copied from interface:DataReturns the number of target samples.- Specified by:
nTargetSamplesin interfaceData- Returns:
- the number of target samples
-
targetSamples
public Samples targetSamples()
Description copied from interface:DataReturns the list of target samples.- Specified by:
targetSamplesin interfaceData- Returns:
- the list of target samples
-
nRefSamples
public int nRefSamples()
Description copied from interface:DataReturns the number of reference samples.- Specified by:
nRefSamplesin interfaceData- Returns:
- the number of reference samples
-
refSamples
public Samples refSamples()
Description copied from interface:DataReturns the list of reference samples, ornullif there are no reference samples.- Specified by:
refSamplesin interfaceData- Returns:
- the list of reference samples, or
nullif there are no reference samples
-
nAllSamples
public int nAllSamples()
Description copied from interface:DataReturns the total number of reference and target samples.- Specified by:
nAllSamplesin interfaceData- Returns:
- the total number of reference and target samples
-
allSamples
public Samples allSamples()
Description copied from interface:DataReturns a list of all target and reference samples. Target samples are listed first in the same order as the list returned bythis.targetSamples(). Reference samples are listed last in the same order as the list returned bythis.refSamples().- Specified by:
allSamplesin interfaceData- Returns:
- a list of all target and reference samples
-
targGT
public GT targGT()
Description copied from interface:DataReturns the genotype likelihoods for the target samples restricted to the target data markers in the current window. The returnedGLinstance will contain no markers ifthis.advanceWindow()has not yet been invoked.
-
restrictedRefHapPairs
public java.util.List<HapPair> restrictedRefHapPairs()
Description copied from interface:DataReturns a list of reference haplotype pairs that are restricted to the target data markers in the current window. The returned list will be empty if there are no reference samples or ifthis.advanceWindow()has not yet been invoked.- Specified by:
restrictedRefHapPairsin interfaceData- Returns:
- a list of reference haplotype pairs that are restricted to the target data markers
-
refHapPairs
public java.util.List<HapPair> refHapPairs()
Description copied from interface:DataReturns a list of the reference haplotype pairs for the current window. The returned list will be empty if there are no reference samples or ifthis.advanceWindow()has not yet been invoked.- Specified by:
refHapPairsin interfaceData- Returns:
- a list of the reference haplotype pairs
-
refGT
public RefGT refGT()
Description copied from interface:DataReturns the phased, nonmissing reference genotype data for the current window, ornullif there are no reference data
-
restrictRefGT
public RefGT restrictRefGT()
Description copied from interface:DataReturns the phased, nonmissing reference genotype data for the target data markers in the current window. Returnsnullif there are no reference data- Specified by:
restrictRefGTin interfaceData- Returns:
- the reference genotype data for the target data markers
in the current window or
nullif there are no reference data
-
close
public void close()
Description copied from interface:DataReleases any I/O resources controlled by this object.
-
toString
public java.lang.String toString()
Returns a string representation ofthis. The exact details of the representation are unspecified and subject to change.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of
this
-
-