fasta

package
Version: v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: GPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FASTA_LINE_LEN   = 80 // max line length for fasta output
	FASTA_INITIAL_NB = 2  // max line length for fasta output
)
View Source
const (
	FASTA_LINE = 80
)

Variables

This section is empty.

Functions

func WriteAlignment

func WriteAlignment(sb align.SeqBag) string

func WriteSequences added in v0.1.1

func WriteSequences(sb align.SeqBag) string

Write input alignment as standard fasta sequences It removes "-" characters.

Types

type Parser

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

Parser represents a parser. If ignore is align.IGNORE_NONE: Does not ignore anything If ignore is align.IGNORE_NAME: Ignore sequences having the same name (keep the first one whatever their sequence) If ignore is align.IGNORE_SEQUENCE: Ignore sequences having the same name and the same sequence Otherwise, sets IGNORE_NONE

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) IgnoreIdentical added in v0.3.1

func (p *Parser) IgnoreIdentical(ignore int)

If sets to true, then will ignore duplicate sequences that have the same name and the same sequence Otherwise, it just renames them just as the sequences that have same name and different sequences

func (*Parser) Parse

func (p *Parser) Parse() (al align.Alignment, err error)

Parse parses a FASTA alignment

func (*Parser) ParseUnalign added in v0.3.0

func (p *Parser) ParseUnalign() (sb align.SeqBag, err error)

ParseUnalign parses an unaligned FASTA file

type Scanner

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

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit string)

Scan returns the next token and literal value.

type Token

type Token int64
const (
	ILLEGAL    Token = iota
	STARTIDENT       // > start of ident line
	IDENTIFIER       // Identifier of sequence or part of sequence
	ENDOFLINE        // End of line token
	EOF              // End of File
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL