forked from GuangchuangYu/cv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
391 lines (263 loc) · 8.19 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
---
title: "Guangchuang Yu's CV"
author: Guangchuang Yu
date: "`r Sys.Date()`"
output:
pagedown::html_resume:
css: ['styles.css']
# set it to true for a self-contained HTML page but it'll take longer to render
self_contained: true
---
```{r, include=FALSE}
knitr::opts_chunk$set(
results='asis',
echo = FALSE
)
CRANpkg <- function (pkg) {
cran <- "https://CRAN.R-project.org/package"
fmt <- "[%s](%s=%s)"
sprintf(fmt, pkg, cran, pkg)
}
Biocpkg <- function (pkg) {
sprintf("[%s](http://bioconductor.org/packages/%s)", pkg, pkg)
}
library(glue)
library(tidyverse)
# Set this to true to have links turned into footnotes at the end of the document
PDF_EXPORT <- FALSE
# Holds all the links that were inserted for placement at the end
links <- c()
find_link <- regex("
\\[ # Grab opening square bracket
.+? # Find smallest internal text as possible
\\] # Closing square bracket
\\( # Opening parenthesis
.+? # Link text, again as small as possible
\\) # Closing parenthesis
",
comments = TRUE)
sanitize_links <- function(text){
if(PDF_EXPORT){
str_extract_all(text, find_link) %>%
pluck(1) %>%
walk(function(link_from_text){
title <- link_from_text %>% str_extract('\\[.+\\]') %>% str_remove_all('\\[|\\]')
link <- link_from_text %>% str_extract('\\(.+\\)') %>% str_remove_all('\\(|\\)')
# add link to links array
links <<- c(links, link)
# Build replacement text
new_text <- glue('{title}<sup>{length(links)}</sup>')
# Replace text
text <<- text %>% str_replace(fixed(link_from_text), new_text)
})
}
text
}
# Takes a single row of dataframe corresponding to a position
# turns it into markdown, and prints the result to console.
build_position_from_df <- function(pos_df){
missing_start <- pos_df$start == 'N/A'
dates_same <- pos_df$end == pos_df$start
if (pos_df$end == 9999) {
pos_df$end = "present"
}
if(any(c(missing_start,dates_same))){
timeline <- pos_df$end
} else {
timeline <- glue('{pos_df$end} - {pos_df$start}')
}
descriptions <- pos_df[str_detect(names(pos_df), 'description')] %>%
as.list() %>%
map_chr(sanitize_links)
# Make sure we only keep filled in descriptions
description_bullets <- paste('-', descriptions[descriptions != 'N/A'], collapse = '\n')
if (length(description_bullets) == 1 && description_bullets == "- ") {
description_bullets <- ""
}
glue(
"### {sanitize_links(pos_df$title)}
{pos_df$loc}
{pos_df$institution}
{timeline}
{description_bullets}
"
) %>% print()
}
# Takes nested position data and a given section id
# and prints all the positions in that section to console
print_section <- function(position_data, section_id){
x <- position_data %>%
filter(section == section_id) %>%
pull(data)
prese <- " - "
xx <- list()
for (i in seq_along(x)) {
y = x[[i]]
y <- cbind(y, start2 = as.character(y$start))
y <- cbind(y, end2 = as.character(y$end))
se <- paste(y$start, "-", y$end, collapse = " ")
if (prese == se) {
y$start2 = ""
y$end2 = ""
} else {
prese = se
}
xx[[i]] <- select(y, -c(start, end)) %>%
rename(start=start2, end=end2)
}
xx %>%
purrr::walk(build_position_from_df)
}
fill_nas <- function(column){
ifelse(is.na(column), 'N/A', column)
}
# Load csv with position info
position_data <- read_csv('positions.csv') %>%
mutate_all(fill_nas) %>%
arrange(order, desc(end)) %>%
mutate(id = 1:n()) %>%
nest(data = c(-id, -section))
```
```{r}
# When in export mode the little dots are unaligned, so fix that.
if(PDF_EXPORT){
cat("
<style>
:root{
--decorator-outer-offset-left: -6.5px;
}
</style>")
}
```
Aside
================================================================================
![logo](ygc.jpg){width=100%}
```{r}
# When in export mode the little dots are unaligned, so fix that.
if(PDF_EXPORT){
cat("View this CV online with links at _guangchuangyu.github.io/cv_")
}
```
Contact {#contact}
--------------------------------------------------------------------------------
- <i class="fa fa-envelope"></i> [email protected]
- <i class="fa fa-twitter"></i> guangchuangyu
- <i class="fa fa-github"></i> github.com/GuangchuangYu
- <i class="fa fa-link"></i> guangchuangyu.github.io
- <i class="fa fa-weixin"></i> biobabble
- <i class="fa fa-phone"></i> (86) 13826432521
Selected R packages {#skills}
--------------------------------------------------------------------------------
NGS
- ChIPseeker
Ontology
- clusterProfiler
- DOSE
- enrichplot
- GOSemSim
Phylogeny
- tidytree
- treeio
- ggtree
Visualization
- ggimage
- ggplotify
- seqcombo
Disclaimer {#disclaimer}
--------------------------------------------------------------------------------
Last updated on `r Sys.Date()`.
Main
================================================================================
Guangchuang Yu {#title}
--------------------------------------------------------------------------------
```{r, results='asis'}
intro_text <- glue("Professor of Bioinformatics at [Southern Medical University](http://www.smu.edu.cn/). I have developed more than 20 R packages, including ",
{Biocpkg("clusterProfiler")}, ", ",
{Biocpkg("ChIPseeker")}, ", ",
{Biocpkg("treeio")}, " and ",
{Biocpkg("ggtree")},
", to help biologists to explore and understand their data.")
cat(sanitize_links(intro_text))
```
I am broadly interested in bioinformatics, metagenomics, molecular evolution, data integration and visualization.
Research Experience {data-icon=laptop}
--------------------------------------------------------------------------------
```{r, results='asis', echo = FALSE}
print_section(position_data, 'research_positions')
```
Education {data-icon=graduation-cap data-concise=true}
--------------------------------------------------------------------------------
```{r, results='asis', echo = FALSE}
print_section(position_data, 'education')
```
Certificate {data-icon=book}
--------------------------------------------------------------------------------
```{r, results='asis', echo = FALSE}
print_section(position_data, 'certificate')
```
Teaching Experience {data-icon=chalkboard-teacher}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'teaching_positions')
```
Grants {data-icon=chart-line}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'grant')
```
Books {data-icon=book}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'book_chapters')
```
::: aside
```{r}
profile = jsonlite::fromJSON("profile.json")
cites = jsonlite::fromJSON("citation.json")
if (profile$total_cites < sum(cites$cites))
profile$total_cites <- sum(cites$cites)
glue(
"
+ Citation = {profile$total_cites}
+ H-index = {profile$h_index}
+ I10-index = {profile$i10_index}
"
) %>% print()
```
![](citation.png)
![](figures/10th-anniversary-logo-2.png){width=100%}
```{r}
ggtree <- "ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data"
url <- 'http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12628/abstract'
ggtree2 <- glue("[{ggtree}]({url})")
journal <- "**_Methods in Ecology and Evolution_**"
url2 <- "to be updated"
glue(
"
Our article {ggtree2} was selected to highlight to celebrate the 10th anniversary of the launch of {journal}.
url: {url2}
"
) %>% print()
```
:::
Publications {data-icon=book}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'academic_articles')
```
Conference proceedings {data-icon=group}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'presentation')
```
```{r}
if(PDF_EXPORT){
cat("
Links {data-icon=link}
--------------------------------------------------------------------------------
")
walk2(links, 1:length(links), function(link, index){
print(glue('{index}. {link}'))
})
}
```