-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
162 lines (152 loc) · 4.14 KB
/
index.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
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
---
title: "MOLB 7950: Informatics and Statistics for Molecular Biology"
format:
html:
theme:
light: [cosmo, style/quarto-main.scss]
dark: [cosmo, style/dark.scss, style/quarto-main.scss]
mainfont: "Atkinson Hyperlegible"
code-copy: true
code-overflow: wrap
toc: true
---
This page contains an outline of the topics, content, and assignments for the semester. Note that this schedule will be updated as the semester progresses, with all changes documented here.
```{r}
#| label: render_schedule_table
#| echo: false
#| message: false
#| warning: false
library(tidyverse)
library(fs)
library(glue)
library(gt)
library(here)
library(emo)
library(yaml)
params <- yaml::read_yaml(here("_variables.yml"))
qmd_exists <- function(path) {
path <- path_ext_set(here(path), ".qmd")
file_exists(path)
}
sched_tbl <- read_tsv(here("data/syllabus.tsv")) |>
mutate(
date = ymd(date),
class_num = row_number()
) |>
mutate(
block_num = row_number(),
block_num = str_pad(block_num, 2, "left", "0"),
.by = c(block, topic)
) |>
arrange(date) |>
mutate(
# set up dates / weeks
class_num = str_pad(class_num, 2, "left", "0"),
week = isoweek(date),
week = week - min(week) + 1,
week = str_c("Week ", week),
across(
c(block, topic, instructor, title),
~ replace_na(.x, "-")
),
# set up paths
common_dir = path("content", str_to_lower(block), str_to_lower(topic)),
prepare_html = path("prepare", glue("prepare-{class_num}.html")),
slides_html = path("slides", glue("slides-{class_num}.html")),
ex_html = path("exercises", glue("ex-{class_num}.html")),
hw_html = path("problem-sets", glue("ps-{class_num}.html")),
hw_key_html = path("problem-set-keys", glue("ps-key-{class_num}.html")),
# set up links
prepare_link = case_when(
qmd_exists(prepare_html) == TRUE ~ glue('[{emo::ji("book")}]({prepare_html})'),
.default = "."
),
prepare_link = map(prepare_link, gt::md),
slides_link = case_when(
qmd_exists(slides_html) == TRUE ~ glue('[{emo::ji("page")}]({slides_html})'),
.default = "."
),
slides_link = map(slides_link, gt::md),
# exercises links
ex_link = case_when(
qmd_exists(ex_html) == TRUE ~ glue('[{emo::ji("biceps")}]({ex_html})'),
.default = "."
),
ex_link = map(ex_link, gt::md),
# problem sets links
hw_link = case_when(
qmd_exists(hw_html) == TRUE ~ glue('[{emo::ji("brain")}]({hw_html})'),
.default = "."
),
hw_link = map(hw_link, gt::md),
# problem set keys links
hw_key_link = case_when(
qmd_exists(hw_key_html) == TRUE ~ glue('[{emo::ji("key")}]({hw_key_html})'),
.default = "."
),
hw_key_link = map(hw_key_link, gt::md)
)
```
```{r}
#| label: render-table
#| echo: false
#| column: screen-inset-right
gt(
sched_tbl,
groupname_col = "week",
rowname_col = "class_num"
) |>
tab_header(
title = md(glue("**MOLB 7950 - {params$course$semester} Schedule**")),
subtitle = glue("Classes held in-person from {params$course$time}")
) |>
fmt_date(
columns = date,
date_style = "wd_m_day_year"
) |>
cols_label(
# class = md("**Class**"),
date = md("**Date**"),
location = md("**Location**"),
block = md("**Block**"),
topic = md("**Topic**"),
title = md("**Title**"),
instructor = md("**Instructor**"),
prepare_link = md("**Prepare**"),
# page_link = md("**Page**"),
slides_link = md("**Slides**"),
ex_link = md("**Exercises**"),
hw_link = md("**HW**"),
hw_key_link = md("**Key**")
) |>
cols_hide(
c(ends_with("_html"), ends_with("_dir"), block_num)
) |>
tab_spanner(
label = md("**Links**"),
columns = ends_with("_link")
) |>
opt_table_font(
font = google_font("Atkinson Hyperlegible")
) |>
tab_style(
style = list(
cell_text(align = "center")
),
locations = cells_row_groups()
) |>
tab_options(
table.width = pct(100),
quarto.use_bootstrap = TRUE
) |>
tab_style(
style = list(
cell_fill("grey90")
),
locations = cells_row_groups()
) |>
opt_row_striping() |>
cols_align(
align = "center"
)
```