-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ideas on report contents from meeting
- Loading branch information
1 parent
8d9e6eb
commit 34ac138
Showing
12 changed files
with
310 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Spatial distribution | ||
|
||
Color by: | ||
* sample metadata | ||
* time isolated/submitted | ||
* gene content | ||
* relatedness |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Quality control | ||
|
||
* A quick indicator of status of each step. | ||
|
||
## Input data quality | ||
|
||
* multiqc link | ||
|
||
## Downloaded references | ||
|
||
* quast | ||
* table with rows for each sample with info on references chosen | ||
- sample id | ||
- reference id | ||
- ANI between sample and reference | ||
* table with one row per reference (taxon id, GSA id, classification, link to ncbi) | ||
* sourmash output (tree?) | ||
|
||
## Assembly and annotation | ||
|
||
* depth of coverage | ||
* quast link | ||
* BUSCO gene content? | ||
* bakta output? | ||
|
||
## Variant calling? | ||
|
||
* vcfr for plots | ||
* iqtree model selection, number of informative sites, indels | ||
|
||
## Core genome phylogeny | ||
|
||
* core gene info (how many genes, length, paralogs) | ||
* outlier samples causing few genes to be chosen | ||
* iqtree model selection, number of informative sites, indels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
## Software used | ||
|
||
|
||
```{r include=FALSE} | ||
# automatically create a bib database for R packages | ||
knitr::write_bib(c( | ||
.packages(), 'bookdown', 'knitr', 'rmarkdown' | ||
), 'packages.bib') | ||
``` | ||
|
||
|
||
`r if (knitr::is_html_output()) ' | ||
# References {-} | ||
'` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
--- | ||
title: "Pathogensurveillance Report" | ||
date: "`r Sys.Date()`" | ||
site: bookdown::bookdown_site | ||
documentclass: book | ||
bibliography: [book.bib, packages.bib] | ||
# url: your book url like https://bookdown.org/yihui/bookdown | ||
# cover-image: path to the social sharing image like images/cover.jpg | ||
description: | | ||
A report generated by the Pathogensurveillance genome analysis pipeline. | ||
link-citations: yes | ||
github-repo: rstudio/bookdown-demo | ||
params: | ||
samp_data: "/media/fosterz/external_primary/files/projects/work/current/pathogensurveillance/test/data/metadata_medium.csv" | ||
ref_data: "/media/fosterz/external_primary/files/projects/work/current/pathogensurveillance/work/60/71f547293aa5d22f469ea3ee215581/merged_assembly_stats.tsv" | ||
snp_phylos: "/media/fosterz/external_primary/files/projects/work/current/pathogensurveillance/work/60/71f547293aa5d22f469ea3ee215581/xan_test_22_331_assembly.treefile" | ||
ani_matrix: "/media/fosterz/external_primary/files/projects/work/current/pathogensurveillance/work/60/71f547293aa5d22f469ea3ee215581/comp.csv" | ||
core_phylo: "/media/fosterz/external_primary/files/projects/work/current/pathogensurveillance/work/60/71f547293aa5d22f469ea3ee215581/xan_test.treefile" | ||
--- | ||
|
||
# Run info | ||
|
||
This is the first page a user sees. | ||
What should go here? | ||
|
||
## Input settings | ||
|
||
## Software used | ||
|
||
|
||
```{r include=FALSE} | ||
# automatically create a bib database for R packages | ||
knitr::write_bib(c( | ||
.packages(), 'bookdown', 'knitr', 'rmarkdown' | ||
), 'packages.bib') | ||
``` | ||
|
||
<!--chapter:end:index.Rmd--> | ||
|
||
# Identification | ||
|
||
```{r include=FALSE, eval=FALSE} | ||
work_dir = "/media/fosterz/external_primary/files/projects/work/current/nf-core-plantpathsurveil/work/60/71f547293aa5d22f469ea3ee215581" | ||
params = list( | ||
samp_data = "metadata_medium.csv", | ||
ref_data = "merged_assembly_stats.tsv", | ||
snp_phylos = list("xan_test_22_331_assembly.treefile"), | ||
ani_matrix = "comp.csv", | ||
core_phylo = "xan_test.treefile" | ||
) | ||
params = lapply(params, function(x) file.path(work_dir, x)) | ||
``` | ||
|
||
|
||
```{r id_setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = FALSE, fig.width = 10, warning = FALSE) | ||
``` | ||
|
||
```{r id_libraries} | ||
library(phylocanvas) | ||
library(ape) | ||
library(magrittr) | ||
``` | ||
|
||
```{r id_parse_inputs} | ||
ref_meta <- read.csv(params$ref_data, sep = '\t') | ||
ref_meta$modified_id <- gsub(ref_meta$LastMajorReleaseAccession, pattern = ".", replacement = "_", fixed = TRUE) | ||
samp_meta <- read.csv(params$samp_data, sep = ',') | ||
samp_meta$modified_id <- paste0(gsub(samp_meta$sample, pattern = "-", replacement = "_", fixed = TRUE), "_T1") | ||
ani_matrix <- read.csv(params$ani_matrix, sep = ',', check.names = FALSE) | ||
core_tree <- ape::read.tree(params$core_phylo) | ||
snp_trees <- ape::read.tree(params$snp_phylos) | ||
``` | ||
|
||
|
||
## Initial ANI tree | ||
|
||
|
||
## Core genome phylogeny | ||
|
||
|
||
```{r id_core_phylo, fig.height = 7, eval = ! is.null(core_tree)} | ||
# Identify which tips are samples and references | ||
sample_ids <- core_tree$tip.label[core_tree$tip.label %in% samp_meta$modified_id] | ||
# Root tree | ||
colnames(ani_matrix) <- gsub(colnames(ani_matrix), pattern = "[.-]", replacement = "_") | ||
rownames(ani_matrix) <- colnames(ani_matrix) | ||
group_ani <- ani_matrix[rownames(ani_matrix) %in% core_tree$tip.label, colnames(ani_matrix) %in% core_tree$tip.label] | ||
core_tree <- root(core_tree, names(which.min(colMeans(group_ani[sample_ids, ])))) | ||
# Set tip labels to taxon names for reference sequences | ||
# TODO: need a more reliable way to get IDs | ||
name_key <- c( | ||
ref_meta$Organism, | ||
samp_meta$sample | ||
) | ||
names(name_key) <- c( | ||
ref_meta$modified_id, | ||
samp_meta$modified_id | ||
) | ||
core_tree$tip.label <- name_key[core_tree$tip.label] | ||
# Plot tree | ||
phycanv <- phylocanvas(core_tree, treetype = "rectangular", alignlabels = T, showscalebar = T, width = "100%") | ||
for (x in name_key[sample_ids]) { | ||
phycanv <- style_node(phycanv, x, labelcolor = "green", labeltextsize = 30) | ||
} | ||
phycanv | ||
``` | ||
|
||
```{asis id_no_core_phylo, echo = is.null(core_tree)} | ||
There is no tree to draw, probably because there were too few samples. | ||
More info will be added later. | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
<!--chapter:end:01-identification.Rmd--> | ||
|
||
# Diversity | ||
|
||
```{r include=FALSE, eval=FALSE} | ||
work_dir = "/media/fosterz/external_primary/files/projects/work/current/nf-core-plantpathsurveil/work/60/71f547293aa5d22f469ea3ee215581" | ||
params = list( | ||
samp_data = "metadata_medium.csv", | ||
ref_data = "merged_assembly_stats.tsv", | ||
snp_phylos = list("xan_test_22_331_assembly.treefile"), | ||
ani_matrix = "comp.csv", | ||
core_phylo = "xan_test.treefile" | ||
) | ||
params = lapply(params, function(x) file.path(work_dir, x)) | ||
``` | ||
|
||
|
||
```{r div_setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = FALSE, fig.width = 10, warning = FALSE) | ||
``` | ||
|
||
```{r div_libraries} | ||
library(phylocanvas) | ||
library(ape) | ||
``` | ||
|
||
```{r div_parse_inputs} | ||
ref_meta <- read.csv(params$ref_data, sep = '\t') | ||
ref_meta$modified_id <- gsub(ref_meta$LastMajorReleaseAccession, pattern = ".", replacement = "_", fixed = TRUE) | ||
samp_meta <- read.csv(params$samp_data, sep = ',') | ||
samp_meta$modified_id <- paste0(gsub(samp_meta$sample, pattern = "-", replacement = "_", fixed = TRUE), "_T1") | ||
ani_matrix <- read.csv(params$ani_matrix, sep = ',', check.names = FALSE) | ||
core_tree <- ape::read.tree(params$core_phylo) | ||
snp_trees <- ape::read.tree(params$snp_phylos) | ||
``` | ||
|
||
## SNP phylogeny | ||
|
||
```{r div_snp_phylo, fig.height = 7, eval = ! is.null(snp_trees)} | ||
# Root tree | ||
snp_trees <- root(snp_trees, "REF") | ||
# Plot tree | ||
phycanv <- phylocanvas(snp_trees, treetype = "rectangular", alignlabels = T, showscalebar = T, width = "100%") | ||
phycanv | ||
``` | ||
|
||
```{asis div_no_snp_phylo, echo = is.null(snp_trees)} | ||
There is no tree to draw, probably because there were too few samples. | ||
More info will be added later. | ||
``` | ||
|
||
|
||
## Minimum spanning network | ||
|
||
|
||
<!--chapter:end:02-diversity.Rmd--> | ||
|
||
# Gene content | ||
|
||
## Antibotic resistance genes | ||
|
||
## Effectors | ||
|
||
## Plasmids | ||
|
||
## User-defined genes | ||
|
||
<!--chapter:end:03-gene_content.Rmd--> | ||
|
||
`r if (knitr::is_html_output()) ' | ||
# References {-} | ||
'` | ||
|
||
<!--chapter:end:07-references.Rmd--> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.