Skip to content

Commit a6c2fb3

Browse files
committed
Add Freyja barcode timestamp in report
1 parent e710629 commit a6c2fb3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

template.qmd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ params:
4242
heat_tab: ""
4343
omega_plot: ""
4444
name: ""
45+
freyja_ts: ""
4546
output-file: report.html
4647
---
4748
<head>
@@ -100,6 +101,11 @@ if (params$use_bionj) {
100101
} else {
101102
dist.tree.algo <- "neighbor-joining (NJ)"
102103
}
104+
105+
# Freyja timestamp
106+
freyja.timestamp <- read_file(params$freyja_ts) %>%
107+
as.POSIXct(., format = "%m_%d_%Y-%H-%M") %>%
108+
strftime(., format = "%d %B %Y at %H:%M")
103109
```
104110

105111
## Summary of the target samples dataset
@@ -141,10 +147,10 @@ table %>%
141147

142148
### Lineage admixture
143149

144-
The estimated lineage admixture for each sample has been calculated
150+
The lineage admixture for each sample has been estimated
145151
using [Freyja](https://github.com/andersen-lab/Freyja).
146152

147-
![Estimated lineage admixture of each sample.
153+
![Estimated lineage admixture of each sample (Freyja barcode timestamp: `r freyja.timestamp`).
148154
Samples in the X-axis are ordered chronologically, from more ancient to newer.](`r params$freyja`){#fig-freyja}
149155

150156
### Phylogenetic reconstruction

workflow/rules/report.smk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,19 @@ rule report:
188188
heat_table = report(REPORT_DIR_TABLES/"figure_10.csv"),
189189
evo = report(REPORT_DIR_PLOTS/"figure_11.png"),
190190
omega_plot = report(REPORT_DIR_PLOTS/"figure_12.png"),
191+
freyja_ts = OUTDIR/"demixing"/"freyja_data"/"last_barcode_update.txt",
191192
value = OUTDIR/"diversity.json",
192193
stats_lm = OUTDIR/"stats.lm.json",
193194
table = OUTDIR/"summary_table.csv",
194-
sum_nv = OUTDIR/"summary_nv.json"
195+
sum_nv = OUTDIR/"summary_nv.json",
195196
params:
196197
workflow_version = get_repo_version(BASE_PATH.as_posix(), __version__),
197198
min_ivar_freq = config["VC"]["IVAR_FREQ"],
198199
ufboot_reps = config["UFBOOT_REPS"],
199200
shalrt_reps = config["SHALRT_REPS"],
200201
name = config["OUTPUT_NAME"],
201202
use_bionj = config["USE_BIONJ"],
202-
cor_method = config["COR"]["METHOD"]
203+
cor_method = config["COR"]["METHOD"],
203204
output:
204205
html = report(OUTDIR/f"{OUTPUT_NAME}.report.html")
205206
log:
@@ -233,6 +234,7 @@ rule report:
233234
"sum_nv = '{input.sum_nv}', "
234235
"heat_tab = '{input.heat_table}', "
235236
"omega_plot = '{input.omega_plot}', "
237+
"freyja_ts = '{input.freyja_ts}', "
236238
"name = '{params.name}'))\" "
237-
">{log} 2>&1 && "
239+
">{log:q} 2>&1 && "
238240
'mv "$(dirname {input.qmd:q})/report.html" {output.html:q}'

0 commit comments

Comments
 (0)