Documentation ¶
Index ¶
- Constants
- func Events() []int
- type Eval
- type Node
- type Recons
- func (r *Recons) Copy(cp *Recons)
- func (r *Recons) Cost() float64
- func (r *Recons) DownPass(n int) float64
- func (r *Recons) Evaluate() Eval
- func (r *Recons) IsDiff(cp *Recons) bool
- func (r *Recons) MakeCopy() *Recons
- func (r *Recons) Randomize(prob int, evs []int)
- func (r *Recons) SetFoundCost(c float64)
- func (r *Recons) SetPointCost(c float64)
- func (r *Recons) SetSympCost(c float64)
- func (r *Recons) SetVicCost(c float64)
- func (r *Recons) Write(out io.Writer, header bool) error
Constants ¶
const ( Undef = iota Vic SympU SympL SympR PointL PointR FoundL FoundR )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Eval ¶
type Eval struct { Vics int // Number of vicariant events Symp int // Number of sympatry events Point int // Number of punctual sympatry events Found int // Number of founder events }
Eval store the evaluation of a given reconstruction.
type Node ¶
type Node struct { Node *tree.Node Fill bitfield.Bitfield Obs bitfield.Bitfield SetL int SetR int Cost float64 Flag int }
A Node is a reconstruction of a node.
type Recons ¶
type Recons struct { ID string Tree *tree.Tree Raster *raster.Raster Rec []Node UseLen bool // events costs Size float64 SympSize float64 VicC float64 SympC float64 PointC float64 FoundC float64 }
A Recons is a reconstruction of a given raster in a particular tree.
func OR ¶
OR creates an OR reconstruction based on raster and tree data. If scaled is true, then the cost at each node will be scaled by the ancestral distribution.
func Read ¶
func Read(in io.Reader, ras *raster.Raster, ts []*tree.Tree, size, sympSize float64, useLen bool) ([]*Recons, error)
Read reads a reconstruction from one or most trees in tsv format from an input stream.
func (*Recons) IsDiff ¶
IsDiff returns true if the the reconstruction r is different from reconstruction cp.
func (*Recons) Randomize ¶
Randomize randomizes the reconstruction using the indicated probability (as percentage).
func (*Recons) SetFoundCost ¶
SetFoundCost sets a new founder cost and updates the reconstruction.
func (*Recons) SetPointCost ¶
SetPointCost sets a new point cost and updates the reconstruction.
func (*Recons) SetSympCost ¶
SetSympCost sets a new sympatry cost and updates the reconstruction.
func (*Recons) SetVicCost ¶
SetVicCost sets a new vicariance cost and updates the reconstruction.