Documentation ¶
Overview ¶
Package matrix provides a matrix of taxon specimens and character observations.
Index ¶
- Constants
- type Field
- type Matrix
- func (m *Matrix) Add(taxon, spec, char, state string)
- func (m *Matrix) Chars() []string
- func (m *Matrix) Obs(spec, char string) []string
- func (m *Matrix) ReadTSV(r io.Reader) error
- func (m *Matrix) Set(spec, char, state, val string, field Field)
- func (m *Matrix) Specimens() []string
- func (m *Matrix) States(char string) []string
- func (m *Matrix) TSV(w io.Writer) error
- func (m *Matrix) Val(spec, char, state string, field Field) string
Constants ¶
View Source
const NotApplicable = "<na>"
Character states without data.
View Source
const Unknown = "<unknown>"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field string
Field is used to define additional information fields of an observation.
type Matrix ¶
type Matrix struct {
// contains filtered or unexported fields
}
A Matrix is a phylogenetic data matrix, a collection of taxa and their character states.
func (*Matrix) Add ¶
Add adds a new observation (i.e., a character state) to the matrix for a given taxon specimen, and character.
func (*Matrix) ReadTSV ¶
ReadTSV reads a set of specimen observations from a TSV file.
The TSV file must contains the following fields:
- taxon, the taxonomic name of the taxon
- specimen, the ID of the particular specimen observed
- character, the name of the observed character
- state, the observed character state
Additional fields are:
- reference, an ID of a bibliographic reference
- image, a path to an image of the observation
- comments, simple comments about the observation
Here is an example file:
# character observations taxon specimen character state reference image comments Ascaphidae ascaphidae:kluge69 tail muscle present kluge1969 Ascaphidae ascaphidae:kluge69 ribs, fusion free kluge1969 Discoglossidae discoglossidae:kluge69 tail muscle absent kluge1969 Discoglossidae discoglossidae:kluge69 ribs, fusion free kluge1969 Pipidae pipidae:kluge69 tail muscle absent kluge1969 Pipidae pipidae:kluge69 ribs, fusion fused in adults kluge1969
Click to show internal directories.
Click to hide internal directories.