newick

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package newick handles reading and writing Newick-formatted trees.

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Name     string  // Node name. Can be empty.
	Distance float64 // Distance from parent. 0 is treated as none.
	Children []*Node // Child nodes. Can be nil.
}

A Node is a single node in a tree, along with the subtree that is under it.

func (*Node) Newick

func (n *Node) Newick() []byte

Newick returns a condensed Newick-format representation of this node.

type Reader

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

A Reader reads Newick-formatted trees.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a Reader that reads from the given stream.

func (*Reader) Read

func (r *Reader) Read() (*Node, error)

Read reads a single tree from the input. Can be called multiple times to read subsequent trees.

Jump to

Keyboard shortcuts

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