Skip to content

Commit

Permalink
feat: add FluMut
Browse files Browse the repository at this point in the history
  • Loading branch information
peterk87 committed Dec 2, 2024
1 parent cb9f619 commit b185045
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [[3.6.0](https://github.com/CFIA-NCFAD/nf-flu/releases/tag/3.6.0)] - 2024-12-02

This minor release adds [FluMut](https://github.com/izsvenezie-virology/FluMut) to "to search for molecular markers with potential impact on the biological characteristics of Influenza A viruses of the A(H5N1) subtype."

### Changes

* **feat**: Added FluMut (v0.6.3)

## [[3.5.3](https://github.com/CFIA-NCFAD/nf-flu/releases/tag/3.5.3)] - 2024-11-01

This patch release fixes an issue ([#22](https://github.com/peterk87/nf-flu/issues/22)) with Illumina paired-end read analysis by IRMA producing empty consensus sequences when the forward and reverse reads do not contain "1:N:0:." or "2:N:0:." in the FASTQ header lines.
Expand Down
10 changes: 10 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ process {
withName: 'BLAST_BLASTN.*' {
ext.args = '-outfmt "6 qaccver saccver pident length mismatch gapopen qstart qend sstart send evalue bitscore qlen slen qcovs stitle" -num_alignments 1000000 -evalue 1e-6'
}
withName: '.*FLUMUT.*' {
ext.args = ''
publishDir = [
[
path: { "${params.outdir}/flumut" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
mode: params.publish_dir_mode
]
]
}
withName: 'IRMA' {
publishDir = [
[
Expand Down
19 changes: 17 additions & 2 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The directories listed below will be created in the results directory after the
- [Variant Calling](#variant-calling)
- [H/N Subtyping](#hn-subtyping)
- [Annotation](#annotation)
- [FluMut](#flumut)

### IRMA

Expand Down Expand Up @@ -263,6 +264,19 @@ Consensus sequences are annotated using [VADR][]. The output files are available

</details>

### FluMut

Consensus sequences are analyzed using [FluMut] to identify mutations of interest, specifically for H5N1. The output files are available in multiple formats including Excel and TSV.

<details markdown="1">
<summary>Output files</summary>

- `flumut/`
- `flumut.xlsm`: Excel file containing all the results from the FluMut analysis.
- `flumut-markers.tsv`: Tab-separated file containing the list of detected markers by FluMut analysis.
- `flumut-mutations.tsv`: Tab-separated file containing the list of amino acids present in the positions of mutations of interest for each sample by FluMut analysis.
- `seqs-for-flumut.fasta`: FASTA file containing the sequences of the samples that were analyzed by FluMut.

### Pipeline information

<details markdown="1">
Expand All @@ -278,7 +292,8 @@ Consensus sequences are annotated using [VADR][]. The output files are available

[Nextflow](https://www.nextflow.io/docs/latest/tracing.html) 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.

[NCBI Influenza DB]: https://www.ncbi.nlm.nih.gov/genomes/FLU/Database/nph-select.cgi?go=database
[IRMA]: https://wonder.cdc.gov/amd/flu/irma/
[BLAST]: https://blast.ncbi.nlm.nih.gov/Blast.cgi
[FluMut]: https://github.com/izsvenezie-virology/FluMut
[IRMA]: https://wonder.cdc.gov/amd/flu/irma/
[NCBI Influenza DB]: https://www.ncbi.nlm.nih.gov/genomes/FLU/Database/nph-select.cgi?go=database
[VADR]: https://github.com/ncbi/vadr
57 changes: 57 additions & 0 deletions modules/local/flumut.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
process PREP_FLUMUT_FASTA {
conda 'bioconda::bcftools=1.20 conda-forge::gsl=2.7'
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0'
} else {
container 'quay.io/biocontainers/bcftools:1.20--h8b25389_0'
}

input:
path(fastas)

output:
path('seqs-for-flumut.fasta'), emit: fasta

script:
"""
awk 'BEGIN {FS=OFS=""}
/^>/ {
gsub(/_segment7_M/, "_MP", \$0); # Replace "_segment7_M" with "_MP"
gsub(/segment[0-9]+_/, "", \$0); # Remove "segment1-9_"
}
{print}' $fastas > seqs-for-flumut.fasta
"""
}

process FLUMUT {
label 'process_low'

conda 'bioconda::flumut=0.6.3'
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container 'https://depot.galaxyproject.org/singularity/flumut:0.6.3--pyhdfd78af_0'
} else {
container 'quay.io/biocontainers/flumut:0.6.3--pyhdfd78af_0'
}

input:
path(fasta)

output:
path('flumut.xlsm'), emit: xlsm
path('flumut-markers.tsv'), emit: markers
path('flumut-mutations.tsv'), emit: mutations
path "versions.yml" , emit: versions

script:
"""
flumut \\
-x flumut.xlsm \\
-m flumut-markers.tsv \\
-M flumut-mutations.tsv \\
$fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
flumut: \$(flumut --version 2>&1 | sed 's/^.*flumut, version //;s/, .*//')
"""
}
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ manifest {
description = 'Influenza A virus genome assembly pipeline'
homePage = 'https://github.com/CFIA-NCFAD/nf-flu'
author = 'Peter Kruczkiewicz, Hai Nguyen'
version = '3.5.3'
version = '3.6.0'
nextflowVersion = '!>=22.10.1'
mainScript = 'main.nf'
doi = '10.5281/zenodo.13892044'
Expand Down
2 changes: 1 addition & 1 deletion tests/run-nanopore-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ done

shift $((OPTIND-1))

if [[ "$1" == "--" ]]; then
if [[ "${1:-}" == "--" ]]; then
shift
fi

Expand Down
5 changes: 5 additions & 0 deletions workflows/illumina.nf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ include { PRE_TABLE2ASN as PRE_TABLE2ASN_BCFTOOLS
include { TABLE2ASN as TABLE2ASN_BCFTOOLS } from '../modules/local/table2asn'
include { POST_TABLE2ASN as POST_TABLE2ASN_BCFTOOLS } from '../modules/local/table2asn'
include { MQC_VERSIONS_TABLE } from '../modules/local/mqc_versions_table'
include { FLUMUT; PREP_FLUMUT_FASTA } from '../modules/local/flumut'

//=============================================================================
// Workflow Params Setup
Expand Down Expand Up @@ -265,6 +266,10 @@ workflow ILLUMINA {
)
ch_versions = ch_versions.mix(SUBTYPING_REPORT_BCF_CONSENSUS.out.versions)

PREP_FLUMUT_FASTA(CAT_CONSENSUS.out.consensus_fasta.collect({ it[1] }))
FLUMUT(PREP_FLUMUT_FASTA.out.fasta)
ch_versions = ch_versions.mix(FLUMUT.out.versions)

workflow_summary = Schema.params_summary_multiqc(workflow, summary_params)
ch_workflow_summary = Channel.value(workflow_summary)
ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yaml")
Expand Down
5 changes: 5 additions & 0 deletions workflows/nanopore.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ include { BLAST_BLASTN as BLAST_BLASTN_CONSENSUS } from '../modules
include { BLAST_BLASTN as BLAST_BLASTN_CONSENSUS_REF_DB } from '../modules/local/blastn'
include { SETUP_FLU_VADR_MODEL; VADR; VADR_SUMMARIZE_ISSUES } from '../modules/local/vadr'
include { PRE_TABLE2ASN; TABLE2ASN; POST_TABLE2ASN } from '../modules/local/table2asn'
include { FLUMUT; PREP_FLUMUT_FASTA } from '../modules/local/flumut'
include { MULTIQC } from '../modules/local/multiqc'
include { MQC_VERSIONS_TABLE } from '../modules/local/mqc_versions_table'

Expand Down Expand Up @@ -284,6 +285,10 @@ workflow NANOPORE {
ch_versions = ch_versions.mix(BLASTN_REPORT.out.versions)
}

PREP_FLUMUT_FASTA(CAT_CONSENSUS.out.consensus_fasta.collect({ it[1] }))
FLUMUT(PREP_FLUMUT_FASTA.out.fasta)
ch_versions = ch_versions.mix(FLUMUT.out.versions)

workflow_summary = Schema.params_summary_multiqc(workflow, summary_params)
ch_workflow_summary = Channel.value(workflow_summary)
ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yaml")
Expand Down

0 comments on commit b185045

Please sign in to comment.