Package picard.sam.util

## 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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SamComparison.AlignmentComparison` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SamComparison​(htsjdk.samtools.SamReader leftReader, htsjdk.samtools.SamReader rightReader)` | Note: the caller must make sure the SamReaders are closed properly.
    `SamComparison​(htsjdk.samtools.SamReader leftReader, htsjdk.samtools.SamReader rightReader, String leftName, String rightName, SAMComparisonArgumentCollection samComparisonArgumentCollection)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `areEqual()` |
    `int` | `getDuplicateMarkingsDiffer()` |
    `int` | `getMappingsDiffer()` |
    `int` | `getMappingsMatch()` |
    `int` | `getMissingLeft()` |
    `int` | `getMissingRight()` |
    `int` | `getUnmappedBoth()` |
    `int` | `getUnmappedLeft()` |
    `int` | `getUnmappedRight()` |
    `void` | `writeReport​(File output)` |
    `void` | `writeReport​(File output, List<htsjdk.samtools.metrics.Header> headers)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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