Learn R Programming

dartR.base (version 1.0.5)

gl.tree.nj: Outputs a tree to summarize genetic similarity among populations (e.g. phenogram)

Description

This function is a wrapper for the nj function in package ape and hclust function in stats applied to Euclidean distances calculated from the genlight object.

Usage

gl.tree.nj(
  x,
  dist.matrix = NULL,
  method = "nj",
  by.pop = TRUE,
  as.pop = NULL,
  type = "phylogram",
  outgroup = NULL,
  labelsize = 0.7,
  treefile = NULL,
  verbose = NULL
)

Value

A tree file of class phylo.

Arguments

x

Name of the genlight object containing the SNP data [required].

dist.matrix

Distance matrix [default NULL].

method

Clustering method -- nj, neighbor-joining tree; UGPMA, UGPMA tree [default 'nj'].

by.pop

If TRUE, populations are the terminal taxa; if FALSE, individuals are the terminal taxa [default TRUE]

as.pop

Assign another ind.metric as the population for the purposes of displaying more informative tip labels [default NULL].

type

Type of dendrogram "phylogram"|"cladogram"|"fan"|"unrooted" [default "phylogram"].

outgroup

Vector containing the population names that are the outgroups [default NULL].

labelsize

Size of the labels as a proportion of the graphics default [default 0.7].

treefile

Name of the file for the tree topology using Newick format [default NULL].

verbose

Verbosity: 0, silent, fatal errors only; 1, flag function begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity].

Author

Custodian: Arthur Georges (Post to https://groups.google.com/d/forum/dartr)

Details

An euclidean distance matrix is calculated by default [dist.matrix = NULL]. Optionally the user can use as input for the tree any other distance matrix using this parameter, see for example the function gl.dist.pop.

See Also

Other graphics: gl.colors(), gl.map.interactive(), gl.plot.heatmap(), gl.report.ld.map(), gl.select.colors(), gl.select.shapes(), gl.smearplot()

Examples

Run this code
 # \donttest{
# SNP data
  gl.tree.nj(testset.gl,type='fan')
# Tag P/A data
  gl.tree.nj(testset.gs,type='fan')
  # }
  res <- gl.tree.nj(platypus.gl)
  

Run the code above in your browser using DataLab