---
title: "OSS dashboards: Epistemic Diversity"
output:
flexdashboard::flex_dashboard:
storyboard: true
social: menu
source: embed
---
```{r setup, include=FALSE}
source("set-up.r")
main_df = readRDS("../data/main_df.rds")
temporal_sub_all = readRDS("../data/temporal_sub_all.rds")
cd19_agg_data = readRDS("../data/cd19_agg_data.RDS")
gisaid = readRDS("../data/gisaid.RDS")
k3 = readRDS("../data/k3_plot.RDS")
k9 = readRDS("../data/k9_plot.RDS")
```
### Fig. 1: Monthly totals of global SARS-CoV-2 cases sequenced and shared on the GISAID and Covid-19 Data Platform database until Febuary 22 2022.
```{r}
f1= ggplot(data=temporal_sub_all) +
geom_line(aes(x=Date,y=sum_gisaid, group=1, color='GISAID Monthly Total')) +
geom_line(aes(x=Date,y=sum_cd19dp, group=1, color ='CD19DP Monthly Total')) +
scale_colour_manual("",
breaks = c("GISAID Monthly Total", "CD19DP Monthly Total"),
values = c("green", "blue")) +
guides(shape = guide_legend(order = 2), col = guide_legend(order = 1)) +
labs(x = "Date",
y = "Sequence Submissions",
title = "Monthly Total SARS-CoV-2 Sequence Submissions",
caption = "") + dark_theme() + theme(axis.text.x = element_text(angle = 90, vjust = 0.5))
ggplotly(f1)
```
***
GISAID Metadata:
- https://www.epicov.org/
Covid-19 Data Platform Metadata:
- https://www.ebi.ac.uk/ena/portal/api/
### Fig. 2: Monthly mean of global SARS-CoV-2 cases sequenced and shared on the GISAID and Covid-19 Data Platform database until Febuary 22 2022.
```{r}
f2 = ggplot(data=temporal_sub_all) +
geom_line(aes(x=Date,y=sum_gisaid_av, group=1, color='GISAID Monthly Mean')) +
geom_line(aes(x=Date,y=sum_cd19dp_av, group=1, color ='CD19DP Monthly Mean')) +
annotate("text", x = 7, y = 600, label = "WHO Declares\n Pandemic") +
annotate("text", x = 17, y = 2000, label = "AstraZeneca's \nVaccine Authorised") +
annotate("text", x = 18, y = 4000, label = "EBI Open letter") +
annotate("text", x = 27, y = 6000, label = "Global Covid-19 Deaths \nPass Five Million") +
scale_colour_manual("",
breaks = c("GISAID Monthly Mean", "CD19DP Monthly Mean"),
values = c("green", "blue")) +
guides(shape = guide_legend(order = 2), col = guide_legend(order = 1)) +
labs(x = "Date",
y = "Sequence Submissions",
title = "Monthly Mean SARS-CoV-2 Sequence Submissions") + dark_theme() + theme(axis.text.x = element_text(angle = 90, vjust = 0.5))
ggplotly(f2)
```
***
GISAID Metadata:
- https://www.epicov.org/
Covid-19 Data Platform Metadata:
- https://www.ebi.ac.uk/ena/portal/api/
### Fig. 3: The proportion of global SARS-CoV-2 cases sequenced and shared on the GISAID database until Febuary 22 2022.
```{r}
log_df = main_df %>% filter(Date == "2022/02")
f3 = ggplot(log_df, aes((GISAID.total.Submissions), (log_df$cases))) +
geom_point(aes(color = continent, size = `Genomes per confirmed cases (GISAID)`),alpha = 75 /100) +
geom_text(aes(label = Country, color = continent),
nudge_y = 0.06) + dark_theme() +
labs(x = "Sequenced Genomes",
y = "Confirmed Cases",
title = "Confirmed Covid-19 Cases vs. Sequenced Genomes in the GISAID Open database",
caption = "\n\n\nSARS-CoV-2 Data: John Hopkins") +
scale_y_log10() +
scale_x_log10() +
geom_rug(col =rgb(.5, 0, 0, alpha = .2)) +
guides(shape = guide_legend(order = 2), col = guide_legend(order = 1))
ggplotly(f3)
```
***
### Fig. 4: The proportion of people fully vaccinated and global SARS-CoV-2 cases sequenced and shared on the GISAID database until Febuary 28 2022.
```{r}
f4 = ggplot(log_df, aes((GISAID.total.Submissions),(log_df$People_fully_vaccinated))) +
geom_point(aes(color = continent, size = `Genomes per confirmed full vaccine (GISAID)`),alpha = 75 /100) +
geom_text(aes(label = Country,color = continent),nudge_y = 0.06) +
dark_theme() +
labs(x = "Sequenced Genomes",
y = "People Fully Vaccinated",
title = "People Fully Vaccinated vs. Sequenced Genomes in the GISAID Open Database") +
scale_y_log10() +
scale_x_log10() +
geom_rug(col =rgb(.5, 0, 0, alpha = .2)) +
guides(shape = guide_legend(order = 2), col = guide_legend(order = 1))
ggplotly(f4)
```
***
### Fig. 5: The proportion of global SARS-CoV-2 cases sequenced and shared on the C19DP database until Febuary 28 2022
```{r}
f5 = ggplot(log_df, aes(CD19DP.total.Submissions, cases)) +
geom_point(aes(color = continent, size = `Genomes per confirmed cases (C19DP)`),
alpha = 75 / 100) +
geom_text(aes(label = Country, color = continent), nudge_y = 0.06) +
dark_theme() +
labs(
x = "Sequenced Genomes",
y = "Confirmed Cases",
title = "Confirmed Covid-19 Cases vs. Sequenced Genomes in the Covid-19 Data Portal"
) +
scale_y_log10() +
scale_x_log10() +
geom_rug(col = rgb(.5, 0, 0, alpha = .2)) +
guides(shape = guide_legend(order = 2), col = guide_legend(order = 1))
ggplotly(f5)
```
***
### Fig. 6: The proportion of people fully vaccinated and global SARS-CoV-2 cases sequenced and shared on the C19DP database until Febuary 28 2022
```{r}
f6 = ggplot(log_df, aes((CD19DP.total.Submissions),
(log_df$People_fully_vaccinated))) +
geom_point(aes(size = `Genomes per confirmed full vaccine (C19DP)`, color = continent),
alpha = 75 / 100) + geom_text(aes(label = Country, color = continent), nudge_y = 0.06) +
dark_theme() +
labs(
x = "Sequenced Genomes",
y = "People Fully Vaccinated",
title = "People Fully Vaccinated vs. Sequenced Genomes in the Covid-19 Data Portal"
) +
scale_y_log10() +
scale_x_log10() +
geom_rug(col = rgb(.5, 0, 0, alpha = .2)) +
guides(shape = guide_legend(order = 2), col = guide_legend(order = 1))
ggplotly(f6)
```
***
### Fig. 7 Covid-19 Data Platform Temporal
```{r}
cd19_agg_data %>%
barChartRace(
x = "CD19DP.total.Submissions",
y = "Country",
time = "Date",
ytitle = "Country",
xtitle = "Count (n submissions)",
title = "Global GISAID EpiCov Database Submissions",
paddingWidth = 0.1,
xFontSize = 10,
yFontSize = 10,
xticks = 12,
xtitleFontSize = 14,
ytitleFontSize = 14,
titleFontSize = 22,
stroke = "black",
strokeWidth = NULL,
font = "gochi",
bgcol = "#cf2e2e",
panelcol = "#fcb900",
xgridlinecol = "#8ed1fc",
opacity = 1,
timeLabel = TRUE,
timeLabelOpts = list(
size = 28,
prefix = "",
suffix = "",
xOffset = 0.5,
yOffset = 1
),
width = NULL,
height = NULL
)
```
***
### Fig. 8 GISAID Temporal Submissions.
```{r}
gisaid %>%
barChartRace(
x = "GISAID.total.Submissions",
y = "Country",
time = "Date",
ytitle = "Country",
xtitle = "Count (n submissions)",
title = "Global GISAID EpiCov Database Submissions",
paddingWidth = 0.1,
xFontSize = 10,
yFontSize = 10,
xticks = 12,
xtitleFontSize = 14,
ytitleFontSize = 14,
titleFontSize = 22,
stroke = "black",
strokeWidth = NULL,
font = "gochi",
bgcol = "#cf2e2e",
panelcol = "#fcb900",
xgridlinecol = "#8ed1fc",
opacity = 1,
timeLabel = TRUE,
timeLabelOpts = list(
size = 28,
prefix = "",
suffix = "",
xOffset = 0.5,
yOffset = 1
),
width = NULL,
height = NULL
)
```
***
### Fig. 9 Clustering (4)
```{r}
ggplotly(k3)
```
***
### Fig. 9 Clustering (9)
```{r}
ggplotly(k9)
```
***
***
### Fig.10 GISAID Share
```{r}
library(treemap)
present = main_df %>% dplyr::filter(Date == "2022/02")
treemap(present,
index=c("continent", "Country"),
vSize="GISAID.total.Submissions",
type="index",
title = "GISAID EpiCov global \nsequence share",
fontfamily.title = "mono",
fontsize.title = 24,
fontsize.labels=c(12,9),
fontcolor.labels=c("white","black"),
fontface.labels=c(2,1),
bg.labels=c("transparent"),
palette="RdYlGn",
align.labels=list(
c("center", "center"),
c("right", "top")),
overlap.labels=0.5,
inflate.labels=F,
)
```
***
### Fig.10 EBI Global Share
```{r}
library(treemap)
present = main_df %>% dplyr::filter(Date == "2022/02")
treemap(present,
index=c("continent", "Country"),
vSize="CD19DP.total.Submissions",
type="index",
title = "EBI EpiCov \nglobal sequence share",
fontfamily.title = "mono",
fontsize.title = 24,
fontsize.labels=c(12,9),
fontcolor.labels=c("white","black"),
fontface.labels=c(2,1),
bg.labels=c("transparent"),
palette="RdYlGn",
align.labels=list(
c("center", "center"),
c("right", "top")),
overlap.labels=0.5,
inflate.labels=F,
)
```
***