Class SamComparison

java.lang.Object
picard.sam.util.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 Details

    • 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 Details

    • 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()