Documentation ¶
Overview ¶
Package csi implements CSIv1 and CSIv2 coordinate sorted indexing.
Index ¶
- Constants
- func MinimumDepthFor(max int64, shift uint32) (uint32, bool)
- func MinimumShiftFor(max int64, depth uint32) (uint32, bool)
- func WriteTo(w io.Writer, idx *Index) error
- type Index
- func (i *Index) Add(r Record, c bgzf.Chunk, mapped, placed bool) error
- func (i *Index) Chunks(rid int, beg, end int) []bgzf.Chunk
- func (i *Index) MergeChunks(s index.MergeStrategy)
- func (i *Index) NumRefs() int
- func (i *Index) ReferenceStats(id int) (stats index.ReferenceStats, ok bool)
- func (i *Index) Unmapped() (n uint64, ok bool)
- type Record
Constants ¶
const ( // DefaultShift is the default minimum shift setting for a CSI. DefaultShift = 14 // DefaultDepth is the default index depth for a CSI. DefaultDepth = 5 )
Variables ¶
This section is empty.
Functions ¶
func MinimumDepthFor ¶
MinimumDepthFor returns the lowest depth value that can be used to index the given maximum position with the given index minimum shift.
func MinimumShiftFor ¶
MinimumShiftFor returns the lowest minimum shift value that can be used to index the given maximum position with the given index depth.
Types ¶
type Index ¶
Index implements coordinate sorted indexing.
func New ¶
New returns a CSI index with the given minimum shift and depth. The returned index defaults to CSI version 2.
func ReadFrom ¶
ReadFrom reads the CSI index from the given io.Reader. Note that the csi specification states that the index is stored as BGZF, but ReadFrom does not perform decompression.
func (*Index) Add ¶
Add records the Record as having being located at the given chunk with the given mapping and placement status.
func (*Index) MergeChunks ¶
func (i *Index) MergeChunks(s index.MergeStrategy)
MergeChunks applies the given MergeStrategy to all bins in the Index.
func (*Index) ReferenceStats ¶
func (i *Index) ReferenceStats(id int) (stats index.ReferenceStats, ok bool)
ReferenceStats returns the index statistics for the given reference and true if the statistics are valid.