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 newWindowWriterobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the output file prefix.voidprintImputed(ImpData impData, int start, int end, AtomicReferenceArray<StateProbs> stateProbs) Prints the data inalProbsfor markers with index betweenrefStart(inclusive) andrefEnd(exclusive) to the output VCF file:this.outPrefix() + ".vcf.gz".voidprintPhased(Stage2Haps stage2Haps, int start, int end) voidprintPhased(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 newWindowWriterobject.- Parameters:
par- the analysis parameterssamples- the sample whose data will be printed- Throws:
IllegalArgumentException- ifoutPrefix.length() == 0NullPointerException- 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 inalProbsfor 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==nullNullPointerException- if any element ofstateProbsisnull
-
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() == falseIndexOutOfBoundsException- ifstart < 0 || end > phasedTarg.nMarkers() || start > endNullPointerException- ifphasedTarg == null
-
printPhased
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-