Package main

Class WindowWriter

java.lang.Object
main.WindowWriter
All Implemented Interfaces:
Closeable, AutoCloseable

public class WindowWriter extends Object implements Closeable

Class WindowWriter writes VCF and IBD output data.

Instances of class WindowWriter are not thread-safe.

  • Constructor Details

    • WindowWriter

      public WindowWriter(Par par, Samples samples)
      Constructs a new WindowWriter object.
      Parameters:
      par - the analysis parameters
      samples - the sample whose data will be printed
      Throws:
      IllegalArgumentException - if outPrefix.length() == 0
      NullPointerException - if par == null || samples == null
  • Method Details

    • outPrefix

      public String outPrefix()
      Returns the output file prefix.
      Returns:
      the output file prefix
    • samples

      public Samples samples()
      Returns the samples whose data is written by this.
      Returns:
      the samples whose data is written by this
    • printImputed

      public void printImputed(ImpData impData, int start, int end, AtomicReferenceArray<StateProbs> stateProbs)
      Prints the data in alProbs for markers with index between refStart (inclusive) and refEnd (exclusive) to the output VCF file: this.outPrefix() + ".vcf.gz".
      Parameters:
      impData - the input data for genotype imputation
      start - the starting reference marker index (inclusive)
      end - the ending reference marker index (exclusive)
      stateProbs - the imputed state probabilities
      Throws:
      IllegalArgumentException - if stateProbs.size() != impData.nTargHaps()
      IndexOutOfBoundsException - if start < 0 || end > impData.refGT().nMarkers()
      NullPointerException - if impData==null || stateProbs==null
      NullPointerException - if any element of stateProbs is null
    • printPhased

      public void printPhased(GT phasedTarg, int start, int end)
      Appends the data in phased genotypes for the specified markers to the output VCF file: this.outPrefix() + ".vcf.gz".
      Parameters:
      phasedTarg - the estimated target haplotypes
      start - the starting marker index (inclusive)
      end - the ending marker index (exclusive)
      Throws:
      IllegalArgumentException - if phasedTarg.isPhased() == false
      IndexOutOfBoundsException - if start < 0 || end > phasedTarg.nMarkers() || start > end
      NullPointerException - if phasedTarg == null
    • printPhased

      public void printPhased(Stage2Haps stage2Haps, int start, int end)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable