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 classSamComparison.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 booleanareEqual()intgetDuplicateMarkingsDiffer()intgetMappingsDiffer()intgetMappingsMatch()intgetMissingLeft()intgetMissingRight()intgetUnmappedBoth()intgetUnmappedLeft()intgetUnmappedRight()voidwriteReport(File output)voidwriteReport(File output, List<htsjdk.samtools.metrics.Header> headers)
-
-
-
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)
-
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()
-
-