Package bref
Class Bref3Header
java.lang.Object
bref.Bref3Header
Class Bref3Header represents the header of a bref3 file (binary
reference format version 3).
Instances of class Bref3Header are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionBref3Header(File source, DataInput dataIn, Filter<String> sampleFilter) Reads and constructs aBref3Headerinstance from the specified data input stream. -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns the list of filtered haplotype indices.int[]Returns an array with length(2 * this.unfilteredSampleIds())that mapsthis.includedHapIndices()[j]toj.program()Returns the program used to encode the bref3 file.samples()Returns the list of filtered samples.String[]Returns the list of unfiltered sample identifiers.
-
Constructor Details
-
Bref3Header
Reads and constructs aBref3Headerinstance from the specified data input stream. The constructor reads anintbref3 magic number, a string with the name of the encoding program, and an array of string sample identifiers from the data input stream. All strings are coded in modified UTF-8 format. The Java Virtual Machine will print an error message and exit if an I/O error or a file format error is detected.- Parameters:
source- the source bref3 file ornullif the bref3 file is read from stdindataIn- a data input streamsampleFilter- a sampleFilter- Throws:
NullPointerException- if(dataIn == null) || (sampleFilter == null)
-
-
Method Details
-
program
Returns the program used to encode the bref3 file.- Returns:
- the program used to encode the bref3 file
-
unfilteredSampleIds
Returns the list of unfiltered sample identifiers.- Returns:
- the list of unfiltered sample identifiers
-
filteredHapIndices
public int[] filteredHapIndices()Returns the list of filtered haplotype indices.- Returns:
- the list of filtered haplotype indices
-
invfilteredHapIndices
public int[] invfilteredHapIndices()Returns an array with length(2 * this.unfilteredSampleIds())that mapsthis.includedHapIndices()[j]toj. All other indices of the returned array that are assigned the value-1.- Returns:
- an inverse of the
this.filteredHapIndices()array
-
samples
Returns the list of filtered samples.- Returns:
- the list of filtered samples
-