Package bref
Class CompressBref3Writer
- java.lang.Object
-
- bref.CompressBref3Writer
-
- All Implemented Interfaces:
BrefWriter,java.io.Closeable,java.lang.AutoCloseable
public class CompressBref3Writer extends java.lang.Object implements BrefWriter
Class
CompressBref3Writerwrites phased, non-missing genotypes to a binary reference format v3 (bref) file. Theclose()method must be called after the last invocation of thewrite()method in order to ensure that all buffered data is written to the output binary reference file.Instances of class
CompressBrerf3Writerare not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description CompressBref3Writer(java.lang.String program, Samples samples, int maxNSeq, java.io.File brefFile)Constructs a newCompressBref3fWriterfor the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Flushes any buffered output and releases any system resources that are held by thisBrefWriter.Samplessamples()Returns the list of samples.voidwrite(RefGTRec rec)Writes the specified phased genotype data in binary reference format.
-
-
-
Constructor Detail
-
CompressBref3Writer
public CompressBref3Writer(java.lang.String program, Samples samples, int maxNSeq, java.io.File brefFile)Constructs a newCompressBref3fWriterfor 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 ornullif the output should be directed to standard output- Throws:
java.lang.IllegalArgumentException-maxNSeq < 0 || maxNSeq >= Chracter.MAX_VALUEjava.lang.NullPointerException- ifprogram == null || samples == null
-
-
Method Detail
-
samples
public Samples samples()
Description copied from interface:BrefWriterReturns the list of samples.- Specified by:
samplesin interfaceBrefWriter- Returns:
- the list of samples
-
write
public void write(RefGTRec rec)
Description copied from interface:BrefWriterWrites 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:
writein interfaceBrefWriter- Parameters:
rec- phased genotype data
-
close
public void close()
Description copied from interface:BrefWriterFlushes 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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceBrefWriter- Specified by:
closein interfacejava.io.Closeable
-
-