Interface Locatable

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean contains​(Locatable other)
      Determines whether this interval contains the entire region represented by other (in other words, whether it covers it).
      default boolean contigsMatch​(Locatable other)
      Determine if this is on the same contig as other this must be equivalent to this.getContig().equals(other.getContig()) but may be implemented more efficiently
      String getContig()
      Gets the contig name for the contig this is mapped to.
      int getEnd()  
      default int getLengthOnReference()  
      int getStart()  
      default boolean overlaps​(Locatable other)
      Determines whether this interval overlaps the provided locatable.
      default boolean withinDistanceOf​(Locatable other, int distance)
      Determines whether this interval comes within distance of overlapping the provided locatable.
    • Method Detail

      • getContig

        String getContig()
        Gets the contig name for the contig this is mapped to. May return null if there is no unique mapping.
        Returns:
        name of the contig this is mapped to, potentially null
      • getStart

        int getStart()
        Returns:
        1-based start position, undefined if getContig() == null
      • getEnd

        int getEnd()
        Returns:
        1-based closed-ended position, undefined if getContig() == null
      • getLengthOnReference

        default int getLengthOnReference()
        Returns:
        number of bases of reference covered by this interval
      • overlaps

        default boolean overlaps​(Locatable other)
        Determines whether this interval overlaps the provided locatable.
        Parameters:
        other - interval to check
        Returns:
        true if this interval overlaps other, otherwise false
      • withinDistanceOf

        default boolean withinDistanceOf​(Locatable other,
                                         int distance)
        Determines whether this interval comes within distance of overlapping the provided locatable. When distance = 0 this is equal to overlaps(Locatable)
        Parameters:
        other - interval to check
        distance - how many bases may be between the two intervals for us to still consider them overlapping.
        Returns:
        true if this interval overlaps other, otherwise false
      • contains

        default boolean contains​(Locatable other)
        Determines whether this interval contains the entire region represented by other (in other words, whether it covers it).
        Parameters:
        other - interval to check
        Returns:
        true if this interval contains all of the base positions spanned by other, otherwise false
      • contigsMatch

        default boolean contigsMatch​(Locatable other)
        Determine if this is on the same contig as other this must be equivalent to this.getContig().equals(other.getContig()) but may be implemented more efficiently
        Returns:
        true iff this.getContig().equals(other.getContig())