-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.Rmd
163 lines (119 loc) · 3.38 KB
/
index.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
---
title: "Pyblastr - Tracking the wheat blast pathogen"
output:
flexdashboard::flex_dashboard:
orientation: rows
theme:
version: 4
bootswatch: lumen
social: menu
---
```{r include=FALSE}
source("readdata.R", local = knitr::knit_global())
```
```{r}
library(tidyverse)
library(flexdashboard)
library(janitor)
library(readxl)
library(cowplot)
library(see)
library(plotly)
library(gsheet)
```
Inputs {.sidebar}
-------------------------------------
**Filters**
```{r}
filter_slider("year", "Year", sd, ~ year)
filter_select("host", "Origin host", sd, ~ host_binomial)
filter_select("py_species", "Pyricularia spp.", sd, ~ py_binomial)
filter_select("py_lineage", "P. oryzae lineage", sd, ~ py_lineage)
```
**Pyblastr** is a database of information on characterized fungal strains of Pyricularia oryzae that causes blast in wheat and grasses in general, including turfgrass. Geographic information combined with the information on the year of sampling allows for tracking the temporal and spatial spread of the pathogen.
Row {data-height=100}
--------------
### Number of isolates
```{r}
isolates <- nrow(wb_all2)
valueBox(isolates, icon = "fa-pie-chart")
```
### Number of hosts
```{r}
hosts <- wb_all2 %>%
group_by(host_binomial) %>%
tabyl(host_binomial) %>%
nrow()
valueBox(hosts, icon = "fa-leaf")
```
### Number of countries
```{r}
country <- wb_all2 %>%
group_by(country) %>%
tabyl(country) %>%
nrow()
valueBox(country, icon = "fa-map")
```
Row {.tabset data-height=650}
-------------------------------------
### Global map
```{r}
library(crosstalk)
library(RColorBrewer)
library(htmltools)
pal <- colorFactor("Set2", domain = c("Wheat", "Non-wheat"))
leaflet(data = sd, width = "100%") %>%
setView(-1, -1, zoom = 2) %>%
addProviderTiles("Esri.WorldImagery", group = "Aerial") %>%
addProviderTiles("OpenTopoMap", group = "Terrain") %>%
addScaleBar("bottomright") %>%
addProviderTiles(providers$CartoDB.Voyager, group = "Default") %>%
addLayersControl(
baseGroups = c("Default", "Aerial", "Terrain"),
overlayGroups = "Blast pathogen",
options = layersControlOptions(collapsed = T)
) %>%
addCircleMarkers(
group = "wheat",
radius = 6,
fillOpacity = 1,
weight = 0.5,
label = paste(wb_all$host, "- Details"),
fillColor = ~ pal(wheat),
popup = paste(
"<h3>Isolate details</h3>",
"Source:", wb_all$"source", "<br>",
"Code:", wb_all$"labcode", "<br>",
"Host:", wb_all$"host_binomial", "</i>", "<br>",
"City:", wb_all$"county_municipality", "<br>",
"Year:", wb_all$"year", "<br>",
"Species:<i>", wb_all$"py_binomial", "<br></i>"
#"Lineage:<i>", wb_all$"py_lineage", "<br></i>"
)
) %>%
addLegend("bottomleft",
pal = pal,
values = ~wheat,
title = "Host",
opacity = 1
) %>%
addMeasure(
position = "bottomleft",
primaryLengthUnit = "meters",
primaryAreaUnit = "sqmeters",
activeColor = "#3D535D",
completedColor = "#7D4479") %>%
addEasyButton(easyButton(
icon="fa-globe", title="Zoom to Level 3",
onClick=JS("function(btn, map){ map.setZoom(3); }")))
```
### Grid view
```{r}
datatable(sd, rownames = FALSE,
extensions = c("Buttons"),
class = 'table-bordered table-condensed',
options = list(
dom = "Bfrtip",
pageLength = 10,
buttons = c("excel")))
```