Class HaplotypeBAMWriter

java.lang.Object
org.broadinstitute.hellbender.utils.haplotype.HaplotypeBAMWriter
All Implemented Interfaces:
AutoCloseable

public class HaplotypeBAMWriter extends Object implements AutoCloseable
A BAMWriter that aligns reads to haplotypes and emits their best alignments to a destination.
  • Field Details

  • Constructor Details

    • HaplotypeBAMWriter

      public HaplotypeBAMWriter(HaplotypeBAMWriter.WriterType type, Path outputPath, boolean createBamOutIndex, boolean createBamOutMD5, htsjdk.samtools.SAMFileHeader sourceHeader)
      Create a new HaplotypeBAMWriter of type "type" for writing SAMRecords to an output file
      Parameters:
      type - the type of the writer we want to create, must not be null
      outputPath - the destination, must not be null
      createBamOutIndex - true to create an index for the bamout
      createBamOutMD5 - true to create an MD5 file for the bamout
      sourceHeader - the header of the input BAMs used to make calls, must not be null.
    • HaplotypeBAMWriter

      public HaplotypeBAMWriter(HaplotypeBAMWriter.WriterType type, HaplotypeBAMDestination destination)
      Create a new HaplotypeBAMWriter of type "type" for writing SAMRecords to and output destination
      Parameters:
      type - the type of the writer we want to create
      destination - the destination, must not be null. Note that SAM writer associated with the destination must have its presorted bit set to false, as reads may come in out of order during writing.
  • Method Details

    • close

      public void close()
      Close any output resource associated with this writer.
      Specified by:
      close in interface AutoCloseable
    • writeReadsAlignedToHaplotypes

      public void writeReadsAlignedToHaplotypes(Collection<Haplotype> haplotypes, htsjdk.samtools.util.Locatable paddedReferenceLoc, Collection<Haplotype> bestHaplotypes, Set<Haplotype> calledHaplotypes, AlleleLikelihoods<GATKRead,Haplotype> readLikelihoods, htsjdk.samtools.util.Locatable callableRegion)
      Write out a BAM representing for the haplotype caller at this site writerType (ALL_POSSIBLE_HAPLOTYPES or CALLED_HAPLOTYPES) determines inputs to writeHaplotypesAsReads Write out a BAM representing the haplotypes at this site, based on the value for writerType used when the writer was constructed (ALL_POSSIBLE_HAPLOTYPES or CALLED_HAPLOTYPES).
      Parameters:
      haplotypes - a list of all possible haplotypes at this loc, cannot be null
      paddedReferenceLoc - the span of the based reference here, cannot be null
      bestHaplotypes - a list of the best (a subset of all) haplotypes that actually went forward into genotyping, cannot be null
      calledHaplotypes - a list of the haplotypes that where actually called as non-reference, cannot be null
      readLikelihoods - a map from sample -> likelihoods for each read for each of the best haplotypes, cannot be null
      callableRegion - the region over which variants are being called
    • writeReadsAlignedToHaplotypes

      public void writeReadsAlignedToHaplotypes(Collection<Haplotype> haplotypes, htsjdk.samtools.util.Locatable paddedReferenceLoc, Collection<Haplotype> bestHaplotypes, Set<Haplotype> calledHaplotypes, AlleleLikelihoods<GATKRead,Haplotype> readLikelihoods)
    • setAddSpecialTag

      public void setAddSpecialTag(boolean addSpecialTag)