utils

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReader

func GetReader(inputfile string) (io.Closer, *bufio.Reader, error)

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

func GetReaderFromReader added in v0.2.4

func GetReaderFromReader(gzipped bool, rd io.Reader) (reader *bufio.Reader, err error)

Returns a buffered reader (gzip or not) for the given reader

func GzipExtension added in v0.2.4

func GzipExtension(name string) (gzipped bool)

func OpenFile

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

func ParseAlignmentAuto added in v0.2.4

func ParseAlignmentAuto(r *bufio.Reader, rootinputstrict bool) (al align.Alignment, format int, err error)

Parses the input buffer while automatically detecting the format between Newick, Phylip, and Nexus

If several alignments are present in the onput file, only the first will be parsed.

Returned format may be align.FORMAT_PHYLIP, align.FORMAT_FASTA, or align.FORMAT_NEXUS

rootinpustrict: In the case of phylip detected format: should we consider it as strict or not?

There is no new go routine here because only 1 alignment is parsed. No need to give a closer. If the reader comes from a file, the file must be closed in the calling function.

func ParseMultiAlignmentsAuto added in v0.2.4

func ParseMultiAlignmentsAuto(f io.Closer, r *bufio.Reader, rootinputstrict bool) (alchan *align.AlignChannel, format int, err error)

Parses the input buffer while automatically detecting the format between Newick, Phylip, and Nexus

If several alignments are present in the input file, they are queued in the channel

rootinpustrict: In the case of phylip detected format: should we consider it as strict or not?

If there is something to close ( f!=nil) after the parsing (like input file, etc.), f will be closed after parsing is finished (even in the go routine in the case of several input alignments). If the alignment comes from a file for exemple, the file will be closed by this function, so no need to do it in the calling function

Types

This section is empty.

Jump to

Keyboard shortcuts

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