seqio

package
v0.0.0-...-35b420c Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package seqio is a generic namespace shared by all biological sequence input and output handlers. This package contain a very barebone and simple Fasta format sequence file parser. Currently, it parses and returns the Id(header) and sequence. This is mostly working concept, however could be easily extended in future. Example:

for r := range seqio.ParseFASTA("sequences.fa") {
    result.MonadFold(r,
        func(err error) any { /* handle malformed record / I/O */ },
        func(rec seqio.Fasta) any { /* use rec */ },
    )
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFASTA

func ParseFASTA(path string) IR.SeqResult[Fasta]

ParseFASTA opens a FASTA file and returns a SeqResult[Fasta] — a lazy stream where each element is Right(Fasta) or Left(error). Per-record errors emit Left and continue; the file is deterministically closed when iteration finishes (EOF, error, or break).

Types

type Fasta

type Fasta struct {
	ID       []byte
	Sequence []byte
}

Fasta is a struct representing a fasta record, containing the sequence ID and the sequence itself.

Jump to

Keyboard shortcuts

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