-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
97 lines (75 loc) · 2.68 KB
/
Copy pathREADME.Rmd
File metadata and controls
97 lines (75 loc) · 2.68 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<style type="text/css">
span > img {
align: left;
width: 75px;
}
</style>
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# gplate <a href="https://kaiaragaki.github.io/gp/"><img src="man/figures/logo.png" align="right" height="138" /></a>
<!-- badges: start -->
[](https://github.com/KaiAragaki/gplate/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
**gplate** introduces a **g**rammar of **plate**s.
Microwell plates are usually arranged in visually meaningful ways but are not tidy data, and their manipulation to and from a tidy form is cumbersome. gplate is aimed at both developers that create packages that ingest and produce plate data as well as for interactive operating on microwell data.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("KaiAragaki/gplate")
```
## Creating plates with gplate
Creating a plate plot is simple:
```{r example, dpi=500}
library(gplate)
gp(rows = 16, cols = 24) |>
gp_plot(as.factor(.row))
```
We can add rectangular 'sections' to our plates:
```{r dpi=500}
gp(rows = 16, cols = 24) |>
gp_sec("my_section", nrow = 12, ncol = 6) |>
gp_plot(my_section)
```
These sections can have sections of their own, just by layering one `gp_sec` on the other.
```{r dpi=500}
gp(rows = 16, cols = 24) |>
gp_sec("my_section", nrow = 12, ncol = 6) |>
gp_sec("secsec", nrow = 3, ncol = 3) |>
gp_plot(secsec)
```
`gplate` also has a theme - `gp_mini_theme` - that lets you create sparkline-esque plates.
```{r}
mini_plot_cols <- gp(8, 12) |>
gp_sec(name = "primers", ncol = 3) |>
gp_plot(primers) +
gp_mini_theme()
ggplot2::ggsave(filename = "./man/figures/mini-plot_cols.png",
plot = mini_plot_cols,
height = 0.5,
width = 0.75,
units = "in",
scale = 3.5)
mini_plot_rows <- gp(8, 12) |>
gp_sec(name = "primers", nrow = 3) |>
gp_plot(primers) +
gp_mini_theme()
ggplot2::ggsave(filename = "./man/figures/mini-plot_rows.png",
plot = mini_plot_rows,
height = 0.5,
width = 0.75,
units = "in",
scale = 3.5)
```
For instance:
> You should align your primers in columns <span></span> instead of in rows <span></span>