featio

package
Version: v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: BSD-3-Clause Imports: 2 Imported by: 18

Documentation

Overview

Package featio provides interfaces for feature I/O functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	// Read reads a feat.Feature, returning any error that occurs during the read.
	Read() (feat.Feature, error)
}

Reader is the common feat.Feature reader interface.

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner wraps a Reader to provide a convenient loop interface for reading feature data. Successive calls to the Scan method will step through the features of the provided Reader. Scanning stops unrecoverably at EOF or the first error.

Note that it is possible for a Reader to return a valid feature and a non-nil error. So programs that need more control over error handling should use a Reader directly instead.

func NewScanner

func NewScanner(r Reader) *Scanner

NewScanner returns a Scanner to read from r.

func NewScannerFromFunc

func NewScannerFromFunc(f func() (feat.Feature, error)) *Scanner

NewScannerFromFunc returns a Scanner to read features returned by calls to f.

func (*Scanner) Error

func (s *Scanner) Error() error

Error returns the first non-EOF error that was encountered by the Scanner.

func (*Scanner) Feat

func (s *Scanner) Feat() feat.Feature

Feat returns the most recent feature read by a call to Next.

func (*Scanner) Next

func (s *Scanner) Next() bool

Next advances the Scanner past the next feature, which will then be available through the Feat method. It returns false when the scan stops, either by reaching the end of the input or an error. After Next returns false, the Error method will return any error that occurred during scanning, except that if it was io.EOF, Error will return nil.

type Writer

type Writer interface {
	// Write write a feat.Feature, returning the number of bytes written and any
	// error that occurs during the write.
	Write(feat.Feature) (n int, err error)
}

Writer is the common feat.Feature writer interface.

Source Files

Directories

Path Synopsis
Package bed provides types to read and write BED format files according to the UCSC specification.
Package bed provides types to read and write BED format files according to the UCSC specification.
Package gff provides types to read and write version 2 General Feature Format files according to the Sanger Institute specification.
Package gff provides types to read and write version 2 General Feature Format files according to the Sanger Institute specification.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL