gganatogram: An R package for modular visualisation of anatograms and tissues based on ggplot2

Displaying data onto anatomical structures is a convenient technique to quickly observe tissue related information. However, drawing tissues is a complex task that requires both expertise in anatomy and the arts. While web based applications exist for displaying gene expression on anatograms, other non-genetic disciplines lack similar tools. Moreover, web based tools often lack the modularity associated with packages in programming languages, such as R. Here I present gganatogram, an R package used to plot modular species anatograms based on a combination of the graphical grammar of ggplot2 and the publicly available anatograms from the Expression Atlas. This combination allows for quick and easy, modular, and reproducible generation of anatograms. Using only one command and a data frame with tissue name, group, colour, and value, this tool enables the user to visualise specific human and mouse tissues with desired colours, grouped by a variable, or displaying a desired value, such as gene-expression, pharmacokinetics, or bacterial load across selected tissues. gganatogram consists of 5 highly annotated organisms, male/female human/mouse, and a cell anatogram. It further consists of 24 other less annotated organisms from the animal and plant kingdom. I hope that this tool will be useful by the wider community in biological sciences. Community members are welcome to submit additional anatograms, which can be incorporated into the package. A stable version gganatogram has been deposited to neuroconductor, and a development version can be found on github/jespermaag/gganatogram. An interactive shiny app of gganatogram can be found on https://jespermaag.shinyapps.io/gganatogram/, which allows for non-R users to create anatograms.

This article is included in the Neuroconductor collection.

Amendments from Version 1 Introduction
Efficiently displaying tissue information in multicellular organisms can be a laborious and time consuming process. Often researchers want to showcase differences in values, such as gene expression or pharmacokinetics between tissues in one organism, or between similar tissues in different groups.
Whereas bar charts and heatmaps provide an informative view of the differences between groups, it can be difficult to immediately observe the biological significance (Figure 1a-b). As compared to an anatogram, where it is easy to quickly spot the differences between tissues or groups, and immediately provide biological context to these observations ( Figure 1c). This also has the added benefit that the audience, whether reading a paper or attending a lecture, will have to spend less time and effort to grasp the results. Several online tools to display gene expression in different tissues already exist [1][2][3][4] . Although these tools provide important information regarding gene expression in various tissues and organisms, other disciplines besides genetics are unable to utilise these applications due to the focus on genes. Moreover, these tools often only include a predefined set of experiments that can be visualised, leading to difficulties in presenting your own data. Other caveats with these tools are that it can be laborious to recreate the plot or automatically create plots from results.
Here I present gganatogram, an open source R package based on ggplot2 5 utilising 28 publicly available anatograms from the Expression Atlas 1,2 , and a cellular anatogram from The Protein Atlas 6 . With this package it is easy for any R user to quickly visualise anatograms with specified colours, groups, and values. Using the familiar grammar from ggplot2 5 , this program allows for modular anatograms to be generated.

Methods
Implementation gganatogram is stored on neuroconductor 7 , an open-source platform for rapid testing and dissemination of reproducible computational imaging software. A development version can be found on github/jespermaag/gganatogram, which allows for the community to post issues with the package, submit requests, or add anatograms by creating coordinate files.
source("https://neuroconductor.org/neurocLite.R") neuro_install("gganatogram") The development version can be installed from github: devtools::install_github("jespermaag/gganatogram") Briefly, to generate the main list objects that contain all tissue coordinates, I downloaded SVG files from the Expression Atlas (SVG files present here 2 . (and processed them using a custom python script (available from GitHub). The script scraped through the SVG files to extract the name, coordinates, and SVG transformations. These were then post-processed in R to create the rda files that make up the tissue coordinates. For the cell, the SVG was downloaded from The Protein Atlas 6 . Here, I converted the relative coordinates in the SVG to absolute using Inkscape. I then processed the absolute coordinate SVG using python. Plots can be generated using a basic data.frame containing organ name, colour, type, or value, with the specified column names below. Organs are plotted one at a time based on the order of the data.frame. The tissue of each consecutive row will be layered on top of the previous. The gganatogram package provides 29 such data.frames containing all tissues available to plot, one for each human and mouse, divided by sex, one cell, and 24 other organisms (Table 1).

hgMale_key, hgFemale_key, mmMale_key, mmFemale_key, cell_key[["cell"]]
These data frames have already specified colour, type, and an assigned random number to facilitate the start of plotting. The main function is called gganatogram(). By default, and without any arguments, it plots the outline of a male human with standard ggplot2 parameters. By adding just a few options, it is possible to quickly change to female, fill specified organs by selected colour, or fill the organs based on a value ( Figure 2).

Use cases
This section provides additional plotting examples.
To plot all tissues per organism, use the provided key files that exist per organism and sex. This displays all tissues in the order of each data frame. To change the order in which organs are layered on top of each other, reorder the data frame to have those tissues at the bottom ( Figure 3).

Summary
In summary, I have designed and implemented an R package to easily visualise anatograms based on ggplot2 5 and the anatograms from Expression Atlas 2 , which when combined create a powerful tool to plot and display tissue information.
The one line command to generate these plots should allow for users with even limited R knowledge to create informative anatograms for publications or presentations.

References
Author contributions JLVM conceptualised the study, decided the methodology, wrote the code, and drafted the manuscript.

Grant information
The author(s) declared that no grants were involved in supporting this work.

1.
2. This article describes a new R package, which allows easy plotting of discrete and continuous measurements onto human and mouse anatomy. This is a really valuable R package contribution, as it fills a real void in the current infrastructure. I found the code examples in the manuscript intuitive and easy to run. It is great that the author adopts the popular ggplot2 grammar as well as a tidy data structures.

Minor comments:
It would be useful to know how many tissues (and which) can be plotted using this package.
An example of changing the order of the data frame to change the layering should be added.
I encountered the following error when trying to install the package through neuroconductor:

Is the description of the software tool technically sound? Yes
Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others? Yes Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes Are the conclusions about the tool and its performance adequately supported by the findings presented in the article? Yes No competing interests were disclosed.

Competing Interests:
Referee Expertise: Systems biology, computational tools, vaccinology I have read this submission. I believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.
The benefits of publishing with F1000Research: Your article is published within days, with no editorial bias You can publish traditional articles, null/negative results, case reports, data notes and more The peer review process is transparent and collaborative Your article is indexed in PubMed after passing peer review Dedicated customer support at every stage For pre-submission enquiries, contact research@f1000.com