Package imp

Class ImputedVcfWriter

java.lang.Object
imp.ImputedVcfWriter

public class ImputedVcfWriter extends Object

Class ImputedVcfWriter writes observed and imputed genotypes to a VCF output file.

Instances of class ImputedVcfWriter are not thread-safe.

  • Constructor Details

    • ImputedVcfWriter

      public ImputedVcfWriter(ImpData impData, int refStart, int refEnd, int targCluster)
      Constructs a new ImputedVcfWriter instance from the specified data.
      Parameters:
      impData - the input data for genotype imputation
      refStart - an lower bound (inclusive) on the reference markers that will be printed
      refEnd - an upper bound (exclusive) on the reference markers that will be printed
      targCluster - the index of the target marker cluster in the interval of reference markers that will be printed
      Throws:
      IndexOutOfBoundsException - if (refStart < 0 || refEnd > impData.refGT().nMarkers())
      IndexOutOfBoundsException - if targCluster < 0 || targCluster >= impData.nClusters()
      NullPointerException - if impData == null
  • Method Details

    • appendRecords

      public void appendRecords(AtomicReferenceArray<StateProbs> stateProbs, PrintWriter out)
      Writes the VCF records to the specified PrintWriter.
      Parameters:
      stateProbs - the imputed state probabilities at genotyped markers in the target samples
      out - the PrintWriter to which VCF records will be written
      Throws:
      NullPointerException - if stateProbs == null || out == null
      NullPointerException - if there exists a j satisfying (0 <= j && j < stateProbs.size()) && (stateProbs.get(j) == null)