Package bref

Class Bref3Header

java.lang.Object
bref.Bref3Header

public class Bref3Header extends Object

Class Bref3Header represents the header of a bref3 file (binary reference format version 3).

Instances of class Bref3Header are immutable.

  • Constructor Details

    • Bref3Header

      public Bref3Header(File source, DataInput dataIn, Filter<String> sampleFilter)
      Reads and constructs a Bref3Header instance from the specified data input stream. The constructor reads an int bref3 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 or null if the bref3 file is read from stdin
      dataIn - a data input stream
      sampleFilter - a sampleFilter
      Throws:
      NullPointerException - if (dataIn == null) || (sampleFilter == null)
  • Method Details

    • program

      public String program()
      Returns the program used to encode the bref3 file.
      Returns:
      the program used to encode the bref3 file
    • unfilteredSampleIds

      public String[] 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 maps this.includedHapIndices()[j] to j. All other indices of the returned array that are assigned the value -1.
      Returns:
      an inverse of the this.filteredHapIndices() array
    • samples

      public Samples samples()
      Returns the list of filtered samples.
      Returns:
      the list of filtered samples