Skip to content

Commit 9b99d3c

Browse files
committed
Include distance tree method in report
1 parent 61ce723 commit 9b99d3c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

template.qmd

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ params:
2222
shalrt_reps: ""
2323
min_ivar_freq: ""
2424
workflow_version: ""
25+
use_bionj: ""
2526
div: ""
2627
freyja: ""
2728
tree: ""
@@ -82,6 +83,13 @@ row.names(vcf) <- vcf$`...1`
8283
vcf <- vcf[-1]
8384
cor.mat <- cor(vcf)
8485
cor.mat[is.na(cor.mat)] <- 0
86+
87+
# Distance tree
88+
if (params$use_bionj) {
89+
dist.tree.algo <- "BIONJ (modified neighbor-joining)"
90+
} else {
91+
dist.tree.algo <- "neighbor-joining (NJ)"
92+
}
8593
```
8694

8795
## Summary of the target samples dataset
@@ -221,11 +229,11 @@ nucleotide variants with a significant correlation with time and sites with more
221229
than two possible states. Each subplot depicts the progression of the allele
222230
frequencies in time for a given genome position.](`r params$panel`){#fig-panel}
223231

224-
A neighbor-joining tree has been constructed using pairwise distances
232+
A `r dist.tree.algo` tree has been constructed using pairwise distances
225233
between target samples (@fig-tree), based on the allele frequencies measured from
226234
read mappings.
227235

228-
![Neighbor-joining tree based on the pairwise allele
236+
![Distance tree built with the `r dist.tree.algo` method based on the pairwise allele
229237
frequency-weighted distances.](`r params$tree`){#fig-tree}
230238

231239
To estimate the evolutionary rate, root-to-tip distances measured on the previous

workflow/rules/report.smk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ rule report:
195195
min_ivar_freq = config["VC"]["IVAR_FREQ"],
196196
ufboot_reps = config["UFBOOT_REPS"],
197197
shalrt_reps = config["SHALRT_REPS"],
198-
name = config["OUTPUT_NAME"]
198+
name = config["OUTPUT_NAME"],
199+
use_bionj = config["USE_BIONJ"]
199200
output:
200201
html = report(OUTDIR/f"{OUTPUT_NAME}.report.html")
201202
log:
@@ -209,6 +210,7 @@ rule report:
209210
shalrt_reps='{params.shalrt_reps}',\
210211
min_ivar_freq='{params.min_ivar_freq}',\
211212
workflow_version='{params.workflow_version}',\
213+
use_bionj='{params.use_bionj}',\
212214
div='{input.diversity}',\
213215
freyja ='{input.freyja}',\
214216
tree = '{input.tree}',\

0 commit comments

Comments
 (0)