diff --git a/.Rhistory b/.Rhistory index de61bbb..d9c476b 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,69 +1,84 @@ -Stratification, -Light, -Photoperiod, -Alternating, -Tdif, -Tmax, -Tmin, -Tmean, -Temperature, -Germinated, -Number_seeds) %>% -rename(Reference = ReferenceRevised) -> -WoSDB -WoSDB %>% -filter(Biome == "TBMF") %>% -select(-Biome) -> TBMFDB # Temperate broadleaf and mixed forest database -WoSDB %>% -filter(Biome == "TCF") %>% -select(-Biome) -> TCFDB # Temperate coniferous forest database -readr::write_excel_csv(TBMFDB, here::here("results", "TBMF_Database.csv")) -readr::write_excel_csv(TCFDB, here::here("results", "TCF_Database.csv")) -# Calculate numbers for the manuscript main text -dfFrequentNames %>% -filter(SpeciesNew %in% TBMFspp) %>% -pull(SpeciesNew) %>% unique %>% length -> MSfrequentspp -merge(dfHeader, dfSpeciesRevised, by = "PlotID") %>% -filter(! Ecoregion %in% c("Cascade Mountains leeward forests", "Central and Southern Cascades forests", -"Eastern Cascades forests")) %>% # These ecoregions are in the vegetation db, but belong to different biome -select(New.ID) %>% -unique %>% -merge(Names, by = "New.ID") %>% -mutate(SpeciesNew = paste(New.Genus, New.Species, sep = " ")) %>% -pull(SpeciesNew) %>% unique %>% length -> MStotalspp -dfHeader %>% -filter(! Ecoregion %in% c("Cascade Mountains leeward forests", "Central and Southern Cascades forests", -"Eastern Cascades forests")) %>% # These ecoregions are in the vegetation db, but belong to different biome -pull(PlotID) %>% unique %>% length -> MSplots -dfHeader %>% -filter(! Ecoregion %in% c("Cascade Mountains leeward forests", "Central and Southern Cascades forests", -"Eastern Cascades forests")) %>% # These ecoregions are in the vegetation db, but belong to different biome -pull(Ecoregion) %>% unique %>% length -> MSecoregions -TBMFDB %>% tally() -> MSrecords -TBMFDB %>% pull(Reference) %>% unique %>% length -> MSreferences -TCFDB %>% pull(Reference) %>% unique %>% length -> MSreferencesTCF -TBMFDB %>% pull(Family) %>% unique %>% length -> MSfamilies -TBMFDB %>% pull(TPLName) %>% unique %>% length -> MSspecies -TBMFDB %>% pull(Year) %>% unique() %>% min -> MSoldest -TBMFDB %>% group_by(Country) %>% tally() %>% arrange(-n) -> MScountries -TBMFDB$Number_seeds %>% sum -> MSseeds -TBMFDB %>% pull(Tmean) %>% min -> MSminT -TBMFDB %>% pull(Tmean) %>% max -> MSmaxT -TBMFDB %>% filter(Alternating == "Y") %>% tally -> MSaltY -TBMFDB %>% filter(Alternating == "N") %>% tally -> MSaltN -TBMFDB %>% filter(Light == "Y") %>% tally -> MSlightY -TBMFDB %>% filter(Light == "N") %>% tally -> MSlightN -TBMFDB %>% filter(is.na(Light)) %>% tally -> MSlightNA -TBMFDB %>% filter(Stratification_type == "None") %>% tally -> MSstratN -TBMFDB %>% filter(Stratification_type == "Cold") %>% tally -> MSstratCold -TBMFDB %>% filter(Scarification == "Y") %>% tally -> MSscarY -TBMFDB %>% arrange(Reference) %>% pull(Reference) %>% unique -> MSrefapp -save(MSaltN, MSaltY, MScountries, MSlightN, MSlightNA, MSlightY, -MSrecords, MSscarY, MSstratCold, MSstratN, MSecoregions, MSfamilies, MSfrequentspp, MSmaxT, MSminT, MSoldest, MSplots, MSreferences, MSseeds, MSspecies, MStotalspp, MSrefapp, file = here::here("results", "msnumbers.RData")) +# Create files for the app +library(metafor); library(binom); library(data.table) +## A function to metanalize proportions... +metanalize <- function(d) +{ +m <- rma.glmm(measure = "PLO", xi = Germinated, ni = Number_seeds, data = d) +p <- predict(m, transf = transf.ilogit, digits = 3) +data.frame(mean = p$pred, lower = p$ci.lb, upper = p$ci.ub) +} +## Data grouped by experimental and species +TBMFDB %>% +mutate(group = paste(TPLName, Scarification, Stratification_type, +Light, Alternating, Temperature, sep = "_")) %>% +data.table(.) -> df +## First we check for which groups the metanalysis works... +listd <- split(df, by = "group", drop = TRUE) +ms <- lapply(listd, function(d) tryCatch(metanalize(d), error = function(e) e)) +rma.works <- names(ms)[lapply(ms, length) >= 3] +## Now we do the MA for the species that work +df.rma <- df[group %in% rma.works] +df.rma %>% +group_by(group) %>% +do(metanalize(.)) %>% +group_by -> rma.species +## And for the rest, we simply calculate the proportions and CI +df[! group %in% rma.works] %>% +group_by(group) %>% +summarise(Germinated = sum(Germinated), Number_seeds = sum(Number_seeds)) %>% +data.frame -> GermDF +cbind(group = GermDF[, 1], +binom.confint(GermDF$Germinated, GermDF$Number_seeds, method = "wilson")[, 4:6]) %>% +as_tibble()-> germdf +rbind(germdf, rma.species) %>% +separate(group, into = c("Species", "Scarification", "Stratification_type", +"Light", "Alternating", "Temperature"), sep = "_", +convert = TRUE) %>% +mutate(Light = ifelse(is.na(Light), "Light unknown", Light), +Species = as.factor(Species), +Scarification = as.factor(Scarification), +Stratification_type = as.factor(Stratification_type), +Light = as.factor(Light), +Alternating = as.factor(Alternating), +Scarification = recode_factor(Scarification, "N" = "Unscarified", "Y" = "Scarified"), +Stratification_type = recode_factor(Stratification_type, "C+W" = "C+W-stratified", +"Cold" = "Cold-stratified", +"None" = "Non-stratified", +"W+C" = "W+C-stratified", +"Warm" = "Warm-stratified"), +Light = recode_factor(Light, "N" = "Darkness", "Y" = "Light"), +Alternating = recode_factor(Alternating, "N" = "Constant temperature", +"Y" = "Alternating temperature"), +Experiment = paste(Light, Alternating, Stratification_type, Scarification, sep = ",\n"), +Experiment = as.factor(Experiment)) %>% +rename(Stratification = Stratification_type) -> Germination +## Biome map +library(raster); library(sp) +library(maps); library(mapdata); library(rgdal) +library(plyr) +## Prepare WWF shapefile +readOGR(dsn = "../#wwfmap/WWF", +layer = "wwf_terr_ecos") -> Ecoregions # Map files are in my home drive +rownames(Ecoregions@data) -> Ecoregions@data$id +fortify(Ecoregions, region = "id") -> Ecoregions.points +join(Ecoregions.points, Ecoregions@data, by = "id") %>% +inner_join(read.csv("../#wwfmap/Biomes.csv"), by = "BIOME") %>% +filter(BIOME == 4) -> +TBMF +TBMFDB %>% +dplyr::select(TPLName, Country, Latitude, Longitude) %>% +dplyr::rename(Species = TPLName) %>% +unique -> coordinates +coordinates %>% +dplyr::select(Longitude, Latitude) %>% +SpatialPoints(proj4string = CRS(proj4string(Ecoregions))) %over% Ecoregions %>% +cbind(coordinates) -> Places +save(Germination,TBMFDB, Places, TBMF, +file = here::here("results", "appdata.RData")) # Manuscript figures TBMFDB %>% ggplot(aes(x = Longitude, y = Latitude)) + @@ -98,23 +113,57 @@ ggsave(p2, file = "results/Fig2.tiff", path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) save(p1, p2, file = here::here("results", "msfigs.RData")) -# Create files for the app -library(metafor); library(binom); library(data.table) -## A function to metanalize proportions... -metanalize <- function(d) -{ -m <- rma.glmm(measure = "PLO", xi = Germinated, ni = Number_seeds, data = d) -p <- predict(m, transf = transf.ilogit, digits = 3) -data.frame(mean = p$pred, lower = p$ci.lb, upper = p$ci.ub) -} -## Data grouped by experimental and species TBMFDB %>% -mutate(group = paste(TPLName, Scarification, Stratification_type, -Light, Alternating, Temperature, sep = "_")) %>% -data.table(.) -> df -## First we check for which groups the metanalysis works... -listd <- split(df, by = "group", drop = TRUE) -ms <- lapply(listd, function(d) tryCatch(metanalize(d), error = function(e) e)) +ggplot(aes(x = Longitude, y = Latitude)) + +geom_polygon(data = map_data("world"), aes(x = long, y = lat, group = group), +color = "gainsboro", fill = "gainsboro") + +geom_polygon(data = TBMF, aes(x = long, y = lat,group = group), +fill = "darkolivegreen4", color = "darkolivegreen4") + +geom_point(color = "gold", size = 1.25, alpha = 0.5) + +ggthemes::theme_map() + +theme(legend.position = "none", +axis.title = element_blank()) + +coord_cartesian(xlim = c(-160, 180), ylim = c(-55, 80)) -> p1 +ggsave(p1, file = "results/Fig1.tiff", +path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) +Germination %>% +filter(Species == "Fagus sylvatica") %>% +ggplot(aes(x = as.factor(Temperature), y = mean, ymin = lower, ymax = upper, fill = Experiment)) + +geom_bar(stat = "identity", alpha = 0.6, show.legend = FALSE) + +geom_errorbar(aes(color = Experiment), width = 0.1, size = 1, +position = position_dodge(.9), show.legend = FALSE) + +facet_wrap( ~ Experiment, scales = "free", ncol = 3) + +coord_cartesian(ylim = c(0, 1)) + +ylab(label = "Germination proportion") + xlab(label = "Average germination temperature (ºC)") + +ggthemes::theme_tufte() + +theme(panel.background = element_rect(color = "grey96", fill = "grey96"), +legend.position = "none", +strip.text = element_text(size = 11), +axis.text = element_text(size = 12, face = "bold"), +axis.title = element_text(size = 14, face = "bold"), +legend.text = element_text(size = 16, face = "bold")) -> p2 +ggsave(p1, file = "results/Fig1.tiff", +path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) +ggsave(p2, file = "results/Fig2.tiff", +path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) +ggsave(p1, file = "results/Fig1.tiff", +path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) +ggsave(p2, file = "results/Fig2.tiff", +path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) +save(p1, p2, +file = here::here("results", "msfigs.RData")) +remotes::install_github('yihui/knitr') +remotes::install_github('yihui/knitr') +install.packaged("knitr") +install.packages("knitr") +install.packages("knitr") +install.packages("knitr") +install.packages("knitr") +remotes::install_github('yihui/knitr') +remotes::install_github('yihui/knitr') +install.packages("glue") +install.packages("glue") +remotes::install_github('yihui/knitr') library(tidyverse); library(here); library(sp); library(openxlsx) # Cleaning of the search string ## TPL Names from common source @@ -432,46 +481,11 @@ geom_polygon(data = map_data("world"), aes(x = long, y = lat, group = group), color = "gainsboro", fill = "gainsboro") + geom_polygon(data = TBMF, aes(x = long, y = lat,group = group), fill = "darkolivegreen4", color = "darkolivegreen4") + -geom_point(color = "gold", size = 0.75, alpha = 0.5) + -ggthemes::theme_map() + -theme(legend.position = "none", -axis.title = element_blank()) + -coord_cartesian(xlim = c(-160, 180), ylim = c(-55, 80)) -> p1 -Germination %>% -filter(Species == "Fagus sylvatica") %>% -ggplot(aes(x = as.factor(Temperature), y = mean, ymin = lower, ymax = upper, fill = Experiment)) + -geom_bar(stat = "identity", alpha = 0.6, show.legend = FALSE) + -geom_errorbar(aes(color = Experiment), width = 0.1, size = 1, -position = position_dodge(.9), show.legend = FALSE) + -facet_wrap( ~ Experiment, scales = "free", ncol = 3) + -coord_cartesian(ylim = c(0, 1)) + -ylab(label = "Germination proportion") + xlab(label = "Average germination temperature (ºC)") + -ggthemes::theme_tufte() + -theme(panel.background = element_rect(color = "grey96", fill = "grey96"), -legend.position = "none", -strip.text = element_text(size = 11, face = "bold"), -axis.text = element_text(size = 12, face = "bold"), -axis.title = element_text(size = 14, face = "bold"), -legend.text = element_text(size = 16, face = "bold")) -> p2 -ggsave(p1, file = "results/Fig1.tiff", -path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) -ggsave(p2, file = "results/Fig2.tiff", -path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) -save(p1, p2, -file = here::here("results", "msfigs.RData")) -TBMFDB %>% -ggplot(aes(x = Longitude, y = Latitude)) + -geom_polygon(data = map_data("world"), aes(x = long, y = lat, group = group), -color = "gainsboro", fill = "gainsboro") + -geom_polygon(data = TBMF, aes(x = long, y = lat,group = group), -fill = "darkolivegreen4", color = "darkolivegreen4") + geom_point(color = "gold", size = 1.25, alpha = 0.5) + ggthemes::theme_map() + theme(legend.position = "none", axis.title = element_blank()) + coord_cartesian(xlim = c(-160, 180), ylim = c(-55, 80)) -> p1 -ggsave(p1, file = "results/Fig1.tiff", -path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) Germination %>% filter(Species == "Fagus sylvatica") %>% ggplot(aes(x = as.factor(Temperature), y = mean, ymin = lower, ymax = upper, fill = Experiment)) + @@ -488,25 +502,11 @@ strip.text = element_text(size = 11), axis.text = element_text(size = 12, face = "bold"), axis.title = element_text(size = 14, face = "bold"), legend.text = element_text(size = 16, face = "bold")) -> p2 -ggsave(p1, file = "results/Fig1.tiff", -path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) -ggsave(p2, file = "results/Fig2.tiff", -path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) -ggsave(p1, file = "results/Fig1.tiff", +ggsave(p1, file = "results/Fig1.png", path = NULL, scale = 1, width = 170, height = 70, units = "mm", dpi = 600) -ggsave(p2, file = "results/Fig2.tiff", +ggsave(p2, file = "results/png.tiff", path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) save(p1, p2, file = here::here("results", "msfigs.RData")) -remotes::install_github('yihui/knitr') -remotes::install_github('yihui/knitr') -install.packaged("knitr") -install.packages("knitr") -install.packages("knitr") -install.packages("knitr") -install.packages("knitr") -remotes::install_github('yihui/knitr') -remotes::install_github('yihui/knitr') -install.packages("glue") -install.packages("glue") -remotes::install_github('yihui/knitr') +ggsave(p2, file = "results/Fig2.png", +path = NULL, scale = 1, width = 170, height = 150, units = "mm", dpi = 600) diff --git a/doc/manuscript.Rmd b/doc/manuscript.Rmd index 2514daa..a274324 100644 --- a/doc/manuscript.Rmd +++ b/doc/manuscript.Rmd @@ -1,6 +1,6 @@ --- title: "SylvanSeeds, a seed germination database for temperate deciduous forests" -output: github_document +output: pdf_document bibliography: refs.bib csl: journal-of-vegetation-science.csl link-citations: yes @@ -25,6 +25,8 @@ load(here("results", "msfigs.RData")) **Author:** Eduardo Fernández-Pascual **Institutional address:** Departamento de Biología de Organismos y Sistemas, Universidad de Oviedo, C/ Catedrático Rodrigo Uría, 33006 Oviedo/Uviéu, Spain **Email:** efernandezpascual@gmail.com **Telephone:** +34985104787 +*This is the peer reviewed version of the following article: Fernández-Pascual, E. (2020). SylvanSeeds, a seed germination database for temperate deciduous forests. Journal of Vegetation Science, which has been published in final form at https://doi.org/10.1111/jvs.12960.* + # Abstract Seed traits have functional significance in all levels of plant biology, but there is a lack of germination databases of wide geographical scope. This report presents *SylvanSeeds* (https://efernandezpascual.github.io/home/sylvanseeds.html), a first global database of germination records for an ecologically coherent unit: Temperate Broadleaf and Mixed Forests. Data were gathered with a systematic literature search. A list of frequent taxa of the study area was created using `r MSplots` vegetation relevés from the sPlot database. The list was searched in the Web of Science. 6,791 references were screened, finding 555 articles from which data were extracted. *SylvanSeeds* includes `r MSrecords` germination records of `r MSspecies` species from `r MSfamilies` families (gymnosperms and angiosperms), collected in 46 countries between 1920-2017. It provides raw data for meta-analysis: proportions of seeds germinated in laboratory experiments of scarification, stratification, light-darkness, and constant-alternating temperatures. *SylvanSeeds* is freely distributed as a *.csv*. A shiny web app is also presented, to make data accessible to the public. *SylvanSeeds* advances functional seed ecology and brings two innovations to plant science. First, the data-gathering methodology can be extended to other biomes. Second, database and app can be a standard in further efforts to compile germination data. @@ -63,8 +65,8 @@ For each relevant reference, three blocks of information were recorded. The firs The final database contains `r MSrecords` records (germination proportions for a given seed lot of a species, recorded in a set of experimental conditions) from 555 references. The plant materials had been collected across the Temperate Broadleaf and Mixed Forest biome and surrounding areas (**Fig. 1**), in both hemispheres. Although the frequent species list was created using only relevés from the northern hemisphere, the web search of germination articles found studies of those species that had been performed in the southern hemisphere. These records are included in the database, and their geographical origin is reported. The oldest record was from 1920 and the top three contributing countries were the USA (`r MScountries[1, 2]`), the UK (`r MScountries[2, 2]`) and Japan (`r MScountries[3, 2]`). There were `r MSspecies` species represented, from `r MSfamilies` seed plant families. The total estimate of seeds used in the experiments was `r MSseeds`. The range of germination temperatures (weighted average of the daily thermoperiod) went from `r MSminT` to `r MSmaxT` ºC, with `r MSaltY` records of constant temperatures and `r MSaltN` of alternating temperatures. Light was used in `r MSlightY` records, darkness in `r MSlightN` and `r MSlightNA` did not provide information on this parameter. The experiments were performed with unstratified seeds in `r MSstratN` records, and of the rest, the majority (`r MSstratCold`) went through cold stratification. Scarification was applied to `r MSscarY` records. -```{r fig1, echo = FALSE, message = FALSE, warning = FALSE, fig.pos = "H", fig.cap = "**Figure 1** *Geographical distribution of the germination records in the database. Each golden circle is a record. The green areas correspond to the extension of the Temperate Broadleaf and Mixed Forests biome according to the *WWF*.*", fig.width=7, fig.height=3} -knitr::include_graphics("../results/Fig1.png") +```{r fig1, echo = FALSE, message = FALSE, warning = FALSE, fig.cap = "Geographical distribution of the germination records in the database. Each golden circle is a record. The green areas correspond to the extension of the Temperate Broadleaf and Mixed Forests biome according to the WWF.", fig.width=7, fig.height=3} +p1 ``` ## Database file @@ -75,8 +77,8 @@ The database is provided as a *csv* file, comma separated [(**Appendix S5**)](ht To facilitate the visualization of the database, the *SylvanSeeds* app was written using the *shiny* package [@RN4661]. It is publicly accessible at https://efernandezpascual.shinyapps.io/sylvanseeds/. The app uses the *tidyverse* package [@RN4662] to aggregate and show results for species and experimental treatments (i.e. aggregating all seed lots of the same species germinated in the same experimental conditions). To facilitate comparisons, germination temperatures are aggregated to 5 ºC intervals. When there is only one seed lot per species and combination of experimental conditions, the binomial 95% confidence interval is calculated using the Wilson method in the *binom* package [@RN2964]. When there is more than one seed lot per species and combination of experimental conditions, the aggregate proportion and binomial confidence intervals are calculated using binomial-normal meta-analysis models [@RN4663] as implemented in the package *metafor* [@RN2274]. By visiting the app, users can consult the available germination information for a species (**Fig. 2**), the origin of its seed lots, and the bibliographical references for the species. -```{r fig2, echo = FALSE, fig.pos = "H", fig.cap = "**Figure 2** *Example of the germination records as shown by the SylvanSeeds app. Records for one species, the European common beech, Fagus sylvatica. Each panel shows the results for a combination of experimental conditions, with the germination temperature varying within each panel. Bars represent the mean germination proportion and brackets the 95% binomial confidence interval.*", fig.width=7, fig.height=5} -knitr::include_graphics("../results/Fig2.png") +```{r fig2, echo = FALSE, fig.cap = "Example of the germination records as shown by the SylvanSeeds app. Records for one species, the European common beech, Fagus sylvatica. Each panel shows the results for a combination of experimental conditions, with the germination temperature varying within each panel. Bars represent the mean germination proportion and brackets the 95% binomial confidence interval.", fig.width=7, fig.height=5} +p2 ``` # Discussion diff --git a/doc/manuscript_files/figure-gfm/fig1-1.png b/doc/manuscript_files/figure-gfm/fig1-1.png deleted file mode 100644 index 82f6df5..0000000 Binary files a/doc/manuscript_files/figure-gfm/fig1-1.png and /dev/null differ diff --git a/doc/manuscript_files/figure-gfm/fig2-1.png b/doc/manuscript_files/figure-gfm/fig2-1.png deleted file mode 100644 index afe96bd..0000000 Binary files a/doc/manuscript_files/figure-gfm/fig2-1.png and /dev/null differ