Map

Row

Total number of fermented products

605

Fermented Food Categories

14

Ontological Categories

272

Country

125

Row

Graphs

Column

Annual Global Production Volume

bln liters of beer in 2022

189

bln liters of wine in 2022

25.8

bln kg of bread in 2023

185

bl kg of soy sauce in China (2021)

7.9

bln kg of cheese in 2023

22.35

bln kg of yoghurt in 2023

60.5

Column

Column

Data

About

The Fermented Food Dashboard

Fermented food of the world integrated resource “A comprehensive manually curated and referenced list of fermented foods of the world.” The presented resource includes:

Legal frameworks for the protection of regional foods

Disclaimers

Disclaimer on the Diversity of Fermented foods The FermDB does not represent the whole extension of the diversity of the foods worldwide. It is instead a live resource that will continue to expand with the aim of becoming one of the most extensively curated databases for global fermented foods. For each food the country of origin was determined based on the literature search, but it is acknowledged that other countries could be linked to a specific product.


Code

The code behind this dashboard is available on Github.


Contributors

---
title: "FermDB"
encoding: UTF-8

output: 
  flexdashboard::flex_dashboard:

    css: style.css
    social: menu
    source_code: embed
    orientation: columns
    vertical_layout: fill
 
---
<style type="text/css">

.chart-title {  /* chart_title  */
   font-size: 18px;
}
</style>
```{r setup, include=FALSE}
#------------------ Packages ------------------
library(flexdashboard)
library(dplyr)
library(DT)
library(plotly)
library(leaflet)
library(rnaturalearth)
library(ggplot2)
library(readr)
library(tidyr)
library(collapsibleTree)
#------------ Country cleanup ---------------------
country.table <- read.csv("country_new.csv", sep = ';', header = TRUE)

fermentedfood.new_test <- read_tsv("FermDB_data.tsv", col_names = TRUE, locale = locale(encoding = "UTF-8")) 
names(fermentedfood.new_test) <- gsub("\\s+", "_", names(fermentedfood.new_test))


fermentedfood.flat <- separate_longer_delim(fermentedfood.new_test,c(Country,Country_code),delim = ',')

fermentedfood.flat$Country_code <- as.integer(fermentedfood.flat$Country_code)

```

Map {data-orientation=rows}
===================================== 

Row {data-height=50}
----------------------------------
### Total number of fermented products
```{r}
valueBox(value = dplyr::n_distinct(fermentedfood.new_test$Product), 

         icon = "fas fa-carrot", 
         color = "info"
         )
```
### Fermented Food Categories 
```{r}
valueBox(value =  dplyr::n_distinct(fermentedfood.new_test$Category), 

         icon = "fas fa-leaf", 
         color = 'success'
         )
```
### Ontological Categories 
```{r}
valueBox(value = dplyr::n_distinct(fermentedfood.new_test$Raw_material_ontology),

         icon = "fas fa-seedling",
         color = 'success'
        )
```

### Country
```{r}
valueBox(value = dplyr::n_distinct(fermentedfood.flat$Country_code),
         icon = "fas fa-globe", 
        )
```

Row {data-height=800}
-----------------------------------------------------------------------

###  
```{r}

fermentedfood.country <- select(fermentedfood.flat,Country_code,Product) %>%
                              left_join(select(country.table,Country.or.Area,Region.Name,Sub.region.Name,M49.Code,ISO.alpha3.Code),
                             by = c('Country_code' = 'M49.Code'))

# map polygons coordinates
map <- ne_countries()
names(map)[names(map) == "iso_a3_eh"] <- "ISO3"
names(map)[names(map) == "name"] <- "NAME"

# all countries iso codes
country.table<-country.table %>% select(12:12)
fermentedfood.agg <- na.omit(fermentedfood.country %>% group_by(ISO.alpha3.Code) %>% 
  summarise(total_count=n(),
            .groups = 'drop'))

fermentedfood.joined <- left_join(country.table, fermentedfood.agg, by = 'ISO.alpha3.Code')

map$total_count <-fermentedfood.joined[match(map$ISO3, fermentedfood.joined$ISO.alpha3.Code),"total_count"]
# palete of colors
pal <- colorBin(palette = 'viridis', domain = map$total_count,
                bins = seq(0, max(map$total_count, na.rm = TRUE) +15, by = 10))


map$labels <- paste0("<strong> Country: </strong> ", map$NAME, "<br/> ",
                     "<strong> Total count: </strong> ", map$total_count, "<br/> ") %>%
                       lapply(htmltools::HTML)

leaflet(map) %>% 
  addTiles() %>% 
    setView(lng = 10, lat = 40, zoom = 3) %>%
    addPolygons(
    fillColor = ~pal(total_count),
    color = "white",
    fillOpacity = 0.7,
    label = ~labels,
    highlight = highlightOptions(color = "black", bringToFront = TRUE)) %>%
  addLegend(pal = pal, values = ~total_count, opacity = 0.7, title = "FermentedFood")

```

Graphs {data-orientation=columns}
===================================== 

Column {data-width=250} 
-------------------------------------- 
**Annual Global Production Volume**

### bln liters of beer in 2022
```{r}
valueBox(value = 189, 
         icon="fa-solid fa-beer-mug-empty",
         color = "info"
         )
```

### bln liters of wine in 2022 

```{r}
valueBox(value =  25.8, 
         icon = "fa-solid fa-wine-glass", 
         color = 'success'
         )
```

### bln kg of bread in 2023
```{r}
valueBox(value = 185,
         icon ="fa-solid fa-bread-slice",
         color = 'success'
        )
```

###  bl kg of soy sauce in China (2021)

```{r}
valueBox(value = 7.9,
         icon = "fa-solid fa-bottle-water", 
        )
```
### bln kg of cheese in 2023

```{r}
valueBox(value = 22.35,
         icon = "fas fa-cheese", 
        )
```
### bln kg of yoghurt in 2023

```{r}
valueBox(value = 60.5,
         icon = "fa-solid fa-whiskey-glass", 
        )
```
Column {data-width=500}
--------------------------------------    

###

```{r}
fermentedfood.category <- fermentedfood.new_test %>% group_by(Category) %>% 

  summarise(total_count=n(),.groups = 'drop') %>%
  as.data.frame()
datatable(arrange(fermentedfood.category,desc(total_count)), rownames = FALSE,options = list(dom = 't')
          )
```
###

```{r}
fermentedfood.country <- fermentedfood.flat %>% group_by(Country) %>% 
  summarise(total_count=n(),.groups = 'drop') %>%
  as.data.frame()
datatable(arrange(fermentedfood.country,desc(total_count)), rownames = FALSE,options = list(dom = 't')
          )
```



Column {data-width=400}
--------------------------------------    
```{r}
df_ontology <- read.csv("Raw_ontology_table.csv")


df_ontology %>%
  group_by(Level1,Level2,Level4) %>%
  summarize('Total Count' = n()) %>%
  collapsibleTreeSummary(
    hierarchy = c( 'Level1','Level2','Level4'),
    root = 'Materials',
    width = 800,
    attribute = "Total Count",
  zoomable = FALSE
)


```
Data {data-orientation=rows}
===================================== 


```{r}
fermentedfood.new_test %>%

          select("Continent","Region",'Subregion',"Country","Category","Product","Original_Name",
                "Description","Raw_material", "Reference", "Webpage_reference") %>%
  
datatable(colnames = c("Continent","Region",'Subregion',"Country","Category","Product","Original_Name",
                "Description","Raw_material", "Reference", "Webpage_reference"),
         extensions = 'Buttons',
         plugins = "ellipsis",
         options = list( columnDefs = list(
                      list(
                        targets = c(8,9,10),
                        render = JS("$.fn.dataTable.render.ellipsis( 80, false )")
                        
                        )),
                       searchHighlight = TRUE,
                       pageLength = nrow(fermentedfood.new_test),

                       filter = "top",
                       dom = 'Bfrtip',
                       buttons = c('excel', 'copy', 'print')),
                       
          
  ) 
```

About {data-orientation=rows}
===================================== 
**The Fermented Food Dashboard**

Fermented food of the world integrated resource
“A comprehensive manually curated and referenced list of fermented foods of the world.”
The presented resource includes:
<br>

* Location:
Full country name(s), regions and subregions based on the classification provided by the Standard country or area codes for statistical use (M49) of the United Nations.
      
* Product (Name):
Name in English. If available, the name in the original language is also presented.
     
* Description:
Overview for a non-expert. (1) Overall description of the food (2) Particularities of the production; and (3) Particularities of location of production or geographic distribution.

* Raw material ontology:
This classification is based exclusively on raw materials on a semi-organismic level while excluding processing information.

* Raw material additional information:
Details about the raw materials that are not captured in the ontology. It includes any details related to the particularities of an ingredient.

* Category:
Each food is assigned to one general fermented food category:  acid beverage, alcoholic beverage, beer, cheese, condiment, dairy product, fermented cereal, fermented fish, fermented fruit, fermented legumes, fermented meat, fermented roots, fermented vegetables, or wine.

* References:
A valid reference from a peer-reviewed publication, book, industry handbook or official government document.

* Webpage reference:
Government website or Wikipedia webpages containing image of the fermented food.
<br>

**Legal frameworks for the protection of regional foods**

* [Protected Designation of Origin (PDO)](https://agriculture.ec.europa.eu/farming/geographical-indications-and-quality-schemes/geographical-indications-and-quality-schemes-explained_en#pdo)

* [Protected Geographical Indication (PGI)](https://agriculture.ec.europa.eu/farming/geographical-indications-and-quality-schemes/geographical-indications-and-quality-schemes-explained_en#pdo)

* [Traditional Speciality Guaranteed (TSG)](https://agriculture.ec.europa.eu/farming/geographical-indications-and-quality-schemes/geographical-indications-and-quality-schemes-explained_en#pdo)

* [Appellation d'Origine Contrôlée (AOC)](https://www.economie.gouv.fr/particuliers/aop-aoc-igp-stg-labels-certification-alimentation#)
<br>

**Disclaimers**


Disclaimer on the Diversity of Fermented foods
The FermDB does not represent the whole extension of the diversity of the foods worldwide.
It is instead a live resource that will continue to expand with the aim of becoming one of
the most extensively curated databases for global fermented foods.
For each food the country of origin was determined based on the literature search,
but it is acknowledged that other countries could be linked to a specific product. 

<br>



**Code**

The code behind this dashboard is available on [Github](https://github.com/bokulich-lab/FermDB).

<br>

**Contributors**

* Rodrigo Hernández Velázquez (ETH Zurich, Switzerland)

* Lena Flörl (ETH Zurich, Switzerland)

* Nicholas Bokulich (ETH Zurich, Switzerland)

* Till Bauknecht (ETH Zurich, Switzerland) 

* Anna Greppi (ETH Zurich, Switzerland)

* Rossana Coda (University of Helsinki, Finland)

* Jan Patrick Tan (ETH Zurich, Switzerland)

* Sara De Crescenzo (ETH Zurich, Switzerland)

* Salome Häcki (ETH Zurich, Switzerland)

* Joan Oñate Narciso (Universitat de Lleida, Spain)

* Theresa Abimbola Awotundun (Ajayi Crowther University, Nigeria)

* Afolake Olanbiwoninu (Ajayi Crowther University, Nigeria)

* Wilfrid Padonou (Unviersité Nationale d’Agriculture, Benin)

* Sengchanh Kounnavong (Lao Tropical & Public Health Institute, Lao PDR)

* Charlotte Lambert (ETH Zurich, Switzerland)