From ee642eb3e2de2ba69d311684321c75fa8b256eb0 Mon Sep 17 00:00:00 2001 From: "Zachary S.L. Foster" Date: Fri, 11 Aug 2023 08:31:33 -0700 Subject: [PATCH] update README to change name to PathogenDx --- README.md | 33 +- assets/main_report/01-identification.Rmd | 32 +- assets/main_report/_output.yml | 14 +- assets/main_report/index.Rmd | 4 + bin/sendsketch_filter.R | 3 +- docs/posters/pipeline_diagram.svg | 814 +++++++++++++++-------- modules/local/initialclassification.nf | 2 + modules/local/mainreport.nf | 1 + 8 files changed, 573 insertions(+), 330 deletions(-) diff --git a/README.md b/README.md index 8c561f6d..758a442b 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,34 @@ -# ![nf-core/plantpathsurveil](docs/images/nf-core-plantpathsurveil_logo_light.png#gh-light-mode-only) ![nf-core/plantpathsurveil](docs/images/nf-core-plantpathsurveil_logo_dark.png#gh-dark-mode-only) +# ![nf-core/pathogendx](docs/images/nf-core-pathogendx_logo_light.png#gh-light-mode-only) ![nf-core/pathogendx](docs/images/nf-core-pathogendx_logo_dark.png#gh-dark-mode-only) -[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/plantpathsurveil/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX) +[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/pathogendx/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX) [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/) [![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) [![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/) [![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/) -[![Launch on Nextflow Tower](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Nextflow%20Tower-%234256e7)](https://tower.nf/launch?pipeline=https://github.com/nf-core/plantpathsurveil) +[![Launch on Nextflow Tower](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Nextflow%20Tower-%234256e7)](https://tower.nf/launch?pipeline=https://github.com/nf-core/pathogendx) -[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23plantpathsurveil-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/plantpathsurveil)[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core) +[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23pathogendx-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/pathogendx)[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core) + +## NOTE: THIS PROJECT IS UNDER DEVLOPMENT AND MAY NOT FUNCTION AS EXPECTED UNTIL THIS MESSAGE GOES AWAY ## Introduction -**nf-core/plantpathsurveil** is a population genomic pipeline for pathogen diagnosis, variant detection, and biosurveillance. +**nf-core/pathogendx** is a population genomic pipeline for pathogen diagnosis, variant detection, and biosurveillance. +The pipeline accepts the paths to raw reads for one or more organisms and creates reports in the form of HTML websites or PDF documents. +Significant features include the ability to analyze unidentified eukaryotic and prokaryotic samples, creation of reports for multiple user-defined groupings of samples, automated discovery and downloading of reference assemblies from NCBI RefSeq, and rapid initial identification based on k-mer sketches followed by a more robust core genome phylogeny. The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community! -On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources.The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/plantpathsurveil/results). +On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world data sets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources.The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/pathogendx/results). ## Pipeline summary - - -1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)) -2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/)) +![Pipeline flowchart](docs/posters/pipeline_diagram.png) ## Quick Start @@ -38,7 +39,7 @@ On release, automated continuous integration tests run the pipeline on a full-si 3. Download the pipeline and test it on a minimal dataset with a single command: ```bash - nextflow run nf-core/plantpathsurveil -profile test,YOURPROFILE --outdir + nextflow run nf-core/pathogendx -profile test,YOURPROFILE --outdir ``` Note that some form of configuration will be needed so that Nextflow knows how to fetch the required software. This is usually done in the form of a config profile (`YOURPROFILE` in the example command above). You can chain multiple config profiles in a comma-separated string. @@ -53,16 +54,16 @@ On release, automated continuous integration tests run the pipeline on a full-si ```bash - nextflow run nf-core/plantpathsurveil --input samplesheet.csv --outdir --genome GRCh37 -profile + nextflow run nf-core/pathogendx --input samplesheet.csv --outdir --genome GRCh37 -profile ``` ## Documentation -The nf-core/plantpathsurveil pipeline comes with documentation about the pipeline [usage](https://nf-co.re/plantpathsurveil/usage), [parameters](https://nf-co.re/plantpathsurveil/parameters) and [output](https://nf-co.re/plantpathsurveil/output). +The nf-core/pathogendx pipeline comes with documentation about the pipeline [usage](https://nf-co.re/pathogendx/usage), [parameters](https://nf-co.re/pathogendx/parameters) and [output](https://nf-co.re/pathogendx/output). ## Credits -nf-core/plantpathsurveil was originally written by Zachary S.L. Foster, Martha Sudermann, Nicholas C. Cauldron, Fernanda I. Bocardo, Hung Phan, Jeff H. Chang, Niklaus J. Grünwald. +nf-core/pathogendx was originally written by Zachary S.L. Foster, Martha Sudermann, Nicholas C. Cauldron, Fernanda I. Bocardo, Hung Phan, Jeff H. Chang, Niklaus J. Grünwald. We thank the following people for their extensive assistance in the development of this pipeline: @@ -72,12 +73,12 @@ We thank the following people for their extensive assistance in the development If you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md). -For further information or help, don't hesitate to get in touch on the [Slack `#plantpathsurveil` channel](https://nfcore.slack.com/channels/plantpathsurveil) (you can join with [this invite](https://nf-co.re/join/slack)). +For further information or help, don't hesitate to get in touch on the [Slack `#pathogendx` channel](https://nfcore.slack.com/channels/pathogendx) (you can join with [this invite](https://nf-co.re/join/slack)). ## Citations - + diff --git a/assets/main_report/01-identification.Rmd b/assets/main_report/01-identification.Rmd index b747fe39..d334fcd1 100644 --- a/assets/main_report/01-identification.Rmd +++ b/assets/main_report/01-identification.Rmd @@ -13,16 +13,17 @@ params = lapply(params, function(x) file.path(work_dir, x)) ``` -```{r setup, include=FALSE} +```{r id_setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE, fig.width = 10, warning = FALSE) ``` -```{r libraries} +```{r id_libraries} library(phylocanvas) library(ape) +library(magrittr) ``` -```{r parse_inputs} +```{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 = ',') @@ -33,10 +34,13 @@ snp_trees <- ape::read.tree(params$snp_phylos) ``` +## Initial ANI tree + + ## Core genome phylogeny -```{r core_phylo, fig.height = 7, eval = ! is.null(core_tree)} +```{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] @@ -60,29 +64,19 @@ 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 no_core_phylo, echo = is.null(core_tree)} +```{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. ``` -## SNP phylogeny - -```{r 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 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. -``` diff --git a/assets/main_report/_output.yml b/assets/main_report/_output.yml index b8853118..f4698ae8 100644 --- a/assets/main_report/_output.yml +++ b/assets/main_report/_output.yml @@ -3,11 +3,21 @@ bookdown::gitbook: config: toc: before: | -
  • PathogenDx Report
  • +
  • PathogenDx Report
  • after: |
  • Created with bookdown
  • - edit: https://github.com/USERNAME/REPO/edit/BRANCH/%s + # edit: null download: ["pdf", "epub"] + sharing: + facebook: false + github: true + twitter: false + linkedin: false + weibo: false + instapaper: false + vk: false + whatsapp: false + all: false bookdown::pdf_book: includes: in_header: preamble.tex diff --git a/assets/main_report/index.Rmd b/assets/main_report/index.Rmd index a58cf6e1..9111d17a 100644 --- a/assets/main_report/index.Rmd +++ b/assets/main_report/index.Rmd @@ -23,6 +23,10 @@ params: 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 diff --git a/bin/sendsketch_filter.R b/bin/sendsketch_filter.R index 0c4f03cb..185dab70 100755 --- a/bin/sendsketch_filter.R +++ b/bin/sendsketch_filter.R @@ -1,4 +1,4 @@ -#!/usr/bin/env -S Rscript --vanilla +#!/usr/bin/env Rscript # Options ani_threshold <- c(species = 90, genus = 90, family = 70) # These numbers are total guesses. TODO: find reasonable defaults (issue #11) @@ -34,3 +34,4 @@ writeLines(kingdom, "kingdom.txt") # Save full taxonomic classification writeLines(data$taxonomy[1], "classification.txt") + diff --git a/docs/posters/pipeline_diagram.svg b/docs/posters/pipeline_diagram.svg index d0261f31..3f110cfe 100644 --- a/docs/posters/pipeline_diagram.svg +++ b/docs/posters/pipeline_diagram.svg @@ -10,6 +10,9 @@ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" sodipodi:docname="pipeline_diagram.svg" xml:space="preserve" + inkscape:export-filename="/media/fosterz/external_primary/files/projects/work/current/nf-core-plantpathsurveil/docs/posters/pipeline_diagram.png" + inkscape:export-xdpi="200" + inkscape:export-ydpi="200" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" @@ -25,18 +28,20 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" showgrid="true" - inkscape:zoom="0.82501872" - inkscape:cx="712.7111" - inkscape:cy="493.32214" - inkscape:window-width="2560" - inkscape:window-height="1403" - inkscape:window-x="1920" - inkscape:window-y="0" + inkscape:zoom="0.41250936" + inkscape:cx="722.40785" + inkscape:cy="814.52697" + inkscape:window-width="1920" + inkscape:window-height="1011" + inkscape:window-x="0" + inkscape:window-y="534" inkscape:window-maximized="1" - inkscape:current-layer="layer2" + inkscape:current-layer="layer4" showguides="true" inkscape:pageshadow="2" - units="in">FastqFastqFastqFastaCSVfastafastqHTMLFind and download referencesSelect reference for variant callingGenome assembly and annotationVariant callingRead2Tree phylogenyCore genome phylogenyfastaPDFQuality control and reportingFind and download referencesSelect reference for variant callingGenome assembly and annotationVariant callingRead2Tree phylogenyCore genome phylogenyQuality control and reportingGenome assembly and annotationInfer phylogenyInfer phylogenyread2treeMake Read2Treereference databasecustom scriptExtract BUSCO genesbuscoFilter variantsvcflib vcffilterCall variantsgraphtyper genotypeInput data:MetadataRaw readsOptional referencesAssess read qualityfastqcCombines VCF filesgraphtypervcf_concatenateMake readquality reportmultiqcCreate reportscustom scriptFilter by kmerFilter reads byabundancekmer abundancekhmer trim_low_abundTrim adaptersTrim adaptersfastpAssemble genomesAssemble genomesspadesFilter assembliesFilter assembliescustom scriptSelect and download referencesCreate signaturesof assembliessourmash sketchMake signaturesof readssourmash sketchMake signatures ofuser referencessourmash sketchDownload assemblies datasets downloadSearch for assembliesEntrez esearchAnnotate genomesAnnotate genomesbaktaFast initial IDbbmap sendsketchSimplified pipeline diagramAssess assembly qualityAssess assembly qualityquastCore genome phylogeny (Bacteria)Core genome phylogeny (Prokaryotes)Identify shared orthologspirateExtract core genescustom scriptMake gene multiplesequence alignmentsmafftmafftInfer PhylogenyInfer phylogenyiqtreeInfer phylogenyInfer phylogenyIQ-TREEiqtreeSelect references for variant callingCompare signaturessourmash compareAssign referencescustom scriptVariant callingAlign readsbwa memIdentify duplicatespicard MarkDuplicatesRead2Tree phylogeny (Eukaryotes)PathogenDx + x="48.557404" + y="16.298712">PathogenDx diff --git a/modules/local/initialclassification.nf b/modules/local/initialclassification.nf index ddc31b32..cc93b3b2 100644 --- a/modules/local/initialclassification.nf +++ b/modules/local/initialclassification.nf @@ -25,6 +25,8 @@ process INITIALCLASSIFICATION { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ + which Rscript + Rscript --version Rscript --vanilla ${projectDir}/bin/sendsketch_filter.R $hits KINGDOM="\$(cat kingdom.txt)" diff --git a/modules/local/mainreport.nf b/modules/local/mainreport.nf index 872852a6..4644190c 100644 --- a/modules/local/mainreport.nf +++ b/modules/local/mainreport.nf @@ -26,6 +26,7 @@ process MAIN_REPORT { Rscript -e "workdir<-getwd() bookdown::render_book('main_report', + output_format = 'all', params = list( samp_data = \\\"$samp_data\\\", ref_data = \\\"$ref_data\\\",