Class SAMRecordQueryNameComparator

java.lang.Object
htsjdk.samtools.SAMRecordQueryNameComparator
All Implemented Interfaces:
SAMRecordComparator, Serializable, Comparator<SAMRecord>
Direct Known Subclasses:
SAMRecordQueryHashComparator

public class SAMRecordQueryNameComparator extends Object implements SAMRecordComparator, Serializable
Comparator for "queryname" ordering of SAMRecords.
See Also:
  • Constructor Details

    • SAMRecordQueryNameComparator

      public SAMRecordQueryNameComparator()
  • Method Details

    • compare

      public int compare(SAMRecord samRecord1, SAMRecord samRecord2)
      Specified by:
      compare in interface Comparator<SAMRecord>
    • fileOrderCompare

      public int fileOrderCompare(SAMRecord samRecord1, SAMRecord samRecord2)
      Less stringent compare method than the regular compare. If the two records are equal enough that their ordering in a sorted SAM file would be arbitrary, this method returns 0.
      Specified by:
      fileOrderCompare in interface SAMRecordComparator
      Returns:
      negative if samRecord1 < samRecord2, 0 if equal, else positive
    • compareReadNames

      public static int compareReadNames(String readName1, String readName2)
      Encapsulate algorithm for comparing read names in queryname-sorted file, since there have been conversations about changing the behavior.