Class SamComparison


  • public final class SamComparison
    extends Object
    Compare two SAM/BAM files. Compares headers, and if headers are compatible enough, compares SAMRecords, looking at alignment and duplicate marking info. Can perform either a naive comparison for which each alignment must be identical, or a more sophisticated check of "equivalence", where mapping quality 0 reads are allowed to have different alignments, and duplicate marks are allowed to differ to account for ambiguities in selecting the representative read of a duplicate set. Results of comparison are summarised in an output metrics file.
    • Constructor Detail

      • SamComparison

        public SamComparison​(htsjdk.samtools.SamReader leftReader,
                             htsjdk.samtools.SamReader rightReader)
        Note: the caller must make sure the SamReaders are closed properly.
      • SamComparison

        public SamComparison​(htsjdk.samtools.SamReader leftReader,
                             htsjdk.samtools.SamReader rightReader,
                             String leftName,
                             String rightName,
                             SAMComparisonArgumentCollection samComparisonArgumentCollection)
    • Method Detail

      • writeReport

        public void writeReport​(File output)
      • writeReport

        public void writeReport​(File output,
                                List<htsjdk.samtools.metrics.Header> headers)
      • getMappingsMatch

        public int getMappingsMatch()
      • getUnmappedBoth

        public int getUnmappedBoth()
      • getUnmappedLeft

        public int getUnmappedLeft()
      • getUnmappedRight

        public int getUnmappedRight()
      • getMappingsDiffer

        public int getMappingsDiffer()
      • getMissingLeft

        public int getMissingLeft()
      • getMissingRight

        public int getMissingRight()
      • getDuplicateMarkingsDiffer

        public int getDuplicateMarkingsDiffer()
      • areEqual

        public boolean areEqual()