tabix

package
v0.0.0-...-6b08992 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package tabix implements tabix coordinate sorted indexing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteTabix

func WriteTabix(w io.Writer, idx *Index) error

WriteTabix writes the index to the given io.Writer.

Types

type Index

type Index struct {
	Format    byte
	ZeroBased bool

	NameColumn  int32
	BeginColumn int32
	EndColumn   int32

	MetaChar rune
	Skip     int32
	// contains filtered or unexported fields
}

Index is a tabix index.

func NewTabix

func NewTabix() *Index

New returns a new tabix index.

func ReadTabix

func ReadTabix(r io.Reader) (*Index, error)

ReadTabix reads the tabix index from the given io.Reader.

func (*Index) Add

func (i *Index) Add(r Record, c bgzf.Chunk, placed, mapped bool) error

Add records the SAM record as having being located at the given chunk.

func (*Index) Chunks

func (i *Index) Chunks(r *sam.Reference, beg, end int) []bgzf.Chunk

Chunks returns a []bgzf.Chunk that corresponds to the given genomic interval.

func (*Index) MergeChunks

func (i *Index) MergeChunks(s index.MergeStrategy)

MergeChunks applies the given MergeStrategy to all bins in the Index.

func (*Index) Names

func (i *Index) Names() []string

Names returns the reference names in the index. The returned slice should not be altered.

func (*Index) NumRefs

func (i *Index) NumRefs() int

NumRefs returns the number of references 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.

func (*Index) Unmapped

func (i *Index) Unmapped() (n uint64, ok bool)

Unmapped returns the number of unmapped reads and true if the count is valid.

type Record

type Record interface {
	RefName() string
	Start() int
	End() int
}

Record wraps types that may be indexed by an Index.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL