fasta

package
v0.0.0-...-25502c3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2012 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package to read and write FASTA format files

Index

Constants

View Source
const (
	IDPrefix  = ">" // default delimiters
	SeqPrefix = ""  // default delimiters
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	IDPrefix  []byte
	SeqPrefix []byte
	// contains filtered or unexported fields
}

Fasta sequence format reader type.

func NewReader

func NewReader(f io.ReadCloser) *Reader

Returns a new fasta format reader using f.

func NewReaderName

func NewReaderName(name string) (r *Reader, err error)

Returns a new fasta format reader using a filename.

func (*Reader) Close

func (self *Reader) Close() (err error)

Close the reader.

func (*Reader) Read

func (self *Reader) Read() (sequence *seq.Seq, err error)

Read a single sequence and return it or an error.

func (*Reader) Rewind

func (self *Reader) Rewind() (err error)

Rewind the reader.

type Writer

type Writer struct {
	IDPrefix  []byte
	SeqPrefix []byte
	Width     int
	// contains filtered or unexported fields
}

Fasta sequence format writer type.

func NewWriter

func NewWriter(f io.WriteCloser, width int) *Writer

Returns a new fasta format writer using f.

func NewWriterName

func NewWriterName(name string, width int) (w *Writer, err error)

Returns a new fasta format writer using a filename, truncating any existing file. If appending is required use NewWriter and os.OpenFile.

func (*Writer) Close

func (self *Writer) Close() (err error)

Close the writer, flushing any unwritten sequence.

func (*Writer) Flush

func (self *Writer) Flush() error

Flush the writer.

func (*Writer) Write

func (self *Writer) Write(s *seq.Seq) (n int, err error)

Write a single sequence and return the number of bytes written and any error.

Jump to

Keyboard shortcuts

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