-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.qmd
130 lines (94 loc) · 2.86 KB
/
test.qmd
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
---
title: "PhyDo"
format:
html
embed-resources:
true
params:
taxon: Tyto
all_results: NA
---
```{r, include=FALSE, echo=FALSE}
library(DT)
library(magrittr)
library(tidyverse)
library(htmlwidgets)
library(formattable)
library(leaflet)
all_results <- jsonlite::unserializeJSON(params$all_results)
```
# Taxon `r params$taxon`
## Wikipedia summary
`r all_results$wikipedia_summary`
Here is an image from Wikipedia:
<img src='`r all_results$wikipedia_pics[1]`' alt='Image of `r params$taxon` from Wikipedia'>
## Traits from Encylopedia of Life
```{r, echo=FALSE}
traits <- phydo:::eol_traits2(all_results$eol)
datatable(traits, rownames=FALSE)
```
## OpenTree
Taxon **`r params$taxon`** has `r all_results$otol$ntaxa` terminal taxa in OpenTree. This is based on taxonomy plus `r nrow(all_results$otol$studies)` studies.
```{r, echo=FALSE}
if(nrow(all_results$otol$studies)>0) {
# pander::pander(all_results$otol$studies, split.table = Inf)
datatable(all_results$otol$studies, rownames=FALSE)
}
```
## Datelife
```{r, echo=FALSE}
if(inherits(all_results$datelife_biggest, "phylo")) {
plot(all_results$datelife_biggest)
ape::axisPhylo()
} else {
print("Datelife did not contain a tree")
}
```
## GenBank
In GenBank, there are `r all_results$genbank_count` species listed for this group.
```{r, echo=FALSE}
pander::pander(data.frame(seqs=all_results$genbank_count_by_gene))
```
## PubMed
There are `r all_results$pubmed$count` articles that match `r params$taxon` AND phylogeny on PubMed. Here are the most recent.
```{r, echo=FALSE}
pubmed.df <- all_results$pubmed$recent.papers
if(nrow(pubmed.df)>0) {
pubmed.df <- pubmed.df[order(pubmed.df$Date, decreasing=TRUE),]
datatable(pubmed.df)
}
```
## Map
```{r, echo=FALSE}
location_info <- all_results$location_realm_biome$locations
#location_info$lat <- location_info$latitude
#location_info$lng <- location_info$longitude
m = leaflet(location_info) |> addTiles() |> addProviderTiles(providers$Stamen.Terrain)
m |> addMarkers(
clusterOptions = markerClusterOptions()
)
```
## Realm
Here is information about realms (biogeographic regions) by species; frequency of record in each realm.
```{r, echo=FALSE}
realm <- all_results$location_realm_biome$realm
for (i in sequence(nrow(realm))) {
realm[i,] <- realm[i,]/sum(realm[i,], na.rm=TRUE)
}
datatable(data.frame(realm))
```
## Biome
Here is information about biomes by species; frequency of records in each biome, using formattable
```{r, echo=FALSE}
biome <- all_results$location_realm_biome$biome
for (i in sequence(nrow(biome))) {
biome[i,] <- biome[i,]/sum(biome[i,], na.rm=TRUE)
}
biome <- round(100*biome,1)
myForm <- function(x) {
color_tile("white", "orange")
}
biome_df <- data.frame(biome)
colnames(biome_df) <- gsub("\\.", " ", (gsub('\\.\\.', ', ', gsub('\\.\\.\\.', " and ", colnames(biome_df)))))
formattable(biome_df, lapply(biome_df, myForm))
```