-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
76 lines (52 loc) · 2.7 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# DiatoViz <img src="man/figures/logo.png" align="right" width="25%" min-width="120px" />
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=DiatoViz)
<!-- badges: end -->
`DiatoViz` is an R package developed for diatomists.
The `DiatoViz` package provides a simple function to add silhouettes of diatoms to plots generated `ggplot2`. Currently, the package contains 89 diatom silhouettes.
The silhouettes of diatoms were created using the [**SHERPA**](https://www.uni-due.de/phykologie/sherpa) software (Kloster et al. 2014).
## Installation
You can install the development version of `DiatoViz` from [GitHub](https://github.com/) with R package [**remotes**](https://cran.r-project.org/package=remotes):
``` r
#install.packages("remotes")
remotes::install_github("junqueiragaabi/DiatoViz")
```
## How does it work?
To use Diatoviz, your species list must be formatted with the specific abbreviations provided by the [**Omnidia**](https://omnidia.fr/en/) software. The main function `geom_diatom_code()` geometry draws diatom species shapes. Here you can see some the current available diatoms to plot.
```{r, plot, fig.width = 5, fig.height = 10, dpi=300, message=FALSE, warning=FALSE}
library(tidyverse)
library(DiatoViz)
diatoms <- DiatoViz::valid_diatom_code()
df_example <- data.frame(
a = c(rep(1:5, 17),c(1,2,3,4)),
b = sort(c(rep(1:17, 5), c(0,0,0,0)), decreasing = TRUE),
species = diatoms) %>%
slice(1:30)
ggplot(df_example, aes(x = a, y = b)) +
geom_diatom_code(aes(diatom_code = species), height = 0.1) +
geom_label(aes(label = species), nudge_y = -0.45) +
theme_void()+
theme(plot.margin = margin(15,15,15,15,"pt"))+
coord_cartesian(clip = "off")
```
## :orange_heart: Contribution
Can't find the diatom you want?
Contributions to `DiatoViz` package are welcome!
Please contact [Gabriela Junqueira](mailto:[email protected]) or submit a pull request.
## Credits
We extend our gratitude to [Sebastian Carl](https://github.com/mrcaseb) for his creation of the nflplotR and nbaplotR packages, which played a crucial role in shaping `DiatoViz`.
## References
Kloster M., Kauer G. & Beszteri B. (2014): SHERPA: an image segmentation and outline feature extraction tool for diatoms and other objects. BMC Bioinformatics 15:218.