Introduction

The goal of idiogramFISH is to plot idiograms of karyotypes, plasmids and circular chr. having a set of data.frames for chromosome data and optionally marks’ data (plotIdiograms function) (Roa and PC Telles, 2020). Idiograms can also be plotted in concentric circles. Separated chromatids can be visible when not in a circular plot.

Six styles of marks are available: square (squareLeft), dots, cM (cMLeft), cenStyle, upArrow, downArrow; its legend (label) can be drawn inline or to the right of karyotypes. It is possible to calculate also chromosome and karyotype indexes (Romero-Zarco, 1986; Watanabe et al., 1999) and classify chromosome morphology in the categories of Levan (1964), and Guerra (1986).

IdiogramFISH was written in R (R Core Team, 2019) and also uses crayon (Csárdi, 2017), tidyr (Wickham and Henry, 2020) and dplyr packages (Wickham et al., 2019a). Documentation was written with R-packages roxygen2 (Wickham et al., 2018), usethis (Wickham and Bryan, 2019), bookdown (Xie, 2016), knitr (Xie, 2015), pkgdown (Wickham and Hesselberth, 2019), Rmarkdown (Xie et al., 2018), rvcheck (Yu, 2019a), badger (Yu, 2019b), kableExtra (Zhu, 2019), rmdformats (Barnier, 2020) and RCurl (Temple Lang and CRAN team, 2019). For some vignette figures, packages rentrez (Winter, 2017), plyr (Wickham, 2011), phytools (Revell, 2012), ggtree (Yu et al., 2018), ggplot2 (Wickham, 2016) and ggpubr (Kassambara, 2019) were used.

Installation instructions

CRAN repo 10.5281/zenodo.3579417

You can install idiogramFISH from CRAN with:

install.packages("idiogramFISH")

Or the devel. version

gitlab repo

Install Gitlab dev. ver. with devtools (Wickham et al., 2019b):

Attention windows users, please install Rtools and git

Vignettes use a lua filter, so you would need pandoc ver. > 2. rmarkdown::pandoc_version()

# This installs package devtools, necessary for installing the dev version
install.packages("devtools")

url <- "https://gitlab.com/ferroao/idiogramFISH"

# Necessary packages for vignettes:
list.of.packages <- c(
    "plyr",
    "knitr",
    "kableExtra",
    "rmdformats",
    "rmarkdown",
    "RCurl",
    "rvcheck",
    "badger",
    "rentrez"
    )
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)

# Linux with vignettes and Windows
devtools::install_git(url = url,build_vignettes = TRUE, force=TRUE)

# Mac with vignettes
devtools::install_git(url = url, build_opts=c("--no-resave-data","--no-manual") )

Or install it in terminal:

# clone repository:
git clone "https://gitlab.com/ferroao/idiogramFISH"

R CMD build idiogramFISH
# install
R CMD INSTALL idiogramFISH_*.tar.gz

Releases

NEWS

archive

downloads

Need help?

Manual in Bookdown style

https://ferroao.gitlab.io/manualidiogramfish

Documentation in Pkgdown style

https://ferroao.gitlab.io/idiogramFISH

Vignettes:

Online:

https://ferroao.gitlab.io/idiogramfishhelppages

Launch vignettes from R for the installed version:

packageVersion("idiogramFISH")
browseVignettes("idiogramFISH")

Minimal examples

Monocentrics:

Define your plotting window size with something like par(pin=c(10,6)), or with svg(), png(), etc. Add chromosome morphology according to Guerra (1986) or (Levan et al., 1964)

library(idiogramFISH)

data(dfOfChrSize) # chromsome data
data(dfMarkColor) # mark general data
data(dfOfMarks2)  # mark position data (inc. cen.)

# column Mbp not for plotting purposes
dfOfChrSize$Mbp<-(dfOfChrSize$shortArmSize+dfOfChrSize$longArmSize)*100

svg("dfOfChrSize.svg",width=10,height=6 )
# png("dfOfChrSize.png", width=500, height=400)
plotIdiograms(dfChrSize  =dfOfChrSize,  # data.frame of chr. size
              dfMarkColor=dfMarkColor,  # d.f of mark style <- Optional
              dfMarkPos=dfOfMarks2,     # df of mark positions (includes cen. marks)
              
              karHeight=5,              # kar. height
              chrWidth = 1.2,           # chr. width
              chrSpacing = 1,           # space among chr.
              
              morpho="Guerra",          # chr. morpho. classif. (Guerra, Levan, both, "" ) ver. >= 1.12 only
              chrIndex="CI",            # cen. pos. (CI, AR, both, "" ) ver. >= 1.12 only
              chrSize = TRUE,           # add chr. sizes under chr.
              chrSizeMbp = TRUE,        # add Mbp sizes under chr. (see above)
              
              rulerPos= 0,              # position of ruler
              ruler.tck=-0.01,          # size and orientation of ruler ticks
              rulerNumberSize=.8        # font size of rulers
              ,xPosRulerTitle = 3             # pos of ruler title
              
              ,legendWidth=1            # width of legend items
              ,fixCenBorder = TRUE      # use chrColor as border color of cen. or cen. marks
              ,distTextChr = 1.2        # chr. text separation
              
              ,xlimLeftMod = 2          # xlim left param.
              ,ylimBotMod = 0           # modify ylim bottom argument
              ,ylimTopMod = 0           # modify ylim top argument
)
dev.off() # close svg()

Let’s explore the data.frames for monocentrics:

If only one species, column OTU is optional

dfOfChrSize
chrName shortArmSize longArmSize Mbp
1 3 4 700
2 4 5 900
3 2 3 500
X 1 2 300
dfMarkColor
markName markColor style
5S red dots
45S green square
DAPI blue square
CMA yellow square

p, q and w marks can have empty columns markDistCen and markSize since v. 1.9.1 to plot whole arms (p, q) and whole chr. w.

# mark position data (inc. cen.) 
dfOfMarks2
chrName markName chrRegion markSize markDistCen
1 5S p 1 0.5
1 45S q 1 0.5
X 45S p NA NA
3 DAPI q 1 1.0
1 DAPI cen NA NA
X CMA cen NA NA

Holocentrics:

library(idiogramFISH)

# load some package data.frames - optional
data(dfChrSizeHolo, dfMarkColor, dfMarkPosHolo)

# column Mbp not for plotting purposes
dfChrSizeHolo$Mbp<-dfChrSizeHolo$chrSize*100

# svg("testing.svg",width=14,height=8 )
par(mar = c(0, 0, 0, 0), omi=rep(0,4) )

plotIdiograms(dfChrSize  =dfChrSizeHolo, # data.frame of chr. size
              dfMarkColor=dfMarkColor,   # df of mark style
              dfMarkPos  =dfMarkPosHolo, # df of mark positions
              
              addOTUName=FALSE,        # do not add OTU names
              distTextChr = 1,         # chr. name distance to chr.
              chrSize = TRUE,          # show chr. size under chr.
              chrSizeMbp = TRUE,       # show chr. size in Mbp under chr. requires Mbp column
              
              rulerPos=-0.1,           # position of ruler
              rulerNumberPos=.9        # position of numbers of rulers
              ,xPosRulerTitle = 3            # pos. of ruler title (units)
              
              ,xlimLeftMod=2           # modify xlim left argument of plot
              ,ylimBotMod=.2           # modify ylim bottom argument of plot
              ,legendHeight=.5         # height of legend labels
              ,legendWidth = 1.2       # width of legend labels
              ,xModifier = .025        # separ. among chromatids
              )                  

# dev.off() # close svg()

Let’s explore the data.frames for holocentrics:

  • chromosome data, if only 1 species, column OTU is optional
dfChrSizeHolo
chrName chrSize Mbp
1 3 300
2 4 400
3 2 200
4 5 500
  • mark general data
dfMarkColor
markName markColor style
5S red dots
45S green square
DAPI blue square
CMA yellow square
  • mark position data, if only 1 species, column OTU is optional (mandatory if in d.f of Chr. Size)
dfMarkPosHolo
chrName markName markPos markSize
3 5S 1.0 0.5
3 DAPI 1.5 0.5
1 45S 2.0 0.5
2 DAPI 2.0 0.5
4 CMA 2.0 0.5
4 5S 0.5 0.5

Plotting both mono. and holo.

Available only for ver. > 1.5.1

Merge data.frames with plyr (Wickham, 2011)

# chromosome data, if only 1 species, column OTU is optional
require(plyr)
dfOfChrSize$OTU   <- "Species mono"
dfChrSizeHolo$OTU <- "Species holo"
 
monoholoCS <- plyr::rbind.fill(dfOfChrSize,dfChrSizeHolo)

dfOfMarks2$OTU     <-"Species mono"
dfOfMarks2[which(dfOfMarks2$markName=="5S"),]$markSize<-.7
dfMarkPosHolo$OTU <-"Species holo"

monoholoMarks <- plyr::rbind.fill(dfOfMarks2,dfMarkPosHolo)
library(idiogramFISH)

#svg("testing.svg",width=14,height=10 )
png("monoholoCS.png", width=700, height=600)
par(mar=rep(0,4))
plotIdiograms(dfChrSize  = monoholoCS,   # data.frame of chr. size
              dfMarkColor= dfMarkColor,  # df of mark style
              dfMarkPos  = monoholoMarks,# df of mark positions, includes cen. marks
              
              chrSize = TRUE,            # show chr. size under chr.
              
              squareness = 4,            # vertices squareness
              roundedCen = FALSE,        # triangular cen.
              addOTUName = TRUE,         # add OTU names
              OTUTextSize = .7,          # font size of OTU
              distTextChr = .5,          # separ. among chr. and text and among chr. name and indices
              
              karHeiSpace = 4,           # karyotype height inc. spacing
              karIndexPos = .2,          # move karyotype index
              
              legendHeight= 1,           # height of legend labels
              legendWidth = 1,           # width of legend labels
              fixCenBorder = TRUE,       # use chrColor as border color of cen. or cen. marks
              
              rulerPos= 0,               # position of ruler
              ruler.tck=-0.02,           # size and orientation of ruler ticks
              rulerNumberPos=.9,         # position of numbers of rulers
              xPosRulerTitle = 3.5,      # ruler title (units) position
              
              xlimLeftMod=1,             # modify xlim left argument of plot
              xlimRightMod=3,            # modify xlim right argument of plot
              ylimBotMod= .2             # modify ylim bottom argument of plot
              
              ,chromatids=FALSE          # do not show separ. chromatids
              
              # for Circular Plot, add:
              
              # ,circularPlot = TRUE       # circularPlot
              # ,shrinkFactor = .9         # percentage 1 = 100% of circle with chr.
              # ,circleCenter = 3          # X coordinate of circleCenter (affects legend pos.)
              # ,chrLabelSpacing = .9      # chr. names spacing
              
              # ,OTUsrt = 0                # angle for OTU name (or number)
              # ,OTUplacing = "number"     # Use number and legend instead of name
              # ,OTULabelSpacerx = -1.5    # modify position of OTU label, when OTUplacing="number" or "simple"
              # ,OTUlegendHeight = 1.5     # space among OTU names when in legend - OTUplacing
)
dev.off() # close png

Citation

To cite idiogramFISH in publications, please use:

Roa F, Telles MPC (2020) idiogramFISH: Idiograms with Marks and Karyotype Indices, Universidade Federal de Goiás. Brazil. R-package. version 1.16.1 https://ferroao.gitlab.io/manualidiogramfish/. doi:10.5281/zenodo.3579417

To write citation to file:

sink("idiogramFISH.bib")
toBibtex(citation("idiogramFISH"))
sink()

1 Plotting chromosomes

This guide shows how to plot idiograms of measured karyotypes and optionally marks.

1.1 Load package

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

#load package
library(idiogramFISH) 

1.2 Plot monocentrics

Initially you have to put your chromosome data in a data.frame.

From scratch:

# Example data.frame to write in R, use: (column OTU is optional if only 1 OTU)
mydfChrSize<-read.table(text=
"            OTU chrName shortArmSize longArmSize 
  \"Species one\"   1     1.5         2.0  
  \"Species one\"   2     2.0         2.5  
  \"Species one\"   3     1.0         1.5
  \"Species one\"   B     2.0         3.5"  ,  header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU chrName shortArmSize longArmSize
Species one 1 1.5 2.0
Species one 2 2.0 2.5
Species one 3 1.0 1.5
Species one B 2.0 3.5

loading saved data:

If you use RStudio, in the menu “Session”, use “Set working directory” for choosing your desired folder or:

setwd("~/folder/subfolder")

Open your chromosome data data.frame importing it from a .csv (read.csv) or .xls file (readxl).

mydfChrSize<-read.csv("somefile.csv")

Editing a data.frame:

bigdfOfChrSize <- edit(bigdfOfChrSize, edit.row.names = FALSE)

For fixing column names use:

colnames(mydfChrSize)<-c("OTU", "chrName","shortArmSize","longArmSize")

Get marks general data

This data.frame is optional.

Put your mark data in a data.frame. This data.frame has the marks present in all karyotypes without position info. If the style column is not present, param. defaultStyleMark = "square" will be used during plotting.

Note the cenStyle to make constrictions, mimicking centromeres, and upArrow and downArrow styles.

# From scratch:
mydfMarkColor<-read.table(text=
" markName markColor  style
        5S      red       dots
       45S      green     square
     gene1      orange    upArrow    
     gene2      salmon    downArrow
     gene3      \"#056522\" cMLeft    
      DAPI      blue      cM   
\"cB mark\"     black     cenStyle   
       CMA      yellow    square
\"B mark\"      black     square"  ,  header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
markName markColor style
5S red dots
45S green square
gene1 orange upArrow
gene2 salmon downArrow
gene3 #056522 cMLeft
DAPI blue cM
cB mark black cenStyle
CMA yellow square
B mark black square

For fixing column names use:

colnames(mydfMarkColor)<-c("markName", "markColor","style") 
# if style column is not present it will be filled with "square"

Get marks positions data

Open or write your mark positions in a data.frame. This data.frame has the marks present in all karyotypes with position info. This data.frame has also the centromeric marks present in all karyotypes.

# We will use column OTU if data.frame because chromosome size df has it
mydfOfMarks<-read.table(text=
"            OTU chrName markName chrRegion markSize markDistCen
\"Species one\"      1      45S       p       NA         NA     # no measure means whole arm for square marks
\"Species one\"      1       5S       q      0.5         0.5
\"Species one\"      B  \"B mark\"    w       NA         NA     # w for whole chromosome for square marks
\"Species one\"      B  \"cB mark\"   q       NA         1.0    
\"Species one\"      2     45S        p        1         1.0
\"Species one\"      2     gene1      q      0.5         1.0
\"Species one\"      2     gene2      q      0.5         2.0
\"Species one\"      3     DAPI       q       NA          1
\"Species one\"      3     gene3      p       NA         .5 
\"Species one\"      1     DAPI       cen
\"Species one\"      3      CMA       cen", header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU chrName markName chrRegion markSize markDistCen
Species one 1 45S p NA NA
Species one 1 5S q 0.5 0.5
Species one B B mark w NA NA
Species one B cB mark q NA 1.0
Species one 2 45S p 1.0 1.0
Species one 2 gene1 q 0.5 1.0
Species one 2 gene2 q 0.5 2.0
Species one 3 DAPI q NA 1.0
Species one 3 gene3 p NA 0.5
Species one 1 DAPI cen NA NA
Species one 3 CMA cen NA NA

For fixing column names use something like:

colnames(mydfMarkColor)<-c("OTU", "chrName","markName","chrRegion","markSize","markDistCen") 

Add some text to the right

For ver. > 1.7

# We will use column note to add a note to the right of the karyotype of the OTU in column OTU
notesdf<-read.table(text=
"            OTU    note
\"Species one\"   \"Author notes\"  ", header=TRUE, stringsAsFactors=FALSE,fill=TRUE)

For adding just the OTU name (from column OTU of data.frame of chr. size) to the right, use OTUasNote=TRUE

Plotting

You can plot without marks (use only 1st data.frame), but we will use all 4 data.frames created. By default the function will calculate indices (Romero-Zarco, 1986; Watanabe et al., 1999) and morphological categories of Guerra (1986) and Levan (1964). Use parameters chrIndex and morpho of the function plotIdiograms to modify that. See ?plotIdiograms.

The cM style of mark always adds the name as if legend="inline", even when legend="aside" (default).

# svg("mydfChrSize.svg",width=12,height=6 )

par(mar = c(0, 0, 0, 0))

plotIdiograms(dfChrSize= mydfChrSize,     # chr. size data.frame
              dfMarkPos= mydfOfMarks,     # mark position data.frame (inc. cen.)
              dfMarkColor=mydfMarkColor,  # mark style d.f.
              
              chrSpacing=.6,              # separ. among chr.
              distTextChr = .7,           # separation among text and chr. names and ind.        
              orderChr = "name",          # order chr. by name
              karHeiSpace=2               # vertical size of karyotype including spacer
              
              ,arrowhead = .5             # proportion of head of arrow
              
              ,fixCenBorder = TRUE        # use chrColor as border color of cen. or cen. marks
              ,legendWidth = .8           # legend item width
              ,legendHeight = .5          # legend item height
              ,markLabelSpacer = 2        # legend spacer
              ,lwd.mimicCen = 2.5         # constric. mark line width
              
              ,rulerPos=0                 # ruler position
              ,ruler.tck=-0.01            # ticks of ruler size and orientation
              ,xPosRulerTitle = 2.5             # ruler units pos.
              
              ,markPer = "45S"           # show mark % of chr.  under kar.
              ,showMarkPos = TRUE         # show position of marks under kar. See bToRemove
              ,bToRemove = c("B mark","cB mark") # bands to remove from pos. calc. See showMarkPos
              
              ,notes=notesdf              # data.frame with notes 
              ,notesTextSize = 1.3        # font size of notes
              ,notesPos = .2              # space from chr. (right) to note
              
              ,ylimBotMod = 2             # modify ylim bottom argument
              ,ylimTopMod = 0             # modify ylim top argument
              ,xlimLeftMod = 2            # modify left xlim
              ,xlimRightMod = 3           # modify right xlim
              ,lwd.cM = 2                 # thickness of cM marks 
              ,pattern = "^c"             # regex pattern to remove from mark names
              ,remSimiMarkLeg=TRUE        # remove pseudoduplicated mark names from legend (same after pattern removal)
              # ,legend="inline"            # legend next to chr.
              # ,bannedMarkName = "cB mark" # remove from legends
)

# dev.off()

Vertices when centromereSize=0 are rounded:

png("mydfChrSize2.png", width=550, height=550)
par(mar = c(0, 0, 0, 0))
plotIdiograms(dfChrSize   = bigdfOfChrSize[1:8,],  # chr. size data.frame
              dfMarkColor = mydfMarkColor,# mark style df
              dfMarkPos   = bigdfOfMarks, # mark position df
              
              centromereSize = 0,         # <- HERE
              
              squareness=3,               # vertices squareness  
              chrSpacing = .7,            # space among chr.
              karHeight = 2,              # karyotype rel. height 
              karHeiSpace=4,              # vertical size of karyotype including spacer
              amoSepar= 2.5,              # separation among karyotype
              
              indexIdTextSize=.8,         # font size of chr. name and indices
              karIndexPos = .1,           # position of kar. index
              markLabelSize=.7,           # font size of mark legends
              fixCenBorder = FALSE,       # do not use chrColor as border color of cen. or cen. marks
              distTextChr = .8,           # separation among chr. and ind.
              
              rulerPos= 0,                # ruler position
              ruler.tck=-0.01,            # ticks of ruler size and orientation
              xPosRulerTitle = 2.6,              # ruler units pos.
              
              xlimLeftMod = 2,            # modify xlim left argument 
              ylimBotMod = 0.4,           # modify ylim bottom argument
              ylimTopMod = 0              # modify ylim top argument
              ,lwd.cM = 2                 # thickness of cM marks 
              )
dev.off()

There is no need to add dfMarkColor and you can also use the parameter mycolors (optional too), to establish marks’ colors. Colors are assigned depending on the order of marks, i.e.:

unique(mydfOfMarks$markName) 

Let’s use the cM style of marks. A protruding line.

cM style does not apply to centromere marks. To make something similar, use centromereSize=0, legend="inline" and fixCenBorder = FALSE.

charVectorCol <- c("tomato3","darkolivegreen4","dfsd","blue","green")

# Modify size of kar. to use rulerInterval and ceilingFactor (>= 1.13)  
quo<-9
dfOfChrSize2<-dfOfChrSize
dfOfChrSize2$shortArmSize<-dfOfChrSize$shortArmSize/quo
dfOfChrSize2$longArmSize<-dfOfChrSize$longArmSize/quo
dfOfMarks2b<-dfOfMarks2
dfOfMarks2b$markSize<-dfOfMarks2$markSize/quo
dfOfMarks2b$markDistCen<-dfOfMarks2$markDistCen/quo

png("dfOfChrSizeVector.png", width=1000, height=450)
par(mar=rep(0,4))
plotIdiograms(dfChrSize = dfOfChrSize2,    # d.f. of chr. sizes
              dfMarkPos = dfOfMarks2b,     # d.f. of marks' positions
              defaultStyleMark = "cM",     # forces "cM" style in d.f dfMarkColor (exc. 5S)
              
              mycolors = charVectorCol,    # colors to use
              
              distTextChr = .5,            # separ. text and chr.
              
              markLabelSize=.7,            # font size for labels (legend)
              lwd.cM=2,                    # width of cM marks
              legendWidth=0.9,             # legend item width
              legendHeight=.5,
              
              rulerPos= 0,                 # ruler position
              ruler.tck=-0.01,             # ruler tick orientation and length
              rulerNumberSize=.5           # ruler font size
              ,xPosRulerTitle = 2.8              # ruler units pos.
              
              ,xlimRightMod = 1            # modify xlim right arg.
)
dev.off() # close png

1.3 Plot holocentrics

Initially you have to put your chromosome data in a data.frame. For simplicity, I call a holocen. karyotype anything without centromeres. This is recognized by the absence of columns: “shortArmSize”, etc.

From scratch:

# Example data.frame written in R, use: (column OTU is optional if only 1 OTU)
mydfChrSizeHolo<-read.table(text=
"            OTU chrName chrSize  
\"Species one\"   1     6.5      
\"Species one\"   2     5.0      
\"Species one\"   3     4.0
\"Species one\"   4     4.0
\"Species one\"   X     3.0    "  ,  header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU chrName chrSize
Species one 1 6.5
Species one 2 5.0
Species one 3 4.0
Species one 4 4.0
Species one X 3.0

or loading saved data:

If you use RStudio, in menu “Session”, open “Set working directory” for choosing your desired folder or:

setwd("~/folder/subfolder")

Open your chromosome data as data.frame importing it from a .csv (read.csv) or .xls file (readxl).

mydfChrSize<-read.csv("somefile.csv")

For fixing column names use:

colnames(mydfChrSize)<-c("OTU", "chrName","chrSize")

Get marks general data

This data.frame is optional for ver. > 1.0.0

packageVersion("idiogramFISH")

Put your mark data in a data.frame. This data.frame has the marks present in all karyotypes without position info. If the style column is not present, param. defaultStyleMark = "square" will be used during plotting.

# From scratch:
mydfMarkColor<-read.table(text=
"  markName markColor  style
1       5S       red   dots
2      45S     green square
3     DAPI      blue square
4      CMA    yellow square"  ,  header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
markName markColor style
5S red dots
45S green square
DAPI blue square
CMA yellow square

For fixing column names use:

colnames(mydfMarkColor)<-c("markName", "markColor","style") 
# if style column not present it will be filled with "square"

Get marks positions data

Open or write your mark positions in a data.frame. This data.frame has the marks present in all karyotypes with position info.

# We will use column OTU if data.frame because chromosome size df has it
mydfMarkPosHolo<-read.table(text=
"             OTU  chrName markName markPos markSize chrRegion
\"Species one\"       4        B      NA       NA        w           # whole chromosome mark, use 'w' in col. chrRegion 
\"Species one\"       3     DAPI     2.0      0.5
\"Species one\"       1      45S     2.0      0.5
\"Species one\"       2     DAPI     2.0      0.5
\"Species one\"       X      CMA     2.0      0.5
\"Species one\"       X       5S     0.5      0.5
\"Species one\"       X       5S     0.5      0.5"  ,  header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU chrName markName markPos markSize chrRegion
Species one 4 B NA NA w
Species one 3 DAPI 2.0 0.5
Species one 1 45S 2.0 0.5
Species one 2 DAPI 2.0 0.5
Species one X CMA 2.0 0.5
Species one X 5S 0.5 0.5
Species one X 5S 0.5 0.5

For fixing column names use something like:

colnames(mydfMarkColor)<-c("OTU", "chrName","markName","markPos","markSize") 

Plotting

You can plot without marks (passing only 1st data.frame), but we will use all 4 data.frames created:

# library(idiogramFISH)
# svg("mydfChrSizeHolo.svg",width=13.5,height=6 )
# png("mydChrSizeHolo.png", width=600, height=300)

par(mar=c(0,0,0,1)) # bottom left top right

plotIdiograms(dfChrSize  = mydfChrSizeHolo,# data.frame of chr. sizes
              dfMarkColor= mydfMarkColor,  # df of mark style
              dfMarkPos  = mydfMarkPosHolo,# df of mark positions
              addOTUName=FALSE,            # add OTU names
              
              xlimLeftMod= 2,              # modify xlim left argument
              ylimTopMod= -1,              # modify ylim top argument
              ylimBotMod= -2               # modify ylim bottom argument
              ,rulerPos = 0                # ruler position
              ,ruler.tck = -0.01           # ruler ticks size and orient.
              ,xPosRulerTitle=2.6
              
              ,legendWidth=1               # width of legend
              ,legendHeight=.7             # height of legend item 
              ,xModifier=0.01              # separation among chromatids
)

# dev.off() # closes png or svg

It is not mandatory to use dfMarkColor and you can also use the parameter mycolors (optional too), to establish marks’ colors. When using mycolors, colors are assigned depending on the order of marks, i.e.:

unique(dfMarkPosHolo$markName)
# [1] "5S"   "DAPI" "45S"  "CMA"
par(mar=rep(0,4)) 
plotIdiograms(dfChrSize = dfChrSizeHolo, # d.f. of chr. size
              dfMarkPos  = dfMarkPosHolo, # d.f. of marks' positions
              mycolors   = c("green","yellow","blue","red"),  # colors for marks

              addOTUName=FALSE,           # do not add OTU name
              ruler=FALSE,                # do not add ruler
              xlimLeftMod=1,              # modify left xlim arg.
              xlimRightMod=3,             # modify right xlim arg.
              ylimBotMod=.2               # modify bottom ylim
              ,chromatids=FALSE           # do not show separ. chromatids
)

1.4 Plot holo. and mono. in the same karyotype

To accomplish this, we will use cenStyle marks in a (modified) holocen. karyotype. The ruler is continuous as in holocen.

# mark general characteristics' data.frame:
mydfMarkColor2<-read.table(text=
"  markName markColor  style
1       5S       red   dots
2      45S     green   square
3     DAPI      blue   square
4      CMA    yellow   square
5     c45S     green   cenStyle # <- simulate Cen.
6      c5S       red   cenStyle
7       cB     black   cenStyle
8   constr        NA   cenStyle
9        B     black   square"  ,  header=TRUE, stringsAsFactors=FALSE,fill=TRUE)

# add new marks to data.frame of marks' position
mydfMarkPosHolo2<-plyr::rbind.fill(mydfMarkPosHolo,
                                   data.frame(OTU="Species one",
                                              chrName=1:4,
                                              markName=c("c45S","c5S","constr","cB"), # <- use new mark
                                              markPos=2.5,
                                              markSize=NA 
                                              )
                  )

# png("mydChrSizeHolo.png", width=600, height=300)
par(mar=c(0,0,0,1)) # bottom left top right

plotIdiograms(dfChrSize  = mydfChrSizeHolo, # data.frame of chr. sizes
              dfMarkColor= mydfMarkColor2,  # df of mark style
              dfMarkPos  = mydfMarkPosHolo2,# df of mark positions
              addOTUName=FALSE,             # add OTU names
              
              xlimLeftMod= 2,              # modify xlim left argument
              ylimTopMod= -1,              # modify ylim top argument
              ylimBotMod= -2               # modify ylim bottom argument
              ,rulerPos = 0
              ,ruler.tck = -0.01
              ,xPosRulerTitle = 2.6
              
              ,legendWidth=1               # width of legend
              ,legendHeight=.7             # height of legend item 
              ,lwd.mimicCen=2.5            # line width of const. mark
              ,pattern="^c"                # regex pattern to remove from mark names
              ,remSimiMarkLeg = TRUE       # remove pseudoduplicated mark names (got equal after pattern removal)
              # ,legend="inline"           # legends inline
              # ,bannedMarkName = c("c45S","cB") # do not use this names from labels
)

# dev.off() # closes png or svg

7 Plotting alongside phylogeny

https://ferroao.gitlab.io/idiogramfishhelppages

References

Guerra M. 1986. Reviewing the chromosome nomenclature of Levan et al. Brazilian Journal of Genetics, 9(4): 741–743

Levan A, Fredga K, Sandberg AA. 1964. Nomenclature for centromeric position on chromosomes Hereditas, 52(2): 201–220. https://doi.org/10.1111/j.1601-5223.1964.tb01953.x. https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1601-5223.1964.tb01953.x

Romero-Zarco C. 1986. A new method for estimating karyotype asymmetry Taxon, 35(3): 526–530. https://onlinelibrary.wiley.com/doi/abs/10.2307/1221906

Watanabe K, Yahara T, Denda T, Kosuge K. 1999. Chromosomal evolution in the genus Brachyscome (Asteraceae, Astereae): statistical tests regarding correlation between changes in karyotype and habit using phylogenetic information Journal of Plant Research, 112: 145–161. http://link.springer.com/article/10.1007/PL00013869

R-packages

Csárdi G. 2017. Crayon: Colored terminal output. R package version 1.3.4. https://CRAN.R-project.org/package=crayon

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

R Core Team. 2019. R: A language and environment for statistical computing R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/

Revell LJ. 2012. Phytools: An r package for phylogenetic comparative biology (and other things). Methods in Ecology and Evolution, 3: 217–223. https://besjournals.onlinelibrary.wiley.com/doi/10.1111/j.2041-210X.2011.00169.x

Roa F, PC Telles M. 2020. idiogramFISH: Idiograms with marks and karyotype indices Universidade Federal de Goiás, UFG, Goiânia. R-package. version 1.12.1. https://doi.org/10.5281/zenodo.3579417. https://ferroao.gitlab.io/manualidiogramfish/

Wickham H. 2011. The split-apply-combine strategy for data analysis Journal of Statistical Software, 40(1): 1–29. https://www.jstatsoft.org/article/view/v040i01

Wickham H. 2016. Ggplot2: Elegant graphics for data analysis Springer-Verlag New York. https://ggplot2.tidyverse.org

Wickham H, François R, Henry L, Müller K. 2019a. Dplyr: A grammar of data manipulation. R package version 0.8.3. https://CRAN.R-project.org/package=dplyr

Wickham H, Henry L. 2020. Tidyr: Tidy messy data. R package version 1.0.2. https://CRAN.R-project.org/package=tidyr

Wickham H, Hester J, Chang W. 2019b. Devtools: Tools to make developing r packages easier. R package version 2.2.1. https://CRAN.R-project.org/package=devtools

Winter DJ. 2017. rentrez: An r package for the ncbi eUtils api The R Journal, 9(2): 520–526

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. https://doi.org/10.1093/molbev/msy194. https://academic.oup.com/mbe/article/35/12/3041/5142656

Documentation

Barnier J. 2020. Rmdformats: HTML output formats and templates for ’rmarkdown’ documents. R package version 0.3.7. https://CRAN.R-project.org/package=rmdformats

Temple Lang D, CRAN team. 2019. RCurl: General network (http/ftp/...) client interface for r. R package version 1.95-4.12. https://CRAN.R-project.org/package=RCurl

Wickham H, Bryan J. 2019. Usethis: Automate package and project setup. R package version 1.5.1. https://CRAN.R-project.org/package=usethis

Wickham H, Danenberg P, Eugster M. 2018. Roxygen2: In-line documentation for r. R package version 6.1.1. https://CRAN.R-project.org/package=roxygen2

Wickham H, Hesselberth J. 2019. Pkgdown: Make static html documentation for a package. R package version 1.4.1. https://CRAN.R-project.org/package=pkgdown

Xie Y. 2015. Dynamic documents with R and knitr Chapman; Hall/CRC, Boca Raton, Florida. ISBN 978-1498716963. http://yihui.name/knitr/

Xie Y. 2016. Bookdown: Authoring books and technical documents with R markdown Chapman; Hall/CRC, Boca Raton, Florida. ISBN 978-1138700109. https://github.com/rstudio/bookdown

Xie Y, Allaire JJ, Grolemund G. 2018. R markdown: The definitive guide Chapman; Hall/CRC, Boca Raton, Florida. ISBN 9781138359338. https://bookdown.org/yihui/rmarkdown

Yu G. 2019a. Rvcheck: R/package version check. R package version 0.1.6. https://CRAN.R-project.org/package=rvcheck

Yu G. 2019b. Badger: Badge for r package. R package version 0.0.6. https://CRAN.R-project.org/package=badger

Zhu H. 2019. KableExtra: Construct complex table with ’kable’ and pipe syntax. R package version 1.1.0. https://CRAN.R-project.org/package=kableExtra