utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReader added in v0.1.10

func GetReader(inputfile string) (*os.File, *bufio.Reader, error)

Returns the opened file and a buffered reader (gzip or not) for the file

func OpenFile added in v0.1.10

func OpenFile(inputfile string) (*os.File, error)

func ReadMultiTrees added in v0.2.0

func ReadMultiTrees(reader *bufio.Reader) <-chan tree.Trees

Read a bunch of trees from the input reader and send each of them to the output channel this function does not close the reader, but closes the channel at the end of the reading. It returns almost immediately because parsing is performed in a go routine. Iterating over the tree channel will synchronize computations. If an error occures while parsing, it stops parsing and sends a nil tree with the error in the channel

func ReadTree added in v0.2.0

func ReadTree(inputfile string) (*tree.Tree, error)

func ReadTreeReader added in v0.2.0

func ReadTreeReader(reader *bufio.Reader) (*tree.Tree, error)

Reads one tree from the input reader this function does not close the reader

func ReadUntilSemiColon added in v0.1.1

func ReadUntilSemiColon(r *bufio.Reader) (string, error)

ReadUntilSemiColon returns a string (without the ending \n) from the input buffered reader, ending at ';' or at end of file It allows to read a newick tree on several lines An error is returned iff there is an error with the buffered reader.

func Readln

func Readln(r *bufio.Reader) (string, error)

Readln returns a single line (without the ending \n) from the input buffered reader. An error is returned iff there is an error with the buffered reader.

Types

This section is empty.

Jump to

Keyboard shortcuts

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