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 | Description |
---|---|
WindowWriter(Samples samples,
java.lang.String outPrefix) |
Constructs a new
WindowWriter object. |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
java.lang.String |
outPrefix() |
Returns the output file prefix.
|
void |
print(ImpData impData,
java.util.concurrent.atomic.AtomicReferenceArray<StateProbs> stateProbs,
int refStart,
int refEnd) |
Prints the data in
alProbs for markers
with index between refStart (inclusive) and
refEnd (exclusive) to the output
VCF file: this.outPrefix() + ".vcf.gz" . |
void |
print(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" . |
void |
printGV(CurrentData cd,
GenotypeValues gv) |
Prints VCF records with GT and GP format fields for markers with
index between
cd.lastSplice() (inclusive) and
cd.nextSplice() (exclusive). |
Samples |
samples() |
Returns the samples whose data is written by
this . |
public WindowWriter(Samples samples, java.lang.String outPrefix)
WindowWriter
object.samples
- the sample whose data will be printedoutPrefix
- the output file prefixjava.lang.IllegalArgumentException
- if outPrefix.length() == 0
java.lang.NullPointerException
- if
samples == null || outPrefix == null
public java.lang.String outPrefix()
public Samples samples()
this
.this
public void printGV(CurrentData cd, GenotypeValues gv)
cd.lastSplice()
(inclusive) and
cd.nextSplice()
(exclusive).cd
- the input data for the current marker windowgv
- scaled genotype probabilities for the target samplesjava.lang.NullPointerException
- if cd == null || gv == null
public void print(ImpData impData, java.util.concurrent.atomic.AtomicReferenceArray<StateProbs> stateProbs, int refStart, int refEnd)
alProbs
for markers
with index between refStart
(inclusive) and
refEnd
(exclusive) to the output
VCF file: this.outPrefix() + ".vcf.gz"
.impData
- the input data for genotype imputationstateProbs
- the imputed state probabilitiesrefStart
- the starting ref marker index (inclusive)refEnd
- the ending ref marker index (exclusive)java.lang.IllegalArgumentException
- if
stateProbs.size() != impData.nTargHaps()
java.lang.IndexOutOfBoundsException
- if
refStart < 0 || refEnd > impData.refGT().nMarkers()
java.lang.NullPointerException
- if impData==null || stateProbs==null
java.lang.NullPointerException
- if any element of stateProbs
is
null
public void print(GT phasedTarg, int start, int end, int nThreads)
this.outPrefix() + ".vcf.gz"
.phasedTarg
- the estimated target haplotypesstart
- the starting marker index (inclusive)end
- the ending marker index (exclusive)nThreads
- the number of parallel threads to usejava.lang.IllegalArgumentException
- if
isImputed.length != alProbs.nMarkers()
java.lang.IllegalArgumentException
- if phasedTarg.isPhased() == false
java.lang.IllegalArgumentException
- if nThreads < 1
java.lang.IndexOutOfBoundsException
- if
start < 0 || end > phasedTarg.nMarkers() || start > end
public void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable