custom_nexus: Color SplitsTree dendrograms

Description Usage Arguments Value Examples

View source: R/custom_nexus.R

Description

Reads a nexus file and adds colors to the leaves

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
custom_nexus(
  nexus.file,
  tips,
  colors,
  outfile,
  fromBIGSdb = FALSE,
  fg,
  vlabels,
  w = 20,
  h = 20,
  s = "r",
  f,
  lc,
  lk,
  edgecolor = "gray",
  plot,
  SplitsTree.exe = "/Applications/SplitsTree/SplitsTree"
)

Arguments

tips

(leaves of the dendrogram)

colors

vector of the same length of the tips indicating the color of each tip

vlabels

vector of labels to be plot; leave empty character "" to hide the label.

w

width of the tip. If you indicate a single number it will be recycled. Either provide a vector of widths

h

height of the tip. Same for w.

s

shape of the tip "o" is oval. The other option is "r" rectangle.

f

fonts of the labels. Like "Dialog-BOLD-16" or 'Courier-PLAIN-24'. Other option are: Calibri, Arial, Times. For bold -BOLD and not -PLAIN

lc

vector of label colors

lk

vector of background of the label

edgecolor

the color of the edges

plot

if TRUE SplitsTree is launched and the nexus displayed

Splitstree.exe

path to the executable of SplitsTree

Value

a new nexus file with colors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
inputfile <- file.path(path.package('microbio'),'input.nexus')
outfile <- file.path(path.package('microbio'),'output.nexus')
tips <- c("A","R","G","B")
col <- c("red","blue","green","yellow")
s <- c("r","o","r","o")
ws <- c(10,20,30,40)
hs <- c(10,20,30,40)
fg <- c("blue","orange", "violet", "gray8")
lc <- c("gray", "cyan", "pink", "blue")
lk <- c("black", "blue", "black", "yellow")
edgecolor <- "blue"
f <- c("Arial-BOLD-20", "Calibri-BOLD-16", "Times-20", "Dialog-BOLDITALIC-25")
custom_nexus(nexus.file=inputfile, tips=tips, colors=col, vlabels=tips, w=ws, f=f, h=hs, lc=lc, lk=lk, fg= fg, s=s, edgecolor=edgecolor, outfile=outfile, plot=TRUE, SplitsTree.exe = "/Applications/SplitsTree/SplitsTree")

abrozzi/microbio documentation built on Feb. 8, 2021, 11:34 a.m.