fasta

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package fasta decodes and encodes fasta files.

This package uses the format described in: https://en.wikipedia.org/wiki/FASTA_format

This package does not validate sequence characters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File added in v1.0.0

func File(file string) iter.Seq2[*Fasta, error]

File returns an iterator over fasta entries in a file.

func Reader

func Reader(r io.Reader) iter.Seq2[*Fasta, error]

Reader returns an iterator over fasta entries in a reader.

Types

type Fasta

type Fasta struct {
	Name     []byte // Sequence name (without the '>')
	Sequence []byte // Sequence
}

Fasta is a single sequence in a fasta file.

func (*Fasta) MarshalText added in v0.1.17

func (f *Fasta) MarshalText() ([]byte, error)

MarshalText returns the textual representation of f in fasta format. Includes a trailing new line. Always includes a name line, even for empty names. Sequence gets broken down into lines of length 80.

func (*Fasta) Write added in v1.0.0

func (f *Fasta) Write(w io.Writer) error

Write writes this entry in textual Fasta format to the given writer. Includes a trailing new line.

Jump to

Keyboard shortcuts

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