Package bref
Class CompressBref3Writer
java.lang.Object
bref.CompressBref3Writer
- All Implemented Interfaces:
BrefWriter
,Closeable
,AutoCloseable
Class CompressBref3Writer
writes phased, non-missing genotypes
to a binary reference format v3 (bref) file.
The close()
method must be called after the last invocation of
the write()
method in order to ensure that all buffered
data is written to the output binary reference file.
Instances of class CompressBrerf3Writer
are not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionCompressBref3Writer
(String program, Samples samples, int maxNSeq, File brefFile) Constructs a newCompressBref3fWriter
for the specified data. -
Method Summary
-
Constructor Details
-
CompressBref3Writer
Constructs a newCompressBref3fWriter
for the specified data. The Java virtual machine will exit with an error message if an I/O error occurs.- Parameters:
program
- the name of the program which is creating the binary reference file.samples
- the list of samples whose genotype data will be written in binary reference formatmaxNSeq
- the maximum number of distinct allele sequences in a compressed blockbrefFile
- name of the output binary reference file ornull
if the output should be directed to standard output- Throws:
IllegalArgumentException
-maxNSeq < 0 || maxNSeq >= Character.MAX_VALUE
NullPointerException
- ifprogram == null || samples == null
-
-
Method Details
-
samples
Description copied from interface:BrefWriter
Returns the list of samples.- Specified by:
samples
in interfaceBrefWriter
- Returns:
- the list of samples
-
write
Description copied from interface:BrefWriter
Writes the specified phased genotype data in binary reference format. The Java virtual machine will exit with an error message if an I/O error occurs during method execution, ifthis.close()
has previously been invoked, or ifrec.samples().equals(this.samples()) == false
.- Specified by:
write
in interfaceBrefWriter
- Parameters:
rec
- phased genotype data
-
close
public void close()Description copied from interface:BrefWriter
Flushes any buffered output and releases any system resources that are held by thisBrefWriter
. The Java virtual machine will exit with an error message if an I/O error occurs during method execution.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBrefWriter
- Specified by:
close
in interfaceCloseable
-