Documentation
¶
Overview ¶
Package regions provides an index for searching on intervals.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a searchable collection of intervals.
Example ¶
gene0start, gene0end := 100, 200 gene1start, gene1end := 150, 250 gene2start, gene2end := 130, 300 starts := []int{gene0start, gene1start, gene2start} ends := []int{gene0end, gene1end, gene2end} idx := NewIndex(starts, ends) fmt.Println(idx.At(140)) // Genes that overlap with position 140 fmt.Println(idx.At(200)) // Genes that overlap with position 200
Output: [0 2] [1 2]
Click to show internal directories.
Click to hide internal directories.