Class SAMSortOrderChecker

java.lang.Object
htsjdk.samtools.SAMSortOrderChecker

public class SAMSortOrderChecker extends Object
Encapsulates simple check for SAMRecord order.
  • Constructor Details

  • Method Details

    • isSorted

      public boolean isSorted(SAMRecord rec)
      Check if given SAMRecord violates sort order relative to previous SAMRecord.
      Returns:
      True if sort order is unsorted, if this is the first record, or if previous <= rec.
    • getPreviousRecord

      public SAMRecord getPreviousRecord()
    • getSortOrder

      public SAMFileHeader.SortOrder getSortOrder()
    • getSortKey

      public String getSortKey(SAMRecord rec)
      Return the sort key used for the given sort order. Useful in error messages. This should only be used in error messages and program correctness should not rely on this.