This guide shows the files to plot idiograms alongside a phylogeny

1 Load package

visit gitlab for installation instructions

2 ggtree of iqtree and monocentrics

idiogramFISH comes with two trees and data.frames with chr. and marks’ data for the correspondent OTUs, first we will plot a tree produced with iqtree (Nguyen et al., 2015)


Now we are ready to plot adding those arguments for addMissingOTUAfter and missOTUspacings

# plot to png file
png(file="firstplot.png" ,width=962,height=962 )

par(omi=rep(0,4) , mar=c(0,1,2,1), 
    mfrow=c(1,2) )   # one row two columns
par(fig=c(0,.3,0,1)) # location of left ghost plot           # ghost plot to the left
par(fig=c(.3,1,0,1)) # location of right plot

plotIdiograms(dfChrSize = allChrSizeSample,    # data.frame of Chr. Sizes
              dfMarkPos = allMarksSample,      # d.f. of Marks (inc. cen. marks) 
              dfMarkColor =  mydfMaColor,      # d.f. of mark characteristics
              roundness = 4,                   # roundness of vertices
              lwd.chr=.5,                      # width of lines
              orderBySize = FALSE,             # don't order chr. by size
              centromereSize = 1.3,            # apparent cen. size
              chrWidth =.75,                   # width of chr.
              chrSpacing = .25,                # horizontal spacing of chr.
              indexIdTextSize=.4,              # font size of indices and chr. names
              karHeight = 4.8,                 # karyotype vertical relative size without spacing
              karHeiSpace = 6.5,               # karyotype vertical relative size with spacing
              nameChrIndexPos=4,               # move the name of chr. indexes to left
              morpho="both",                   # add chr. morphology
              chrIndex = "both",               # add chr. indices
              karIndex = TRUE,                 # add karyotype indices
              markLabelSpacer = 0              # spaces from rightmost chr. to legend
              ,ylimTopMod = -.1                # modify ylim top margin
              ,ylimBotMod=1.6                  # modify ylim bottom margin
              ,rulerPos = -1                   # position of rulers
              ,rulerNumberSize = .35           # font size of ruler number
              ,rulerNumberPos = .4             # position of ruler numbers
              ,ruler.tck = -.004               # tick size and orient.
              ,asp=1                           # y x aspect
              ,addMissingOTUAfter = BeforeMissing          # OTUs after which there are ghost karyotypes - empty spaces
              ,missOTUspacings    = valuesOfMissRepsBefore # number of ghost karyotypes

# plot to the left the ggtree
pushViewport(viewport(layout = grid.layout(1, 2)))
pushViewport(viewport(layout.pos.col = 1, layout.pos.row = 1))

# close png

3 plot of revBayes tree and holocentrics

Function plotIdiogramsHolo deprecated after ver. 1.5.1

Now we are going to plot a tree from revBayes (Höhna et al., 2017)

Order OTUs of data.frame of chr. data

First, create some data for holocentrics

Apply order of phylogeny to data.frame

Now we have to establish where are the OTUs in the tree, that don’t have chr. data

4 plot of revBayes tree and holocentrics and monocentrics

Available for ver. > 1.5.1

Create data.frames with both types of karyotypes (Wickham, 2011)

Get the desiredorderRevB object from above to continue:


Now we are ready to plot adding those arguments for addMissingOTUAfter and missOTUspacings


Höhna S, Landis MJ, Heath TA. 2017. Phylogenetic inference using RevBayes Current Protocols in Bioinformatics, 2017(March): 6.16.1–6.16.34.

Nguyen L-T, Schmidt HA, Haeseler A von, Minh BQ. 2015. IQ-TREE: a fast and effective stochastic algorithm for estimating maximum-likelihood phylogenies Molecular biology and evolution, 32(1): 268–274.

R-packages references

Kassambara A. 2019. Ggpubr: ’Ggplot2’ based publication ready plots. R package version 0.2.3.

Revell LJ. 2012. Phytools: An r package for phylogenetic comparative biology (and other things). Methods in Ecology and Evolution, 3: 217–223.

Wickham H. 2011. The split-apply-combine strategy for data analysis Journal of Statistical Software, 40(1): 1–29.

Wickham H. 2016. Ggplot2: Elegant graphics for data analysis Springer-Verlag New York.

Yu G, Lam TT-Y, Zhu H, Guan Y. 2018. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 35(2): 3041–3043.