nexus

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteAlignment

func WriteAlignment(al align.Alignment) string

Types

type Parser added in v0.2.5

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 added in v0.2.5

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 added in v0.2.5

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

Parses Nexus content from the reader

type Scanner added in v0.2.5

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

Scanner represents a lexical scanner.

func NewScanner added in v0.2.5

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan added in v0.2.5

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

Scan returns the next token and literal value.

type Token added in v0.2.5

type Token int64
const (
	ILLEGAL Token = iota
	EOF
	WS
	IDENT        // Name of Node, or comment, or keyword
	NUMERIC      // Any numerical value
	OPENBRACK    // [ : For comment
	CLOSEBRACK   // ] : For comment
	ENDOFCOMMAND // ; End of command
	ENDOFLINE    // \r \n

	// Keywords
	NEXUS     // #NEXUS : Start of nexus file
	EQUAL     // '=' between keyword and value
	BEGIN     // Begin
	DATA      // Begin data -> Alignment
	TAXA      // Begin taxa -> Definition of taxa
	TAXLABELS // Begin taxa : list of  taxlabels
	TREES     // Begin trees -> Definition of trees
	TREE      // A specific tree in the BEGIN TREES section

	DIMENSIONS // Dimensions
	NTAX       // Dimensions : Number of taxa
	NCHAR      // Dimensions : Length of alignment

	FORMAT    // Format
	DATATYPE  // Format datatype=dna
	MISSING   // Format missing=?  missing char
	GAP       // Format gap=- gap character
	MATCHCHAR // Format matchchar=.  matching character compared to first seq

	MATRIX // Matrix
	END    // End
)

Jump to

Keyboard shortcuts

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