Package main
Class WindowWriter
java.lang.Object
main.WindowWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
Class WindowWriter
writes VCF and IBD output data.
Instances of class WindowWriter
are not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionWindowWriter
(Par par, Samples samples) Constructs a newWindowWriter
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns the output file prefix.void
printImputed
(ImpData impData, int start, int end, AtomicReferenceArray<StateProbs> stateProbs) Prints the data inalProbs
for markers with index betweenrefStart
(inclusive) andrefEnd
(exclusive) to the output VCF file:this.outPrefix() + ".vcf.gz"
.void
printPhased
(Stage2Haps stage2Haps, int start, int end) void
printPhased
(GT phasedTarg, int start, int end) Appends the data in phased genotypes for the specified markers to the output VCF file:this.outPrefix() + ".vcf.gz"
.samples()
Returns the samples whose data is written bythis
.
-
Constructor Details
-
WindowWriter
Constructs a newWindowWriter
object.- Parameters:
par
- the analysis parameterssamples
- the sample whose data will be printed- Throws:
IllegalArgumentException
- ifoutPrefix.length() == 0
NullPointerException
- ifpar == null || samples == null
-
-
Method Details
-
outPrefix
Returns the output file prefix.- Returns:
- the output file prefix
-
samples
Returns the samples whose data is written bythis
.- Returns:
- the samples whose data is written by
this
-
printImputed
public void printImputed(ImpData impData, int start, int end, AtomicReferenceArray<StateProbs> stateProbs) Prints the data inalProbs
for markers with index betweenrefStart
(inclusive) andrefEnd
(exclusive) to the output VCF file:this.outPrefix() + ".vcf.gz"
.- Parameters:
impData
- the input data for genotype imputationstart
- the starting reference marker index (inclusive)end
- the ending reference marker index (exclusive)stateProbs
- the imputed state probabilities- Throws:
IllegalArgumentException
- ifstateProbs.size() != impData.nTargHaps()
IndexOutOfBoundsException
- ifstart < 0 || end > impData.refGT().nMarkers()
NullPointerException
- ifimpData==null || stateProbs==null
NullPointerException
- if any element ofstateProbs
isnull
-
printPhased
Appends the data in phased genotypes for the specified markers to the output VCF file:this.outPrefix() + ".vcf.gz"
.- Parameters:
phasedTarg
- the estimated target haplotypesstart
- the starting marker index (inclusive)end
- the ending marker index (exclusive)- Throws:
IllegalArgumentException
- ifphasedTarg.isPhased() == false
IndexOutOfBoundsException
- ifstart < 0 || end > phasedTarg.nMarkers() || start > end
NullPointerException
- ifphasedTarg == null
-
printPhased
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-