Package main
Class WindowWriter
- java.lang.Object
-
- main.WindowWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class WindowWriter extends java.lang.Object implements java.io.CloseableClass
WindowWriterwrites VCF and IBD output data.Instances of class
WindowWriterare not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description WindowWriter(Par par, Samples samples)Constructs a newWindowWriterobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.StringoutPrefix()Returns the output file prefix.voidprintImputed(ImpData impData, int start, int end, java.util.concurrent.atomic.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".Samplessamples()Returns the samples whose data is written bythis.
-
-
-
Constructor Detail
-
WindowWriter
public WindowWriter(Par par, Samples samples)
Constructs a newWindowWriterobject.- Parameters:
par- the analysis parameterssamples- the sample whose data will be printed- Throws:
java.lang.IllegalArgumentException- ifoutPrefix.length() == 0java.lang.NullPointerException- ifpar == null || samples == null
-
-
Method Detail
-
outPrefix
public java.lang.String outPrefix()
Returns the output file prefix.- Returns:
- the output file prefix
-
samples
public Samples 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, java.util.concurrent.atomic.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 imputationstateProbs- the imputed state probabilitiesstart- the starting reference marker index (inclusive)end- the ending reference marker index (exclusive)- Throws:
java.lang.IllegalArgumentException- ifstateProbs.size() != impData.nTargHaps()java.lang.IndexOutOfBoundsException- ifrefStart < 0 || refEnd > impData.refGT().nMarkers()java.lang.NullPointerException- ifimpData==null || stateProbs==nulljava.lang.NullPointerException- if any element ofstateProbsisnull
-
printPhased
public 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".- Parameters:
phasedTarg- the estimated target haplotypesstart- the starting marker index (inclusive)end- the ending marker index (exclusive)- Throws:
java.lang.IllegalArgumentException- ifphasedTarg.isPhased() == falsejava.lang.IndexOutOfBoundsException- ifstart < 0 || end > phasedTarg.nMarkers() || start > endjava.lang.NullPointerException- ifphasedTarg == null
-
printPhased
public void printPhased(Stage2Haps stage2Haps, int start, int end)
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-