seqio

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: 2 Imported by: 0

Documentation

Overview

Package seqio provides interfaces for sequence 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 seq.Sequence, returning the sequence and any error that
	// occurred during the read.
	Read() (seq.Sequence, error)
}

Reader is the common seq.Sequence reader interface.

type Scanner

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

Scanner wraps a Reader to provide a convenient loop interface for reading sequence data. Successive calls to the Scan method will step through the sequences 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 sequence 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() (seq.Sequence, error)) *Scanner

NewScannerFromFunc returns a Scanner to read sequences 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) Next

func (s *Scanner) Next() bool

Next advances the Scanner past the next sequence, which will then be available through the Seq 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.

func (*Scanner) Seq

func (s *Scanner) Seq() seq.Sequence

Seq returns the most recent sequence read by a call to Next.

type SequenceAppender

type SequenceAppender interface {
	SetName(string) error
	SetDescription(string) error
	seq.Appender
	seq.Sequence
}

A SequenceAppender is a generic sequence type that can append elements.

type Writer

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

Writer is the common seq.Sequence writer interface.

Directories

Path Synopsis
Package alignio for reading and writing multiple sequence alignment files
Package alignio for reading and writing multiple sequence alignment files
Package fai implement FAI fasta sequence file index handling.
Package fai implement FAI fasta sequence file index handling.
Package fasta provides types to read and write FASTA format files.
Package fasta provides types to read and write FASTA format files.
Package fastq provides types to read and write FASTQ format files.
Package fastq provides types to read and write FASTQ format files.

Jump to

Keyboard shortcuts

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