idiogramFISH: Shiny App. Idiograms with Marks and Karyotype Indices
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, 2021). 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), exProtein (inProtein); its legend (label) can be drawn inline or to the right of karyotypes. Three styles of centromere are available: rounded, triangular and internal (inProtein). 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), plyr (Wickham, 2011) 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), phytools (Revell, 2012), ggtree (Yu et al., 2018), ggplot2 (Wickham, 2016) and ggpubr (Kassambara, 2019) were used.
In addition, the shiny app runBoard()
uses shiny (Chang et al., 2021), shinydashboard (Chang and Borges Ribeiro, 2018), rhandsontable (Owen, 2018), gtools (Warnes et al., 2020), rclipboard (Bihorel, 2021) and bib2df (Ottolinger, 2019).
Installation instructions
You can install idiogramFISH from CRAN with:
install.packages("idiogramFISH")
Windows users: To avoid installation of packages in OneDrive
.libPaths("D:R/lib") # or any folder
.libPaths()
or something in the line of this
Devel. version
Install Gitlab dev. ver. with devtools (Wickham et al., 2019b):
Attention windows users, please install Rtools and git (compilation tools).
Vignettes (optional) use a lua filter, so you would need pandoc ver. > 2. and pandoc-citeproc
or citeproc
. RStudio comes with pandoc. rmarkdown::pandoc_version()
# This installs package devtools, necessary for installing the dev version
install.packages("devtools")
<- "https://gitlab.com/ferroao/idiogramFISH"
url
# Packages for vignettes: (optional)
<- c(
list.of.packages "knitr",
"kableExtra",
"rmdformats",
"rmarkdown",
"RCurl",
"rvcheck",
"badger",
"rentrez"
)<- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
new.packages if(length(new.packages)) install.packages(new.packages)
# Linux with vignettes and Windows
::install_git(url = url,build_vignettes = TRUE, force=TRUE)
devtools
# Mac with vignettes
::install_git(url = url, build_opts=c("--no-resave-data","--no-manual") ) devtools
Installing in system terminal
# clone repository:
"https://gitlab.com/ferroao/idiogramFISH"
git clone
R CMD build idiogramFISH# install
*.tar.gz R CMD INSTALL idiogramFISH_
Need help?
Vignettes:
Online:
Launch vignettes from R for the installed version:
library(idiogramFISH)
packageVersion("idiogramFISH")
browseVignettes("idiogramFISH")
Citation
To cite idiogramFISH in publications, please use:
Roa F, Telles MPC (2021) idiogramFISH: Shiny app. Idiograms with Marks and Karyotype Indices, Universidade Federal de Goiás. Brazil. R-package. version 2.0.2 https://ferroao.gitlab.io/manualidiogramfish/. doi:10.5281/zenodo.3579417
To write citation to file:
sink("idiogramFISH.bib")
toBibtex(citation("idiogramFISH"))
sink()
1 Shiny App
library(idiogramFISH)
runBoard()
2 Minimal examples
2.1 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
$Mbp<-(dfOfChrSize$shortArmSize+dfOfChrSize$longArmSize)*100
dfOfChrSize
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 | chartreuse3 | square |
DAPI | blue | square |
CMA | darkgoldenrod1 | 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 |
2.2 Holocentrics
library(idiogramFISH)
# load some package data.frames - optional
data(dfChrSizeHolo, dfMarkColor, dfMarkPosHolo)
# column Mbp not for plotting purposes
$Mbp<-dfChrSizeHolo$chrSize*100
dfChrSizeHolo
# 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 = 20 # 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 | chartreuse3 | square |
DAPI | blue | square |
CMA | darkgoldenrod1 | 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.
Merge data.frames with plyr
(Wickham, 2011)
# chromosome data, if only 1 species, column OTU is optional
require(plyr)
$OTU <- "Species mono"
dfOfChrSize$OTU <- "Species holo"
dfChrSizeHolo
<- plyr::rbind.fill(dfOfChrSize,dfChrSizeHolo)
monoholoCS
$OTU <-"Species mono"
dfOfMarks2which(dfOfMarks2$markName=="5S"),]$markSize<-.7
dfOfMarks2[$OTU <-"Species holo"
dfMarkPosHolo
<- plyr::rbind.fill(dfOfMarks2,dfMarkPosHolo) monoholoMarks
Plot
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
,
# ,useOneDot=TRUE
# ,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 = -0.6 # modify position of OTU label, when OTUplacing="number" or "simple"
# ,OTUlegendHeight = 1.5 # space among OTU names when in legend - OTUplacing
# ,separFactor = 0.75 # alter separ. of kar.
)dev.off() # close png