-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.Rmd
executable file
·302 lines (212 loc) · 7.63 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
---
title: "Tao Yan's Resume"
author: Tao Yan
date: "`r Sys.Date()`"
# params:
# pdf_mode:
# value: true
# cache_data:
# value: true
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 <- openxlsx::read.xlsx('positions.xlsx',sheet = 1) %>%
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](taoyan.jpg){width=100%}
<a href="https://taoyan.netlify.app/pdf/CV.pdf" target="_blank"><i class='fas fa-download'></i> Download a PDF of this CV</a>
Contact {#contact}
--------------------------------------------------------------------------------
- <i class="fa fa-envelope"></i> [email protected]
- <i class="fa fa-twitter"></i> <a href="https://twitter.com/TaoYANLogos" target="_blank">TaoYan</a>
- <i class="fa fa-github"></i> <a href="https://github.com/YTLogos" target="_blank">github.com/YTLogos</a>
- <i class="fa fa-link"></i> <a href="https://taoyan.netlify.app/" target="_blank">taoyan.netlify.app</a>
- <i class="fa fa-weixin"></i> yt056410
- <i class="fa fa-phone"></i> (86) 13372566428
<br>
```{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)](https://scholar.google.com/citations?hl=en&user=8p3wQNwAAAAJ) -->
<a href="https://scholar.google.com/citations?hl=en&user=8p3wQNwAAAAJ" target="_blank"><img src="citation.png" /></a>
<!-- Disclaimer {#disclaimer} -->
<!-- -------------------------------------------------------------------------------- -->
Last updated on `r Sys.Date()`.
Main
================================================================================
Tao Yan(严涛) {#title}
--------------------------------------------------------------------------------
```{r, results='asis'}
intro_text <- glue("Lecturer at College of Agronomy, Hunan Agricultural University (HUNAU), Changsha, China. My Ph.D research work covers a range of issues: Population Genetics Evolution and Ecotype Divergence Analysis of *Brassica napus*, Genome-wide Association Study (GWAS) of Agronomic Traits. Currently, I am interested in Transposable Elements Insertion Polymorphisms (TIPs) in Crop Population and genetic basis such as SV, CNV and TIPs etc. Now my research focus on Crop Stress and Improvement.")
cat(sanitize_links(intro_text))
```
I am broadly interested in bioinformatics, 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')
```
Scholarships & Awards {data-icon=trophy}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'award')
```
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}'))
})
}
```