https://github.com/brentp/bix
tabix file access with golang using biogo machinery
https://github.com/brentp/bix
Last synced: 4 months ago
JSON representation
tabix file access with golang using biogo machinery
- Host: GitHub
- URL: https://github.com/brentp/bix
- Owner: brentp
- License: mit
- Created: 2015-09-04T17:17:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-07-18T14:09:52.000Z (almost 6 years ago)
- Last Synced: 2025-02-02T04:41:11.322Z (5 months ago)
- Language: Go
- Size: 477 KB
- Stars: 10
- Watchers: 4
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bix
===Tabix files in go.
[](https://godoc.org/github.com/brentp/bix)
`Bix`is a pure go tabix reader. Tabix has a minimum resolution of 16K bases. So, for dense annotations
like ExAC, repeated queries will have to re-parse the same intervals. To mitigate this, `Bix` caches
all annotations for the blocks from each query and re-uses them for later querires to the same block.
In practice, this results in 10X-100X speedup for any type of data.```go
tbx, err := bix.New(f)// Query returns an io.Reader
ph := true // print header ?
rdr, err := tbx.Query(chrom, start, end, ph)
buf := bufio.NewReader(rdr)
for {
line, err := bufr.ReadString('\n')
if err == io.EOF {
break
}
fmt.Println(line)
}
// orintervals := tbx.Get(chrom, start, end)
```
where intervals will be either a vcfgo.Variant or an Interval object with a Chrom(), Start(), and End() method.