This guide shows the files to plot idiograms alongside a phylogeny

1 Load package

visit gitlab for installation instructions https://gitlab.com/ferroao/idiogramFISH

2 ggtree of iqtree and monocentrics

idiogramFISH comes with two trees, first we will plot a tree produced with iqtree (Nguyen et al., 2015)

Plotting

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
plot.new()           # ghost plot to the left
par(fig=c(.3,1,0,1)) # location of right plot

plotIdiograms(allChrSizeSample,                # data.frame of Chr. Sizes
              allMarksSample,                  # d.f. of Marks (not cen.) 
              dfCenMarks = allCenMarksSample,  # d.f. of centromeric marks
              dfMarkColor =  mydfMaColor,      # d.f. of mark characteristics

              roundness = 10.5,                # roundness of vertices
              dotRoundCorr = .8,               # correct roundness aspect ratio
              lwd.chr=.5,                      # width of lines
              orderBySize = FALSE,             # don't order chr. by size
              centromereSize = 1.3,            # apparent cen. size
              OTUTextSize = 1,                 # Size of OTU name
              chrWidth =3,                     # width of chr.
              chrSpacing = 3,                  # horizontal spacing of chr.
              karHeiSpace = 1.8,               # karyotype vertical relative size with spacing
              
              nameChrIndexPos=4,               # move the name of chr. indexes to left
              morpho=TRUE,                     # add chr. morphology
              chrIndex = TRUE,                 # add chr. indices
              karIndex = TRUE,                 # add karyotype indices

              markLabelSpacer = 0              # spaces from rightmost chr. to legend
              ,markLabelSize = 1               # font size of legend
              ,legend="aside"                  # position of legends
              
              ,ylimTopMod = -.3                # modify ylim top margin
              ,ylimBotMod=.9                   # modify ylim bottom margin
              ,xlimRightMod=2                  # modify right xlim
              
              ,rulerPos = -0.7                 # position of rulers
              ,rulerNumberSize = .35           # font size of ruler number
              ,rulerNumberPos = .4             # position of ruler numbers
              
              ,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))
print(gtgbuildgg2,newpage=F) 

# close png
dev.off()

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

Plotting

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

4 plot of revBayes tree and holocentrics and monocentrics

Available for ver. > 1.5.1

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

Get the desiredorderRevB object from above to continue:

Plotting

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. https://doi.org/10.1002/cpbi.22

Kassambara A. 2019. Ggpubr: ’Ggplot2’ based publication ready plots. https://CRAN.R-project.org/package=ggpubr

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. https://doi.org/10.1093/molbev/msu300

Revell LJ. 2019. Phytools: Phylogenetic tools for comparative biology (and other things). https://CRAN.R-project.org/package=phytools

Wickham H. 2016. Plyr: Tools for splitting, applying and combining data. https://CRAN.R-project.org/package=plyr

Wickham H, Chang W, Henry L, Pedersen TL, Takahashi K, Wilke C, Woo K, Yutani H. 2019. Ggplot2: Create elegant data visualisations using the grammar of graphics. https://CRAN.R-project.org/package=ggplot2

Yu G, Lam TT-Y. 2019. Ggtree: An r package for visualization and annotation of phylogenetic trees with their covariates and other associated data. https://yulab-smu.github.io/treedata-book/