dotsViolin
Drawing some complex plots automatically Dot plots mimicking violin plots . f.e.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 4 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.7%) to scientific vocabulary
Repository
Drawing some complex plots automatically Dot plots mimicking violin plots . f.e.
Basic Info
- Host: gitlab.com
- Owner: ferroao
- Default Branch: master
Statistics
- Stars: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
dotsViolin. Dot Plots Mimicking Violin Plots
Modifies dot plots to have different sizes of dots mimicking violin plots and identifies modes or peaks for them (Rosenblatt, 1956; Parzen, 1962).
dotsViolin, an R package (R Core Team, 2023) uses gridExtra (Auguie, 2017), gtools (Bolker et al., 2022), tidyr (Wickham et al., 2023c), stringr (Wickham, 2022), dplyr (Wickham et al., 2023b), ggplot2 (Wickham et al., 2023a), lazyeval (Wickham, 2019), magrittr (Bache and Wickham, 2022), rlang (Henry and Wickham, 2023), scales (Wickham and Seidel, 2022), tidyselect (Henry and Wickham, 2022)
Documentation was written with R-packages roxygen2 (Wickham et al., 2022), knitr (Xie, 2023), Rmarkdown (Allaire et al., 2023).
Academic presentation related (Roa-Ovalle, 2019)
Installation
r
devtools::install_gitlab(repo = "ferroao/dotsViolin")
Releases
Citation
To cite package ‘dotsViolin’ in publications use:
Roa-Ovalle F, Telles M (2023). dotsViolin: Integrated tables in dot and violin R ggplots. R package version 0.0.1, https://gitlab.com/ferroao/dotsViolin.
To write citation to file:
r
sink("dotsViolin.bib")
toBibtex(citation("dotsViolin"))
sink()
Authors
Fernando Roa
Mariana PC Telles
Plot window
Define your plotting window size with something like par(pin=c(10,6)),
or with svg(), png(), etc.
In VSCode, you could use something like this
yaml
{
"r.plot.useHttpgd": false,
"r.plot.devArgs": {
"width": 800,
"height": 600
}
}
Examples
1 Discrete Data:
``` r library(dotsViolin)
fabaceaemodecounts <- getmodescounts(fabaceaecladendf, "clade", "parsedn") ```
fabaceae_mode_counts
| clade | m1 | m2 | m3 | count | |:----------------------|:----|:-----|:----|:------| | Caesalpinieae | 12 | NA | NA | 29 | | Cassieae | 14 | 8 | 12 | 64 | | Cercidoideae | 14 | 7 | NA | 33 | | Detarioideae | 12 | 8,17 | NA | 50 | | Dialioideae | 14 | NA | NA | 6 | | Dimorphandra and rel. | 14 | 13 | NA | 16 | | Mimosoids | 13 | 26 | 14 | 221 | | outgroup | 8 | 12 | 11 | 145 | | Papilionoideae | 8 | 11 | 7 | 1410 | | Umtiza and rel. | 14 | NA | NA | 7 |
``` r library(dotsViolin)
fabaceaecladendfcount <- makelegendwithstats(fabaceaemodecounts, "labelcount", 1, TRUE) fabaceaecladendf$labelcount <- fabaceaecladendfcount$labelcount[match( fabaceaecladendf$clade, fabaceaecladendfcount$clade )] desiredorder1 <- unique(fabaceaecladen_df$clade) ```
fabaceae_clade_n_df
tip.label clade parsed_n
1 KX374504_Abarema_centiflora Mimosoids 13
2 KX213142_Adenodolichos_bussei Papilionoideae 11
3 KX792912_Almaleea_cambagei Papilionoideae 8
4 KP109982_Amphithalea_cymbifolia Papilionoideae 9
5 KP230727_Argyrolobium_tuberosum Papilionoideae 13
6 GU220019_Ateleia_arsenii Papilionoideae 14
label_count
1 Mimosoids 13 26 14 (221)
2 Papilionoideae 8 11 7 (1410)
3 Papilionoideae 8 11 7 (1410)
4 Papilionoideae 8 11 7 (1410)
5 Papilionoideae 8 11 7 (1410)
6 Papilionoideae 8 11 7 (1410)
``` r par(mar = c(0, 0, 0, 0), omi = rep(0, 4))
dotsandviolin( fabaceaecladendf, "clade", "labelcount", "parsed_n", 2, 30, "Chromosome haploid number", desiredorder1, 1, .85, 4, "ownwork", violin = FALSE ) ```

``` r par(mar = c(0, 0, 0, 0), omi = rep(0, 4))
dotsandviolin( fabaceaecladendf, "clade", "labelcount", "parsed_n", 2, 30, "Chromosome haploid number", desiredorder1, 1, .85, 4, dots = FALSE ) ```

``` r par(mar = c(0, 0, 0, 0), omi = rep(0, 4))
dotsandviolin( fabaceaecladendf, "clade", "labelcount", "parsed_n", 2, 30, "Chromosome haploid number", desiredorder1, 1, .85, 4 ) ```

2 Continuous Data:
Define your plotting window size with something like par(pin=c(10,6)),
or with svg(), png(), etc.
``` r library(dotsViolin)
fabaceaeCxpeakcountspercladedf <- getpeakscountscontinuous( fabaceaeclade1Cxdf, "clade", "Cx", 2, 0.25, 1, 2 ) ```
fabaceae_Cx_peak_counts_per_clade_df
| | clade | m1 | m2 | counts | |:--------------------|:--------------------|:---------------|:----------|-------:| | Caesalpinieae | Caesalpinieae | 0.85,1.80 | | 2 | | Cassieae | Cassieae | 0.69 | 0.52,0.56 | 6 | | Cercidoideae | Cercidoideae | 0.60 | | 5 | | COM clade | COM clade | 0.35,0.50,0.83 | | 3 | | Detarioideae | Detarioideae | 2.21 | 0.84,2.01 | 4 | | Dimorphandra & rel. | Dimorphandra & rel. | 0.73,0.79 | | 2 | | Malvids | Malvids | 0.40 | 0.63 | 8 | | Mimosoids | Mimosoids | 0.70 | 0.43 | 42 | | outgroups | outgroups | 0.48 | 1.38,2.76 | 9 | | Papilionoideae | Papilionoideae | 0.59 | | 212 | | Polygala amara | Polygala amara | 0.42 | | 1 | | Umtiza & rel. | Umtiza & rel. | 0.65,1.05 | | 2 | | Vitis vinifera | Vitis vinifera | 0.43 | | 1 |
``` r library(dotsViolin)
namecol <- "labelcountcustom" fabaceaeclade1Cxmodescountdf <- makelegendwithstats( fabaceaeCxpeakcountspercladedf, namecol, 1, TRUE ) fabaceaeclade1Cxdf$labelcountcustom <- fabaceaeclade1Cxmodescountdf$labelcountcustom[match( fabaceaeclade1Cxdf$clade, fabaceaeclade1Cxmodescountdf$clade )] desiredorder <- unique(fabaceaeclade1Cx_df$clade) ```
fabaceae_clade_1Cx_df
name clade Cx genus ownwork
6 'Silene_latifolia_JF715055' outgroups 2.7000 Silene no
7 'Fagopyrum_esculentum_NC010776' outgroups 1.4350 Fagopyrum no
11 'Helianthus_annuus_NC007977' outgroups 2.4250 Helianthus no
12 'Daucus_carota_NC008325' outgroups 2.8375 Daucus no
14 'Olea_europaea_NC013707' outgroups 1.9500 Olea no
18 'Coffea_arabica_NC008535' outgroups 0.6000 Coffea no
labelcountcustom
6 outgroups 0.48 1.38,2.76 (9)
7 outgroups 0.48 1.38,2.76 (9)
11 outgroups 0.48 1.38,2.76 (9)
12 outgroups 0.48 1.38,2.76 (9)
14 outgroups 0.48 1.38,2.76 (9)
18 outgroups 0.48 1.38,2.76 (9)
``` r par(mar = c(0, 0, 0, 0), omi = rep(0, 4))
dotsandviolin( fabaceaeclade1Cx_df, "clade", "labelcountcustom", "Cx", 3, 3, "Genome Size", desiredorder, 0.03, 0.25, 2, "ownwork" ) ```

``` r par(mar = c(0, 0, 0, 0), omi = rep(0, 4))
dotsandviolin( fabaceaeclade1Cx_df, "clade", "labelcountcustom", "Cx", 3, 3, "Genome Size", desiredorder, 0.03, 0.25, 2, dots = FALSE ) ```

``` r par(mar = c(0, 0, 0, 0), omi = rep(0, 4))
dotsandviolin( fabaceaeclade1Cx_df, "clade", "labelcountcustom", "Cx", 3, 3, "Genome Size", desiredorder, 0.03, 0.25, 2, "ownwork", violin = FALSE ) ```

References
R-packages
Academia
Owner
- Name: Fernando Roa
- Login: ferroao
- Kind: user
- Repositories: 25
- Profile: https://gitlab.com/ferroao
Issues and Pull Requests
Last synced: 10 months ago
Dependencies
- R >= 3.1.0 depends
- data.table * depends
- dplyr * depends
- ggplot2 * depends
- gridExtra * depends
- gtools * depends
- lazyeval * depends
- scales * depends
- stringr * depends
- tidyr * depends