Skip to content

Running PHoeNIx

Jill V. Hagey, PhD edited this page Jun 21, 2022 · 108 revisions

You should have already set up your config file to make sure Nextflow knows how to run the programs within PHoeNIx. If you haven't already, please review the config set up portion of the install page.

Inputs

PHoeNIx currently only runs on Illumina paired-end reads. Multiple samples can be run using a samplesheet.csv file

nextflow run phoenix/main.nf -profile <docker/singularity/custom> --input samplesheet.csv

Samplesheet Input

You will need to create a samplesheet with information about the samples you would like to analyze before running the pipeline. Use the --input parameter to specify its location. It must be a comma-separated file (csv) with at least 3 columns and a header row, as shown in the example below. DO NOT HAVE ANY SPACES IN THIS FILE. Do make sure the paths are full paths and not relative. For best results use the automated samplesheet creation scripts described in the automated section below.

--input '[path to samplesheet file]'

Full Samplesheet

The samplesheet can have as many columns as you desire; however, there is a strict requirement for the first 3 columns to match those defined in the table below.

A final samplesheet file consisting of paired-end data may look something like the one below.

sample,fastq_1,fastq_2
SAMPLE_1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz
SAMPLE_2,AEG588A2_S2_L002_R1_001.fastq.gz,AEG588A2_S2_L002_R2_001.fastq.gz
SAMPLE_3,AEG588A3_S3_L002_R1_001.fastq.gz,AEG588A3_S3_L002_R2_001.fastq.gz
Column Description
sample Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (_).
fastq_1 Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz".
fastq_2 Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz".

An example samplesheet has been provided with the pipeline and can be used for testing.

Samplesheet Creation - Automated

A script is available to create a samplesheet from a directory of fastq files. The script will search 1 directory deep and attempt to determine sample id names and pairing/multilane information and will automatically create a samplesheet.

- Please review the samplesheet for accuracy before using it in the pipeline.
phoenix/bin/create_samplesheet.sh <directory of fastq files> > samplesheet.csv

You can change the name of the samplesheet.csv above to anything you want.

Outputs

Output file structure

The output of PHoeNIx is structured like the following:

📦results ┣ 📂SRR17250615
┃ ┣ 📂ANI
┃ ┃ ┣ 📂fastANI
┃ ┃ ┃ ┗ 📜SRR17250615.fastANI.txt
┃ ┃ ┣ 📂mash_dist
┃ ┃ ┃ ┣ 📜SRR17250615.txt
┃ ┃ ┃ ┗ 📜SRR17250615_best_MASH_hits.txt
┃ ┃ ┗ 📜SRR17250615.ani.txt
┃ ┣ 📂Assembly
┃ ┃ ┣ 📜SRR17250615.assembly.gfa.gz
┃ ┃ ┣ 📜SRR17250615.bbmap_filtered.log
┃ ┃ ┣ 📜SRR17250615.contigs.fa.gz
┃ ┃ ┣ 📜SRR17250615.filtered.scaffolds.fa.gz
┃ ┃ ┣ 📜SRR17250615.renamed.scaffolds.fa.gz
┃ ┃ ┣ 📜SRR17250615.scaffolds.fa.gz
┃ ┃ ┗ 📜SRR17250615.spades.log
┃ ┣ 📂BUSCO
┃ ┃ ┣ 📜SRR17250615-auto-busco.batch_summary.txt
┃ ┃ ┣ 📜short_summary.generic.bacteria_odb10.SRR17250615.filtered.scaffolds.fa.json
┃ ┃ ┣ 📜short_summary.generic.bacteria_odb10.SRR17250615.filtered.scaffolds.fa.txt
┃ ┃ ┣ 📜short_summary.specific.enterobacterales_odb10.SRR17250615.filtered.scaffolds.fa.json
┃ ┃ ┗ 📜short_summary.specific.enterobacterales_odb10.SRR17250615.filtered.scaffolds.fa.txt
┃ ┣ 📂fastp_trimd
┃ ┃ ┣ 📜SRR17250615.fastp.html
┃ ┃ ┣ 📜SRR17250615.fastp.json
┃ ┃ ┣ 📜SRR17250615.singles.fastq.gz
┃ ┃ ┣ 📜SRR17250615_1.trim.fastq.gz
┃ ┃ ┣ 📜SRR17250615_2.trim.fastq.gz
┃ ┃ ┣ 📜SRR17250615_raw_read_counts.txt
┃ ┃ ┣ 📜SRR17250615_singles.fastp.html
┃ ┃ ┣ 📜SRR17250615_singles.fastp.json
┃ ┃ ┗ 📜SRR17250615_trimmed_read_counts.txt
┃ ┣ 📂fastqc
┃ ┃ ┣ 📜SRR17250615_1_fastqc.html
┃ ┃ ┣ 📜SRR17250615_1_fastqc.zip
┃ ┃ ┣ 📜SRR17250615_2_fastqc.html
┃ ┃ ┗ 📜SRR17250615_2_fastqc.zip
┃ ┣ 📂gamma_ar
┃ ┃ ┣ 📜SRR17250615_ResGANNCBI_20210507_srst2.gamma
┃ ┃ ┗ 📜SRR17250615_ResGANNCBI_20210507_srst2.psl
┃ ┣ 📂gamma_hv
┃ ┃ ┣ 📜SRR17250615_HyperVirulence_20220414.gamma
┃ ┃ ┗ 📜SRR17250615_HyperVirulence_20220414.psl
┃ ┣ 📂gamma_pf
┃ ┃ ┣ 📜SRR17250615_PF-Replicons_20220414.gamma
┃ ┃ ┗ 📜SRR17250615_PF-Replicons_20220414.psl
┃ ┣ 📂kraken2_asmbld
┃ ┃ ┣ 📂krona
┃ ┃ ┃ ┣ 📜SRR17250615_asmbld.html
┃ ┃ ┃ ┗ 📜SRR17250615_asmbld.krona
┃ ┃ ┣ 📜SRR17250615.asmbld_summary.txt
┃ ┃ ┣ 📜SRR17250615.classified.fastq.gz
┃ ┃ ┣ 📜SRR17250615.kraken2_asmbld.classifiedreads.txt
┃ ┃ ┣ 📜SRR17250615.kraken2_asmbld.report.txt
┃ ┃ ┣ 📜SRR17250615.mpa
┃ ┃ ┗ 📜SRR17250615.unclassified.fastq.gz
┃ ┣ 📂kraken2_asmbld_weighted
┃ ┃ ┣ 📂krona
┃ ┃ ┃ ┣ 📜SRR17250615_wtasmbld.html
┃ ┃ ┃ ┗ 📜SRR17250615_wtasmbld.krona
┃ ┃ ┣ 📜SRR17250615.kraken2_wtasmbld.report.txt
┃ ┃ ┗ 📜SRR17250615.wtasmbld_summary.txt
┃ ┣ 📂kraken2_trimd
┃ ┃ ┣ 📂krona
┃ ┃ ┃ ┣ 📜SRR17250615_trimd.html
┃ ┃ ┃ ┗ 📜SRR17250615_trimd.krona
┃ ┃ ┣ 📜SRR17250615.classified_1.fastq.gz
┃ ┃ ┣ 📜SRR17250615.classified_2.fastq.gz
┃ ┃ ┣ 📜SRR17250615.kraken2_trimd.classifiedreads.txt
┃ ┃ ┣ 📜SRR17250615.kraken2_trimd.report.txt
┃ ┃ ┣ 📜SRR17250615.mpa
┃ ┃ ┣ 📜SRR17250615.trimd_summary.txt
┃ ┃ ┣ 📜SRR17250615.unclassified_1.fastq.gz
┃ ┃ ┗ 📜SRR17250615.unclassified_2.fastq.gz
┃ ┣ 📂mlst
┃ ┃ ┗ 📜SRR17250615.tsv
┃ ┣ 📂quast
┃ ┃ ┗ 📜SRR17250615_report.tsv
┃ ┣ 📂removedAdapters
┃ ┃ ┗ 📜SRR17250615.bbduk.log
┃ ┣ 📂srst2
┃ ┃ ┗ 📜SRR17250615__fullgenes__ResGANNCBI_20210507_srst2__results.txt
┃ ┣ 📜SRR17250615.synopsis
┃ ┣ 📜SRR17250615.tax
┃ ┣ 📜SRR17250615_Assembly_ratio_20210819.txt
┃ ┗ 📜SRR17250615_summaryline.tsv
┣ 📂multiqc
┃ ┣ 📂multiqc_data
┃ ┃ ┣ 📜mqc_fastqc_per_base_n_content_plot_1.txt
┃ ┃ ┣ 📜mqc_fastqc_per_base_sequence_quality_plot_1.txt
┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Counts.txt
┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Percentages.txt
┃ ┃ ┣ 📜mqc_fastqc_per_sequence_quality_scores_plot_1.txt
┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1.txt
┃ ┃ ┣ 📜mqc_fastqc_sequence_duplication_levels_plot_1.txt
┃ ┃ ┣ 📜mqc_fastqc_sequence_length_distribution_plot_1.txt
┃ ┃ ┣ 📜multiqc.log
┃ ┃ ┣ 📜multiqc_data.json
┃ ┃ ┣ 📜multiqc_fastqc.txt
┃ ┃ ┣ 📜multiqc_general_stats.txt
┃ ┃ ┗ 📜multiqc_sources.txt
┃ ┣ 📂multiqc_plots
┃ ┃ ┣ 📂pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_base_n_content_plot_1.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_base_sequence_quality_plot_1.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Counts.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Percentages.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_quality_scores_plot_1.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1_pc.pdf
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_duplication_levels_plot_1.pdf
┃ ┃ ┃ ┗ 📜mqc_fastqc_sequence_length_distribution_plot_1.pdf
┃ ┃ ┣ 📂png
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_base_n_content_plot_1.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_base_sequence_quality_plot_1.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Counts.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Percentages.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_quality_scores_plot_1.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1_pc.png
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_duplication_levels_plot_1.png
┃ ┃ ┃ ┗ 📜mqc_fastqc_sequence_length_distribution_plot_1.png
┃ ┃ ┗ 📂svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_base_n_content_plot_1.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_base_sequence_quality_plot_1.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Counts.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_gc_content_plot_Percentages.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_per_sequence_quality_scores_plot_1.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_counts_plot_1_pc.svg
┃ ┃ ┃ ┣ 📜mqc_fastqc_sequence_duplication_levels_plot_1.svg
┃ ┃ ┃ ┗ 📜mqc_fastqc_sequence_length_distribution_plot_1.svg
┃ ┗ 📜multiqc_report.html
┣ 📂pipeline_info
┃ ┣ 📜execution_report_2022-06-16_09-34-32.html
┃ ┣ 📜execution_timeline_2022-06-16_09-34-32.html
┃ ┣ 📜execution_trace_2022-06-16_09-34-32.txt
┃ ┣ 📜pipeline_dag_2022-06-16_09-34-32.svg
┃ ┣ 📜samplesheet.valid.csv
┃ ┗ 📜software_versions.yml
┗ 📜Phoenix_Output_Report.tsv

This is the file tree for running one sample.

Output Overview

The following are an explanations of the files that are output:

ANI

Output files
  • ANI/
    • *.ani.txt: Output of FastANI. Which shows the ANI estimate between the assembly and the top 20 closest genomes (determined via the mash distance). The remaining columns are the ANI estimate, the number of genomes that were aligned as orthologous matches, and the total sequence fragments from the assembly. For further details see the FastANI documentation.
    • ANI/fastANI
      • *.fastANI.txt: This is a reformatted version of *.ani.txt that list matches in order of ANI and includes the top match information as the first line of the file to be extracted in downstream processes for reporting.
    • ANI/mash_dist
      • *.txt: output of mash distance.F or further details see the Mash documentation
      • *_best_MASH_hits.txt: A list of the top 20 matches found via mash dist that is past to FastANI to calculate

FastANI FastANI is developed for fast alignment-free computation of whole-genome Average Nucleotide Identity (ANI). ANI is defined as mean nucleotide identity of orthologous gene pairs shared between two microbial genomes. FastANI avoids expensive sequence alignments and uses Mashmap as its MinHash based sequence mapping engine to compute the orthologous mappings and alignment identity estimates.

Assembly

Output files
  • Assembly/
    • *.assembly.gfa.gz: Contains SPAdes assembly graph and scaffolds paths in GFA 1.0 format
    • *.bbmap_filtered.log: The log file of bbmap which is used to remove scaffolds that have <500bp
    • *.contigs.fa.gz: Contains contigs generated by SPAdes
    • *.filtered.scaffolds.fa.gz: Scaffolds file that has <500bp sequences remove.
    • *.renamed.scaffolds.fa.gz: Same as the *.filtered.scaffolds.fa.gz file, but headers contain the sample name.
    • *.scaffolds.fa.gz: Contains scaffolds generated by SPAdes
    • *.spades.log: Log of SPAdes log

SPAdes – St. Petersburg genome assembler – is an assembly toolkit containing various assembly pipelines.. For further reading and documentation see the SPAdes manual.

BUSCO

Output files
  • BUSCO/
    • *-auto-busco.batch_summary.txt:
    • short_summary.generic.*.filtered.scaffolds.fa.json: Contains a summary of the results in JSON form.
    • short_summary.generic.*.filtered.scaffolds.fa.txt: Contains a plain text summary of the results in BUSCO notation.
    • short_summary.specific.*.filtered.scaffolds.fa.json: Contains a summary of the results in JSON form.
    • short_summary.specific.*.filtered.scaffolds.fa.txt: Contains a plain text summary of the results in BUSCO notation.

For further reading and documentation see the BUSCO Users Guide.

Fastp

Output files
  • fastp_trimd/
    • *.fastp.html: Html output of fastp run on raw reads.
    • *.fastp.json: Same as the html output, just in json format
    • *.singles.fastq.gz: Unpaired reads that passed the QC filters when running fastp on the raw reads.
    • *_1.trim.fastq.gz: Forward reads from paired-end reads that passed the QC filters of fastp.
    • *_2.trim.fastq.gz : Reverse reads from paired-end reads that passed the QC filters of fastp.
    • *_raw_read_counts.txt: Parsed *.fastp.json on raw reads and custom stat calculations.
    • *_singles.fastp.html: Html output of fastp run on unpaired reads.
    • *_singles.fastp.json: Same as the html output, just in json format.
    • *_trimmed_read_counts.txt: Parsed *.fastp.json on trimmed reads and single reads with custom stat calculations.

FastP is a tool designed to provide fast all-in-one preprocessing for FastQ files. This tool is developed in C++ with multithreading supported to afford high performance. For further reading and documentation see the Fastp documentation.

FastQC

Output files
  • fastqc/
    • *_fastqc.html: FastQC report containing quality metrics.
    • *_fastqc.zip: Zip archive containing the FastQC report, tab-delimited data file and plot images.

FastQC gives general quality metrics about your sequenced reads. It provides information about the quality score distribution across your reads, per base sequence content (%A/T/G/C), adapter contamination and overrepresented sequences. For further reading and documentation see the FastQC help pages.

GAMMA

Output files
  • gamma_ar/
    • *_ResGANNCBI_*.gamma: Output of GAMMA that are the best matches from the curated AR gene database.
    • *_ResGANNCBI_*.psl:
  • gamma_hv/
    • *_HyperVirulence_*.gamma: Output of GAMMA that are the best matches from the hypervirulence database.
    • *_HyperVirulence_*.psl:
  • gamma_pf/
    • *_PF-Replicons_*.gamma: Output of GAMMA-S that are the best matches from the plasmid finder database without translating them.
    • *_PF-Replicons_*.psl:

GAMMA (Gene Allele Mutation Microbial Assessment) is a command line tool that finds gene matches in microbial genomic data using protein coding (rather than nucleotide) identity, and then translates and annotates the match by providing the type (i.e., mutant, truncation, etc.) and a translated description (i.e., Y190S mutant, truncation at residue 110, etc.). Because microbial gene families often have multiple alleles and existing databases are rarely exhaustive, GAMMA is helpful in both identifying and explaining how unique alleles differ from their closest known matches. GAMMA-S (Gene Allele Mutation Microbial Assessment-Sequence) finds best matches from a gene database without translating them--so it will find the best match by nucleotides, rather by the translated protein sequence. For further reading and documentation see the GAMMA's github.

Kraken2

Output files
  • kraken2_asmbld/
    • krona/
      • *_asmbld.html: Interactive hierarchical chart of kraken2's taxa calls on the assembly that can be viewed with any modern web browser.
      • *_asmbld.krona: Krona file used to make the *_asmbld.html file.
    • *.asmbld_summary.txt:
    • *.classified.fastq.gz:
    • *.kraken2_asmbld.classifiedreads.txt:
    • *.kraken2_asmbld.report.txt:
    • *.mpa:
    • *.unclassified.fastq.gz:
  • kraken2_asmbld_weighted/
    • krona/
      • *_wtasmbld.html: Interactive hierarchical chart of kraken2's taxa calls on the weighted assembly that can be viewed with any modern web browser.
      • *_wtasmbld.krona: Krona file used to make the *_wtasmbld.html file.
    • *.kraken2_wtasmbld.report.txt:
    • *.wtasmbld_summary.txt:
  • kraken2_trimd/
    • krona/
      • *_trimd.html: Interactive hierarchical chart of kraken2's taxa calls on the trimmed reads that can be viewed with any modern web browser.
      • *_trimd.krona: Krona file used to make the *_trimd.html file.
    • *.classified_1.fastq.gz:
    • *.classified_2.fastq.gz:
    • *.kraken2_trimd.classifiedreads.txt:
    • *.kraken2_trimd.report.txt:
    • *.mpa:
    • *.trimd_summary.txt:
    • *.unclassified_1.fastq.gz:
    • *.unclassified_2.fastq.gz:

For further reading and documentation see the Kraken2's github. Krona allows hierarchical data to be explored with zooming, multi-layered pie charts. The resulting interactive charts are self-contained and can be viewed with any modern web browser. For further reading and documentation see the Krona's github.

MultiQC

Output files
  • multiqc/
    • multiqc_report.html: a standalone HTML file that can be viewed in your web browser.
    • multiqc_data/: directory containing parsed statistics from the different tools used in the pipeline.
    • multiqc_plots/: directory containing static images from the report in various formats.

MultiQC is a visualization tool that generates a single HTML report summarizing all samples in your project. Most of the pipeline QC results are visualized in the report and further statistics are available in the report data directory.

Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQC. The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability. For more information about how to use MultiQC reports, see http://multiqc.info.

Pipeline information

Output files
  • pipeline_info/
    • Reports generated by Nextflow: execution_report.html, execution_timeline.html, execution_trace.txt and pipeline_dag.dot/pipeline_dag.svg.
    • Reports generated by the pipeline: pipeline_report.html, pipeline_report.txt and software_versions.yml. The pipeline_report* files will only be present if the --email / --email_on_fail parameter's are used when running the pipeline.
    • Reformatted samplesheet files used as input to the pipeline: samplesheet.valid.csv.

Nextflow provides excellent functionality for generating various reports relevant to the running and execution of the pipeline. This will allow you to troubleshoot errors with the running of the pipeline, and also provide you with other information such as launch commands, run times and resource usage.

Running on a High-Performance Computing (HPC) Cluster

To run PHoeNIx on an HPC and submit jobs to a cluster you will need to make config file for your executor. We provide a template in the conf folder to edit. Then run the program by running:

nextflow run CDCgov/phoenix -profile singularity,custom_HPC --input samplesheet.csv

Clone this wiki locally