nf-flu is a Nextflow bioinformatics analysis pipeline for assembly and H/N subtyping of Influenza A and B viruses from Illumina or Nanopore sequencing data. Since Influenza has a segmented genome consisting of 8 gene segments, the pipeline will automatically select the top matching reference sequence from NCBI for each gene segment based on IRMA assembly and nucleotide BLAST against all Influenza sequences from NCBI. Users can also provide their own reference sequences to include in the top reference sequence selection process. After reference sequence selection, the pipeline performs read mapping to each reference sequence, variant calling and depth-masked consensus sequence generation.
Note: The officially supported version of the pipeline is CFIA-NCFAD/nf-flu. If you have issues with using the pipeline, please create an issue here on CFIA-NCFAD/nf-flu repo.
- Download latest NCBI Orthomyxoviridae sequences and metadata (parsed from NCBI Viruses FTP data).
- Merge reads of re-sequenced samples (
cat
) (if needed). - Assembly of Influenza gene segments with IRMA using the built-in FLU module
- Nucleotide BLAST search against NCBI Influenza DB sequences
- H/N subtype prediction and Excel XLSX report generation based on BLAST results.
- Automatically select top match reference sequences for segments
- Read mapping, variant calling and consensus sequence generation for each segment against top reference sequence based on BLAST results.
- Annotation of consensus sequences with VADR
- FluMut detection of molecular markers and mutation in Influenza A(H5N1) viruses.
- MultiQC report generation.
-
Install
Nextflow
(>=21.04.0
). -
Install any of
Docker
,Singularity
,Podman
,Shifter
orCharliecloud
for full pipeline reproducibility (please only useConda
as a last resort) -
Download the pipeline and test it on a minimal dataset with a single command:
For Illumina workflow test:
nextflow run CFIA-NCFAD/nf-flu -profile test_illumina,<docker/singularity/podman/shifter/charliecloud/conda> \ --max_cpus $(nproc) # use all available CPUs; default is 2
For Nanopore workflow test:
nextflow run CFIA-NCFAD/nf-flu -profile test_nanopore,<docker/singularity/podman/shifter/charliecloud/conda> \ --max_cpus $(nproc) # use all available CPUs; default is 2
- If you are using
singularity
then the pipeline will auto-detect this and attempt to download the Singularity images directly as opposed to performing a conversion from Docker images. If you are persistently observing issues downloading Singularity images directly due to timeout or network issues then please use the--singularity_pull_docker_container
parameter to pull and convert the Docker image instead. Alternatively, it is highly recommended to use thenf-core download
command to pre-download all of the required containers before running the pipeline and to set theNXF_SINGULARITY_CACHEDIR
orsingularity.cacheDir
Nextflow options to be able to store and re-use the images from a central location for future pipeline runs. - If you are using
conda
, it is highly recommended to use theNXF_CONDA_CACHEDIR
orconda.cacheDir
settings to store the environments in a central location for future pipeline runs.
- If you are using
-
Run your own analysis
-
[Optional] Generate an input samplesheet from a directory containing Illumina FASTQ files (e.g.
/path/to/illumina_run/Data/Intensities/Basecalls/
) with the included Python scriptfastq_dir_to_samplesheet.py
before you run the pipeline (requires Python 3 installed locally) e.g.python ~/.nextflow/assets/CFIA-NCFAD/nf-flu/bin/fastq_dir_to_samplesheet.py \ -i /path/to/illumina_run/Data/Intensities/Basecalls/ \ -o samplesheet.csv
-
Typical command for Illumina Platform
nextflow run CFIA-NCFAD/nf-flu \ --input samplesheet.csv \ --platform illumina \ --profile <docker/singularity/podman/shifter/charliecloud/conda>
-
Typical command for Nanopore Platform
nextflow run CFIA-NCFAD/nf-flu \ --input samplesheet.csv \ --platform nanopore \ --profile <docker/singularity/conda>
-
The nf-flu pipeline comes with:
Danecek, P., Bonfield, J.K., Liddle, J., Marshall, J., Ohan, V., Pollard, M.O., Whitwham, A., Keane, T., McCarthy, S.A., Davies, R.M., Li, H., 2021. Twelve years of SAMtools and BCFtools. Gigascience 10, giab008. https://doi.org/10.1093/gigascience/giab008
BLAST Basic Local Alignment Search Tool
Altschul, S.F., Gish, W., Miller, W., Myers, E.W., Lipman, D.J., 1990. Basic local alignment search tool. J. Mol. Biol. 215, 403–410. https://doi.org/10.1016/S0022-2836(05)80360-2
Camacho, C., Coulouris, G., Avagyan, V., Ma, N., Papadopoulos, J., Bealer, K., Madden, T.L., 2009. BLAST+: architecture and applications. BMC Bioinformatics 10, 421. https://doi.org/10.1186/1471-2105-10-421
Zheng, Z., Li, S., Su, J., Leung, A.W.-S., Lam, T.-W., Luo, R., 2022. Symphonizing pileup and full-alignment for deep learning-based long-read variant calling. Nat Comput Sci 2, 797–803. https://doi.org/10.1038/s43588-022-00387-x
FluMut is used to "search for molecular markers with potential impact on the biological characteristics of Influenza A viruses of the A(H5N1) subtype, starting from complete or partial nucleotide genome sequences".
https://github.com/izsvenezie-virology/FluMut
NOTE: Since the FluMut paper has not been published yet, the authors recommend citing the GitHub repository as of 2024-12-02.
Freebayes is used for variant calling.
Garrison, E., Marth, G., 2012. Haplotype-based variant detection from short-read sequencing. arXiv:1207.3907 [q-bio]. https://doi.org/10.48550/arXiv.1207.3907
IRMA Iterative Refinement Meta-Assembler
Shepard, S.S., Meno, S., Bahl, J., Wilson, M.M., Barnes, J., Neuhaus, E., 2016. Viral deep sequencing needs an adaptive approach: IRMA, the iterative refinement meta-assembler. BMC Genomics 17, 708. https://doi.org/10.1186/s12864-016-3030-6
Medaka is deprecated in favour of Clair3 for variant calling of Nanopore data.
Minimap2 is used for rapid and accurate read alignment to reference sequences.
Li, H., 2018. Minimap2: pairwise alignment for nucleotide sequences. Bioinformatics 34, 3094–3100. https://doi.org/10.1093/bioinformatics/bty191
Mosdepth is used for rapid sequencing coverage calculation and summary statistics.
Pedersen, B.S., Quinlan, A.R., 2017. Mosdepth: quick coverage calculation for genomes and exomes. Bioinformatics 34, 867–868. https://doi.org/10.1093/bioinformatics/btx699
MultiQC is used for generation of a single report for multiple tools.
Ewels, P., Magnusson, M., Lundin, S., Käller, M., 2016. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics 32, 3047–3048. https://doi.org/10.1093/bioinformatics/btw354
nf-flu relies on publicly available Influenza sequence data from NCBI available at the NCBI Influenza Virus Resource, which is downloaded from the FTP site.
NCBI Influenza Virus Resource:
Bao, Y., Bolotov, P., Dernovoy, D., Kiryutin, B., Zaslavsky, L., Tatusova, T., Ostell, J., Lipman, D., 2008. The influenza virus resource at the National Center for Biotechnology Information. J Virol 82, 596–601. https://doi.org/10.1128/JVI.02005-07
NCBI Influenza Virus Sequence Annotation Tool:
Bao, Y., Bolotov, P., Dernovoy, D., Kiryutin, B., Tatusova, T., 2007. FLAN: a web server for influenza virus genome annotation. Nucleic Acids Res 35, W280-284. https://doi.org/10.1093/nar/gkm354
nf-flu is implemented in Nextflow.
Tommaso, P.D., Chatzou, M., Floden, E.W., Barja, P.P., Palumbo, E., Notredame, C., 2017. Nextflow enables reproducible computational workflows. Nat Biotechnol 35, 316–319. https://doi.org/10.1038/nbt.3820
nf-core is a great resource for building robust and reproducible bioinformatics pipelines.
Ewels, P.A., Peltzer, A., Fillinger, S., Patel, H., Alneberg, J., Wilm, A., Garcia, M.U., Di Tommaso, P., Nahnsen, S., 2020. The nf-core framework for community-curated bioinformatics pipelines. Nat Biotechnol 38, 276–278. https://doi.org/10.1038/s41587-020-0439-x
seqtk is used for rapid manipulation of FASTA/Q files. Available from GitHub at lh3/seqtk
VADR is used for annotation of Influenza virus sequences.
Alejandro A Schäffer, Eneida L Hatcher, Linda Yankie, Lara Shonkwiler, J Rodney Brister, Ilene Karsch-Mizrachi, Eric P Nawrocki; VADR: validation and annotation of virus sequence submissions to GenBank. BMC Bioinformatics 21, 211 (2020). https://doi.org/10.1186/s12859-020-3537-3
table2asn is used for converting the VADR Feature Table format output to Genbank format to help with conversion to other formats such as FASTA and GFF.
- Peter Kruczkiewicz (CFIA-NCFAD) - lead developer
- Hai Nguyen (CFIA-NCFAD) - Nanopore workflow
- Abdallah Meknas (Influenza, Respiratory Viruses, and Coronavirus Section (IRVC), Public Health Agency of Canada (PHAC)) - expansion of the Illumina workflow
- nf-core project for establishing Nextflow workflow development best-practices, nf-core tools and nf-core modules
- nf-core/viralrecon for inspiration and setting a high standard for viral sequence data analysis pipelines
- Conda and Bioconda project for making it easy to install, distribute and use bioinformatics software.
- Biocontainers for automatic creation of Docker and Singularity containers for bioinformatics software in [Bioconda]