fai

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

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

Go to latest
Published: Sep 4, 2015 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package fai implement FAI fasta sequence file index handling.

Index

Constants

This section is empty.

Variables

View Source
var ErrNonUnique = errors.New("non-unique record name")

Functions

This section is empty.

Types

type Index

type Index map[string]Record

Index is a FAI index.

func ReadFrom

func ReadFrom(r io.Reader) (idx Index, err error)

ReadFrom returns an Index from the stream provided by an io.Reader or an error. If the input contains non-unique records the error is a csv.ParseError identifying the second non-unique record.

type Record

type Record struct {
	// Name is the name of the sequence.
	Name string
	// Length is the length of the sequence.
	Length int
	// Start is the starting seek offset of
	// the sequence.
	Start int64
	// BasesPerLine is the number of sequences
	// bases per line.
	BasesPerLine int
	// BytesPerLine is the number of bytes
	// used to represent each line.
	BytesPerLine int
}

Record is a single FAI index record.

func (Record) Position

func (r Record) Position(p int) int64

Position returns the seek offset of the sequence position p for the given Record.

Jump to

Keyboard shortcuts

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