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.Closeable
Class
WindowWriter
writes VCF and IBD output data.Instances of class
WindowWriter
are not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description WindowWriter(Samples samples, java.lang.String outPrefix)
Constructs a newWindowWriter
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.lang.String
outPrefix()
Returns the output file prefix.void
printImputed(ImpData impData, int refStart, int refEnd, java.util.concurrent.atomic.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(GT phasedTarg, int start, int end, int nThreads)
Writes the data in phased genotypes for the specified markers to the output VCF file:this.outPrefix() + ".vcf.gz"
.Samples
samples()
Returns the samples whose data is written bythis
.
-
-
-
Constructor Detail
-
WindowWriter
public WindowWriter(Samples samples, java.lang.String outPrefix)
Constructs a newWindowWriter
object.- Parameters:
samples
- the sample whose data will be printedoutPrefix
- the output file prefix- Throws:
java.lang.IllegalArgumentException
- ifoutPrefix.length() == 0
java.lang.NullPointerException
- ifsamples == null || outPrefix == 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 refStart, int refEnd, java.util.concurrent.atomic.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 imputationstateProbs
- the imputed state probabilitiesrefStart
- the starting ref marker index (inclusive)refEnd
- the ending ref 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==null
java.lang.NullPointerException
- if any element ofstateProbs
isnull
-
printPhased
public void printPhased(GT phasedTarg, int start, int end, int nThreads)
Writes 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)nThreads
- the number of parallel threads to use- Throws:
java.lang.IllegalArgumentException
- ifisImputed.length != alProbs.nMarkers()
java.lang.IllegalArgumentException
- ifphasedTarg.isPhased() == false
java.lang.IllegalArgumentException
- ifnThreads < 1
java.lang.IndexOutOfBoundsException
- ifstart < 0 || end > phasedTarg.nMarkers() || start > end
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-