Skip to content

Running PhyloPHoeNIx

Jill V. Hagey, PhD edited this page Nov 21, 2024 · 11 revisions

Input Parameters

The following are the possible parameters you can pass to PhyloPHoeNIx. You can get this screen by running:

nextflow run cdcgov/phylophoenix -r v1.0.0 --help

image

Outputs

Output file structure

The project level output (phx_output is the project folder) of PHoeNIx is structured like the following:

📦phylophoenix_output
┣ 📂<ST>
┃ ┣ 📂<sample_id>
┃ ┃ ┣ 📜<sample_id>.bam
┃ ┃ ┣ 📜<sample_id>_sorted.bam
┃ ┃ ┣ 📜<sample_id>_consolidated.bcf
┃ ┃ ┣ 📜<sample_id>_consolidated.bcf.csi
┃ ┃ ┣ 📜<sample_id>_filtered_density.txt
┃ ┃ ┣ 📜<sample_id>_freebayes_filtered.bcf
┃ ┃ ┣ 📜<sample_id>_freebayes_filtered.bcf.csi
┃ ┃ ┣ 📜<sample_id>_freebayes_filtered.vcf.gz
┃ ┃ ┣ 📜<sample_id>_freebayes.vcf
┃ ┃ ┣ 📜<sample_id>_mpileup.bcf
┃ ┃ ┗ 📜<sample_id>_mpileup.vcf.gz
┃ ┣ 📜<ST>_centroid_info.txt
┃ ┣ 📜<ST>_cleaned_metadata.tsv
┃ ┣ 📜<ST>_phylogeneticTree.newick
┃ ┣ 📜<ST>_snvAlignment.phy
┃ ┣ 📜<ST>_snvMatrix.tsv
┃ ┣ 📜<ST>_vcf2core.tsv
┃ ┣ 📜bam_line.txt
┃ ┣ 📜consolidation_line.txt
┃ ┣ 📜filtered_density_all.txt
┃ ┣ 📜filterStats.txt
┃ ┣ 📜mappingQuality.txt
┃ ┣ 📜new_invalid_positions.bed
┃ ┗ 📜phylogeneticTreeStats.txt
┣ 📂ST_SampleSheets
┃ ┗ <ST>_samplesheet.csv
┣ 📂pipeline_info
┃ ┣ 📜execution_report_.html
┃ ┣ 📜execution_timeline_.html
┃ ┣ 📜execution_trace_.txt
┃ ┣ 📜pipeline_dag_.html
┃ ┣ 📜samplesheet.valid.csv
┃ ┗ 📜software_versions.yml
┣ 📜Directory_samplesheet.csv
┣ 📜SNVPhyl_GRiPHin_Summary.xlsx
┗ 📜GRiPHin_Summary.xlsx

Output File Overview

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

  • SNVPhyl - Output of FastANI and Mash dist
    • assembly - Assembly output from SPADes and filtering/header renaming steps.
  • - this contains all the files produced for this Sequence type
    • gamma_ar - Output of GAMMA hits from curated AR database
  • qc_stats - Output of fastqc on trimmed reads, BBDUK log (remove adapters and PhiX reads) and Fastp summary file _trimmed_read_counts.txt
  • Sample Specific Files - Files that summarize the results for a sample
  • Run Specific Files - Files that summarizes output A good first place to start
  • MultiQC - Aggregate report describing results and FastQC from the whole pipeline
  • Pipeline information - Report metrics generated during the workflow execution

ANI

Output files
  • ANI/
    • *_REFSEQ_[date].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
      • *_REFSEQ_[date].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
      • *_REFSEQ_[date].txt: output of mash distance.F or further details see the Mash documentation
      • *_REFSEQ_[date]_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.

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.
    • *_singles.fastp.html: Html output of fastp run on unpaired reads.
    • *_singles.fastp.json: Same as the html output, just in json format.

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.

Serotype Specific Files

Output files * `*_centroid_info.txt`: This file states which isolate was used for the reference sequence. Will also tell you if there was multiple samples that were tied for being the centroid. * `*_cleaned_metadata.tsv`: This will be the same as your input metadata file, but dates will be adjusted to a format accepted by [Microreact](https://microreact.org/). Additionally, if you provided country, state, county and/or city information then lat and long columns will be added. * `*_phylogeneticTree.newick`: * `*_snvAlignment.phy`: * `*_snvMatrix.tsv`: * `*_vcf2core.tsv`: * `bam_line.txt`: * `consolidation_line.txt`: * `filtered_density_all.txt`: * `filterStats.txt`: * `mappingQuality.txt`: * `new_invalid_positions.bed`: * `phylogeneticTreeStats.txt`:

Run Specific Files

Output files
  • SNVPhyl_GRiPHin_Summary.xlsx: An excel file that summaries the output of both PHoeNIx and Phylophoenix for all samples.
    • ID - The name of the sample ID, which is determined from the samplesheet.
    • QC Metrics
      • Minimum_QC_Check - Either PASS or FAIL of the Auto PASS/FAIL
      • Minimum_QC_Issues - The reason(s) for the auto failing the sample
      • Warnings - Short descriptions of the warnings for the sample. Further details on the warnings can be viewed in the *.synopsis file. See Pipeline Overview for details on the warnings.
      • Alerts - Short descriptions of the alerts for the sample. Further details on the alerts can be viewed in the *.synopsis file. See Pipeline Overview for details on the alerts.
      • Raw_Q30_R1[%] - The percentage of raw R1 bp that are at >=Q30.
      • Raw_Q30_R2[%] - The percentage of raw R2 bp that are at >=Q30.
      • Total_Raw_[reads] - The total raw read count.
      • Paired_Trimmed_[reads] - The total paired reads (R1 and R2) that passed the filter and QC process.
      • Total_Trimmed_[reads] - The total paired reads (R1 and R2) and singletons that passed the filter and QC process. We use paired and singleton reads for assembly.
      • Estimated_Trimmed_Coverage - Estimated coverage as determined by (total trimmed bases / assembly length).
      • GC[%] - G/C % in the assembled genome.
      • Scaffolds - The number of scaffolds in the genome that are >500bp, those <500bp were filtered out of downstream analysis.
      • Assembly_Length - Length of the assembled genome in base pairs.
      • Assembly_Ratio - The calculated assembly ratio (assembly size / median genome size of species) with the sample's standard deviation. Standard deviation is only calculated when there are >=10 reference genomes for that taxa.
      • Assembly_StDev - The standard deviation for species Only standard deviation is only calculated when there are >=10 reference genomes for that taxa.
    • Taxonomic Information
      • Taxa_Source - This column will say which method was used to determine taxonomy. PHoeNIx will assign taxonomy based on the best match from FastANI that compares genomes from RefSeq. If FastANI fails PHoeNIx will fall back on the taxonomic assignment from Kraken2_Weighted and if no assembly was created then it will use Kraken2_Trimd.
      • BUSCO_Lineage - The number of scaffolds in the genome that are >500bp, those <500bp were filtered out of downstream analysis.
      • BUSCO_%Match - % of G/C in the assembled genome.
      • Kraken_ID_Raw_Reads_% - Taxa determined by running kraken2 on the cleaned reads. The percent of reads per genus/species is presented in parenthesis in next to the respective taxa level.
      • Kraken_ID_WtAssembly_% - Taxonomic assignment based on the assembly (scaffolds) and the % is generated by weighting the scaffolds by their length. The percent per genus/species is presented in parenthesis in next to the respective taxa level.
      • FastANI_Organism - The taxa (genus and species) IDed by FastANI.
      • FastANI_%ID - Calculated % average nucleotide identity (ANI). ANI is the mean nucleotide identity of orthologous gene pairs shared between two microbial genomes.
      • FastANI_%Coverage - % of scaffolds in the query genome (your assembled genome) that aligned successfully to the reference sequence (the closest hit in RefSeq to your assembled genome as determined by mash).
      • Species_Support_ANI - The genome in RefSeq that is the closest match to your assembled genome.
    • MLST Schemes
      • Primary_MLST_Scheme - Primary MLST scheme used.
      • Primary_MLST_Source - The source of the primary MLST determination (assembly: MLST or reads: srst2).
      • Primary_MLST - The sequence type based on primary MLST scheme.
      • Primary_MLST_Alleles - Primary MLST alleles.
      • Secondary_MLST_Scheme - If there is a secondary scheme it will be listed here.
      • Secondary_MLST_Source - The source of the secondary MLST determination (assembly: MLST or reads: srst2).
      • Secondary_MLST - If there was a secondary MLST scheme the sequence type.
      • Secondary_MLST_Alleles - Secondary MLST alleles.
    • Antibiotic Resistance Genes
      • AR_Database - The database used for identifying AR genes. Genes IDed by Gamma are filtered to require a minimum of 98% amino acid identity and a 90% length to be included in report. Similarly for SRST2, genes are filtered with a threshold of >=98% nucleotide identity and >=90% of the length to be included in the report.
      • The next series of columns are the details of each AR gene identified in the isolates. As an example column name, blaPAO_1_AY083595_(beta-lactam) translates to the name of the gene "blaPAO", accession "AY083595" and the drug class it confers resistance for "beta-lactam". If there is a gene identified via GAMMA that passes the filter it is reported as [%Nuc_Identity/%AA_Identity/%Coverage: Contig Number the gene is found on]. Similarly, SRST2 identified genes are reported as [%Nuc_Identity/%Coverage].
    • Hypervirulence_Genes
      • HV_Database - The database used for identifying Hypervirulence genes.
      • The next series of columns are the details of each Hypervirulence genes. These will have the same structured output to the AR genes (i.e. [%Nuc_Identity/%AA_Identity/%Coverage: Contig Number the gene is found on]). There is no filter for the quality of these hits!
    • Plasmid_Incompatibility_Replicons
      • Plasmid_Replicon_Database - The database used for identifying plasmid incompatibility replicons.
      • The next series of columns are the details of each plasmid incompatibility replicons identified. These will have the same structured output to the AR and hypervirulence genes (i.e. [%Nuc_Identity/%Coverage: Contig Number the gene is found on]).
  • Directory_samplesheet.csv: This file contains the best taxa id. The number after the ":" is the NCBI assigned taxID for easy lookup. This is an example output:

(https://cdcpartners.sharepoint.com/:b:/r/sites/NCEZID/DHQP/ARLN/Lab%20Testing%20Guidance/HAI_AR/Guidance%20documents/WGS%20of%20HAI%20AR%20Pathogens/General-Guidance-for-WGS-of-HAI-AR-Pathogens_v2.pdf?csf=1&web=1&e=wHFt3I).

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.