org.hammerlab.guacamole.windowing

SlidingWindow

case class SlidingWindow[R <: ReferenceRegion](contigName: ContigName, halfWindowSize: Int, rawSortedRegions: Iterator[R]) extends Product with Serializable

Suppose we have a set of loci on a given contig and some objects that are mapped to that contig, and at each locus we want to look at the regions that overlap a window of a certain number of bases surrounding that locus. This class implements this "sliding window" functionality.

After instantiating this class, call setCurrentLocus repeatedly for each locus being considered. After calling this method, the currentRegions property will contain the objects that overlap the current locus. s To enable an efficient implementation, we require that both the sequence of loci to be considered and the iterator of objects are sorted.

halfWindowSize

Number of nucleotide bases to either side of the specified locus to provide regions for. For example, if halfWindowSize=5, and our currentLocus=100, then currentRegions will include regions that map to anywhere between 95 and 105, inclusive. Set to 0 to consider only regions that overlap the exact locus being considered, with no surrounding window.

rawSortedRegions

Iterator of regions, sorted by the aligned start locus.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SlidingWindow
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SlidingWindow(contigName: ContigName, halfWindowSize: Int, rawSortedRegions: Iterator[R])

    halfWindowSize

    Number of nucleotide bases to either side of the specified locus to provide regions for. For example, if halfWindowSize=5, and our currentLocus=100, then currentRegions will include regions that map to anywhere between 95 and 105, inclusive. Set to 0 to consider only regions that overlap the exact locus being considered, with no surrounding window.

    rawSortedRegions

    Iterator of regions, sorted by the aligned start locus.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val contigName: ContigName

  9. var currentLocus: Long

    The locus currently under consideration.

  10. def currentRegions(): Vector[R]

    The regions that overlap the window surrounding currentLocus.

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. val halfWindowSize: Int

    Number of nucleotide bases to either side of the specified locus to provide regions for.

    Number of nucleotide bases to either side of the specified locus to provide regions for. For example, if halfWindowSize=5, and our currentLocus=100, then currentRegions will include regions that map to anywhere between 95 and 105, inclusive. Set to 0 to consider only regions that overlap the exact locus being considered, with no surrounding window.

  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. var newRegions: Seq[R]

    The new regions that were added to currentRegions as a result of the most recent call to setCurrentLocus.

  18. def nextLocusWithRegions(): Option[Long]

    Find the next locus for which calling setCurrentLocus(locus) would result in a non-empty set of regions in currentRegions.

    Find the next locus for which calling setCurrentLocus(locus) would result in a non-empty set of regions in currentRegions.

    returns

    Some(locus) if such a locus exists, otherwise None

  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. val rawSortedRegions: Iterator[R]

    Iterator of regions, sorted by the aligned start locus.

  22. def setCurrentLocus(locus: Locus): Vector[R]

    Advance to the specified locus, which must be greater than the current locus.

    Advance to the specified locus, which must be greater than the current locus. After calling this, the currentRegions method will give the overlapping regions at the new locus.

    locus

    Locus to advance to.

    returns

    The *new regions* that were added as a result of this call. Note that this is not the full set of regions in the window: you must examine currentRegions for that.

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped