fasta

package
v0.0.0-...-040724e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause, GPL-2.0, BSD-3-Clause, + 1 more Imports: 7 Imported by: 0

Documentation

Overview

Package fasta provides types to read and write FASTA format files.

Index

Constants

View Source
const (
	DefaultIDPrefix  = ">"
	DefaultSeqPrefix = ""
)

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.Reader, template seqio.SequenceAppender) *Reader

Returns a new fasta format reader using f. Sequences returned by the Reader are copied from the provided template.

func (*Reader) Read

func (r *Reader) Read() (seq.Sequence, error)

Read a single sequence and return it and potentially an error. Note that a non-nil returned error may be associated with a valid sequence, so it is the responsibility of the caller to examine the error to determine whether the read was successful. Note that if the Reader's template type returns different non-nil error values from calls to SetName and SetDescription, a new error string will be returned on each call to Read. So to allow direct error comparison these methods should return the same error.

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(w io.Writer, width int) *Writer

Returns a new fasta format writer using f.

func (*Writer) Write

func (w *Writer) Write(s seq.Sequence) (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