tanglePlot: Plot the different nucleotides present in an alignment of...

Description Usage Arguments Examples

View source: R/tanglePlot.R

Description

Function uses coloured polygons to illustrate which nucleotides are present in each sequence at each position

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
tanglePlot(
  tree1,
  tree2,
  onlyIfDifferent = TRUE,
  connectingLine.col = "black",
  connectingLine.lwd = 1,
  connectingLine.lty = 1,
  offsetProp = NULL,
  leftMargins = c(0, 0, 0, 1),
  rightMargins = c(0, 1, 0, 0),
  ...
)

Arguments

tree1

an object of class "phylo" to compared to tree2

tree2

an object of class "phylo" to compared to tree1

onlyIfDifferent

a boolean variable, if TRUE only plots lines between tips that are in different locations on the phylogenies, otherwise lines between all tips are plotted. Defaults to TRUE

connectingLine.col

colour of the lines connecting tips. Defaults to black

connectingLine.lwd

width of the lines connecting tips. Defaults to 1

connectingLine.lty

type of the lines connecting tips. Defaults to 1 (solid)

offsetProp

offset value to displace starts of connecting lines from tips, set as the proportion of plotting window. Defaults to NULL (off)

leftMargins

margin parameters for the left tree plot. Defaults to c(0,0,0,1) to leave small space on right

rightMargins

margin parameters for the right tree plot. Defaults to c(0,1,0,0) to leave small space on left

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Set the seed
set.seed(76263)

# Create a random phylogeny
tree <- ape::rtree(n=50, rooted=TRUE)

# Rotate one of the nodes in the phylogeny - with tip labels it
rotated <- ape::rotate(tree, node=c("t35", "t34"))

# Compare the random and rotated phylogeny
tanglePlot(tree, rotated, connectingLine.col="red",
           connectingLine.lty=2, show.tip.label=TRUE, offsetProp=0.02)

JosephCrispell/phyloHelpeR documentation built on April 7, 2020, 8:28 a.m.