Class HaplotypeBAMWriter
java.lang.Object
org.broadinstitute.hellbender.utils.haplotype.HaplotypeBAMWriter
- All Implemented Interfaces:
AutoCloseable
A BAMWriter that aligns reads to haplotypes and emits their best alignments to a destination.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Possible modes for writing haplotypes to BAMs -
Field Summary
-
Constructor Summary
ConstructorDescriptionHaplotypeBAMWriter
(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 fileHaplotypeBAMWriter
(HaplotypeBAMWriter.WriterType type, HaplotypeBAMDestination destination) Create a new HaplotypeBAMWriter of type "type" for writing SAMRecords to and output destination -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close any output resource associated with this writer.void
setAddSpecialTag
(boolean addSpecialTag) void
writeReadsAlignedToHaplotypes
(Collection<Haplotype> haplotypes, htsjdk.samtools.util.Locatable paddedReferenceLoc, Collection<Haplotype> bestHaplotypes, Set<Haplotype> calledHaplotypes, AlleleLikelihoods<GATKRead, Haplotype> readLikelihoods) 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).
-
Field Details
-
DEFAULT_HAPLOTYPE_READ_GROUP_ID
- See Also:
-
DEFAULT_GATK3_HAPLOTYPE_READ_GROUP_ID
- See Also:
-
-
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 nulloutputPath
- the destination, must not be nullcreateBamOutIndex
- true to create an index for the bamoutcreateBamOutMD5
- true to create an MD5 file for the bamoutsourceHeader
- the header of the input BAMs used to make calls, must not be null.
-
HaplotypeBAMWriter
Create a new HaplotypeBAMWriter of type "type" for writing SAMRecords to and output destination- Parameters:
type
- the type of the writer we want to createdestination
- 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 interfaceAutoCloseable
-
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 nullpaddedReferenceLoc
- the span of the based reference here, cannot be nullbestHaplotypes
- a list of the best (a subset of all) haplotypes that actually went forward into genotyping, cannot be nullcalledHaplotypes
- a list of the haplotypes that where actually called as non-reference, cannot be nullreadLikelihoods
- a map from sample -> likelihoods for each read for each of the best haplotypes, cannot be nullcallableRegion
- 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)
-