# idiogramFISH: Shiny App. Idiograms with Marks and Karyotype Indices

# Introduction

The goal of idiogramFISH functions or shiny-app is to plot karyotypes, plasmids and circular chr. having a set of data.frames for chromosome data and optionally marks’ data (Roa and PC Telles, 2021). Karyotypes can also be plotted in concentric circles.
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).
Six styles of marks are available: square (squareLeft), dots, cM (cMLeft), cenStyle, upArrow (downArrow), exProtein (inProtein) (column `style` in `dfMarkColor` data.frame); its legend (label) (parameter `legend`) can be drawn inline or to the right of karyotypes. Three styles of centromere are available: rounded, triangle and inProtein (`cenFormat` parameter). Chromosome regions (column `chrRegion` in `dfMarkPos` data.frame) for monocentrics are `p`, `q`, `cen`, `pcen`, `qcen`. The last three cannot accommodate most mark styles, but can be colored. The region `w` can be used both in monocentrics and holocentrics.

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., 2019). 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) and rclipboard (Bihorel, 2021).

top

## Run the Shiny app with docker

- No need to install R
- Install docker on your system
- Make sure you can run a docker example image, i.e. ubuntu, in the console (system terminal)

    docker pull fercyto/idiogramfish

    # Run the image
    docker run -d -p 8080:8080 fercyto/idiogramfish

In your internet browser go to localhost:8080

    # Stop the container
    docker ps
    docker stop {container id}

## Installation instructions

- Install R on your system

You can install idiogramFISH from CRAN with:

    install.packages("idiogramFISH")

Windows users: To avoid installation of packages in OneDrive

    .libPaths("D:R/lib") # for example
    .libPaths()          # set or read libraries

To do that permanently: Search (magnifier) “environment variables” and set R_LIBS_USER to `D:\R\lib` (example)

top

## Releases

top

## Need help?

### Manual in Bookdown style

### Documentation in Pkgdown style

### Vignettes

Online:

Launch vignettes from R for the installed version:

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

top

## Citation

To cite idiogramFISH in publications, please use:

Roa F, Telles M. idiogramFISH: Shiny app. Idiograms with Marks and Karyotype Indices. doi: 10.5281/zenodo.3579417

To write citation to file:

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

top

## Authors

Fernando Roa

Mariana PC Telles

top

# 1 Working online

Shiny App in the cloud availability:
shinyapps.io

Each chapter has a `jupyter` version. A jupyter notebook seems an interactive vignette.

They are hosted in github

They can be accessed with `google colab` to work online.

| Github |
--- | --- | ---
3 Minimal examples | `link` | `Raw`
4 Plotting chromosomes | `link` | `Raw`
5 Multiple OTUs | `link` | `Raw`
6 Changing units | `link` | `Raw`
7 GISH | `link` | `Raw`
8 Groups | `link` | `Raw`
9 Circular Plots | `link` | `Raw`
10 Plotting alongside phylogeny | `link` | `Raw`
11 Citrus | `link` | `Raw`
12 Human Karyotype | `link` | `Raw`

Chapters can be accessed locally in your `jupyter-lab` or `jupyter notebook`

After installing jupyter, you can install the R kernel with:

    install.packages("IRkernel")
    IRkernel::installspec()

# 2 Shiny App

Attention Windows users, might require the last R version to plot correctly.

    library(idiogramFISH)
    runBoard()

Shiny App in the cloud availability:
shinyapps.io

# 3 Minimal Examples

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 4 Plotting chromosomes

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 5 Several OTUs

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 6 Changing Units

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 7 GISH

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 8 Using groups

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 9 Circular plots

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 10 Plotting alongside phylogeny

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 11 Citrus

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 12 Human karyotype

https://ferroao.gitlab.io/idiogramfishhelppages

Jupyter interactive version:

| Github | Raw

# 13 Functions

https://ferroao.gitlab.io/idiogramfishhelppages

# 14 Datasets

https://ferroao.gitlab.io/idiogramfishhelppages

# News

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
Romero-Zarco C. 1986. A new method for estimating karyotype asymmetry Taxon, 35(3): 526–530. https://doi.org/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. https://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://doi.org/10.1111/j.2041-210X.2011.00169.x
Roa F, PC Telles M. 2021. idiogramFISH: Shiny app. Idiograms with marks and karyotype indices Universidade Federal de Goiás, UFG, Goiânia. R-package. version 2.0.0. 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. 2019. 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
Winter DJ. 2017. rentrez: An r package for the NCBI eUtils API The R Journal, 9: 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: 3041–3043. https://doi.org/10.1093/molbev/msy194. https://doi.org/10.1093/molbev/msy194

## Shiny App

Bihorel S. 2021. Rclipboard: Shiny/r wrapper for clipboard.js. R package version 0.1.3. https://github.com/sbihorel/rclipboard/
Chang W, Borges Ribeiro B. 2018. Shinydashboard: Create dashboards with shiny. R package version 0.7.1. http://rstudio.github.io/shinydashboard/
Chang W, Cheng J, Allaire J, Sievert C, Schloerke B, Xie Y, Allen J, McPherson J, Dipert A, Borges B. 2021. Shiny: Web application framework for r. R package version 1.6.0. https://shiny.posit.co/
Owen J. 2018. Rhandsontable: Interface to the handsontable.js library. R package version 0.3.7. http://jrowen.github.io/rhandsontable/
Warnes GR, Bolker B, Lumley T. 2020. Gtools: Various r programming tools. R package version 3.8.2. https://github.com/r-gregmisc/gtools

## 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 the. 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. https://yihui.org/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. 2019b. Badger: Badge for r package. R package version 0.0.6. https://CRAN.R-project.org/package=badger
Yu G. 2019a. Rvcheck: R/package version check. R package version 0.1.6. https://CRAN.R-project.org/package=rvcheck
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