-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f519529
commit 0a48b5e
Showing
8 changed files
with
118 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: "Test report for core genome phylogeny" | ||
output: html_document | ||
date: "`r format(Sys.time(), '%d %B, %Y')`" | ||
params: | ||
ref_meta: "/home/fosterz/files/projects/work/current/nf-core-plantpathsurveil/test/output_full/iqtree2/input_alignments.treefile" | ||
core_phylo: "/media/fosterz/external_primary/files/projects/work/current/nf-core-plantpathsurveil/test/data/metadata_medium.csv" | ||
--- | ||
|
||
```{r include=FALSE, eval=FALSE} | ||
params = list( | ||
ref_meta = "/home/fosterz/files/projects/work/current/nf-core-plantpathsurveil/test/output_full/iqtree2/input_alignments.treefile", | ||
ref_meta = "/media/fosterz/external_primary/files/projects/work/current/nf-core-plantpathsurveil/test/data/metadata_medium.csv" | ||
) | ||
``` | ||
|
||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
## Prepare | ||
|
||
Load required libraries. | ||
|
||
```{r} | ||
library(ggtree) | ||
library(treeio) | ||
``` | ||
|
||
|
||
Load metadata. | ||
|
||
```{r} | ||
metadata <- read.csv(params$metadata) | ||
metadata$sample <- paste0(metadata$sample, "_T1") | ||
``` | ||
|
||
Load treefile. | ||
|
||
```{r} | ||
tree <- read.newick(params$treefile) | ||
``` | ||
|
||
plot tree | ||
|
||
```{r} | ||
ggplot(tree, aes(x, y)) + | ||
geom_tree() + | ||
theme_tree() + | ||
geom_tiplab(as_ylab = FALSE, color = '#555555') | ||
``` | ||
|
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,41 @@ | ||
process MAIN_REPORT { | ||
tag "$group_meta.id" | ||
label 'process_low' | ||
|
||
conda "conda-forge::r-base conda-forge::r-rmarkdown conda-forge::r-yaml conda-forge::r-poppr conda-forge::r-adegenet conda-forge::r-ape conda-forge::r-readr conda-forge::r-igraph" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/mulled-v2-31ad840d814d356e5f98030a4ee308a16db64ec5:0e852a1e4063fdcbe3f254ac2c7469747a60e361-0' : | ||
'quay.io/biocontainers/mulled-v2-31ad840d814d356e5f98030a4ee308a16db64ec5:0e852a1e4063fdcbe3f254ac2c7469747a60e361-0' }" | ||
|
||
input: | ||
tuple val(group_meta), val(ref_metas), file(snp_phylos), file(ani_matrix), file(core_phylo) | ||
path samp_stats | ||
path ref_stats | ||
|
||
output: | ||
tuple val(ref_meta), path("*.html"), emit: html | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${group_meta.id}" | ||
""" | ||
Rscript -e "workdir<-getwd() | ||
rmarkdown::render('${projectDir}/assets/main_report.Rmd', | ||
params = list( | ||
ref_meta = \\\"$ref_meta\\\", | ||
core_phylo = \\\"$core_phylo\\\" | ||
), | ||
output_file = \\\"${prefix}_report.html\\\", | ||
knit_root_dir=workdir, | ||
output_dir=workdir)" | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
rmarkdown: \$(Rscript -e "cat(paste(packageVersion('rmarkdown'), collapse='.'))") | ||
END_VERSIONS | ||
""" | ||
} |
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
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