Skip to content

Commit 032d370

Browse files
authored
Merge pull request #5 from UPHL-BioNGS/Tom_dev_231227
Tom dev 231227
2 parents 972d002 + 9a03aad commit 032d370

10 files changed

Lines changed: 97 additions & 24 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"python.linting.flake8Path": "/opt/conda/bin/flake8",
1818
"python.linting.pycodestylePath": "/opt/conda/bin/pycodestyle",
1919
"python.linting.pydocstylePath": "/opt/conda/bin/pydocstyle",
20-
"python.linting.pylintPath": "/opt/conda/bin/pylint"
20+
"python.linting.pylintPath": "/opt/conda/bin/pylint",
2121
},
2222

2323
// Add the IDs of extensions you want installed when the container is created.
24-
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"]
25-
}
26-
}
24+
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"],
25+
},
26+
},
2727
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
3535
> **Currently prepares influenza samples (paired-end FASTQ files) for assembly. These steps also provide different quality reports for sample evaluation.**
3636
3737
* Combine FASTQ file lanes, if they were provided with multiple lanes, into unified FASTQ files to ensure they are organized and named consistently (`Lane_Merge`).
38-
* Remove human read data with the ([`NCBI_SRA_Human_Scrubber`](https://github.com/ncbi/sra-human-scrubber) for uploading reads to to public repositories for DNA sequencing data.
38+
* Remove human read data with the [`NCBI_SRA_Human_Scrubber`](https://github.com/ncbi/sra-human-scrubber) for uploading reads to to public repositories for DNA sequencing data.
3939
* Filter unpaired reads from FASTQ files (`SeqKit_Pair`).
4040
* Trim reads and assess quality (`FaQCs`).
4141
* Remove adapter sequences and phix reference with (`BBMap_BBDuk`).
@@ -51,6 +51,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
5151
* Assembly of influenza gene segments with (`IRMA`) using the built-in FLU module. Also, influenza typing and H/N subtype classifications are made.
5252
* QC of consensus assembly (`IRMA_Consensus_QC`).
5353
* Generate IRMA consensus QC report (`IRMA_Consensus_QC_Reportsheet`)
54+
* Annotation of IRMA consensus sequences with (`VADR`)
5455
* Influenza A type and H/N subtype classification as well as influenza B type and lineage classification using (`Abricate_Flu`). The database used in this task is [InsaFlu](https://genomemedicine.biomedcentral.com/articles/10.1186/s13073-018-0555-0).
5556
* Generate a summary report for influenza classification results (`IMRA_Abricate_Reportsheet`).
5657
* Gather corresponding Nextclade dataset using the Abricate_Flu classifcation results (`Nextclade_Variables`).

conf/modules.config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ process {
156156
pattern: "*"
157157
]
158158
}
159+
withName: 'VADR' {
160+
ext.args = '--minlen 60'
161+
ext.args2 = '--split --cpu 8 -r --atgonly --xnocomp --nomisc --alt_fail extrant5,extrant3 --mkey flu'
162+
ext.when = { }
163+
publishDir = [
164+
enabled: true,
165+
mode: "${params.publish_dir_mode}",
166+
path: { "${params.outdir}/vadr"},
167+
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
168+
]
169+
}
159170
withName: ABRICATE_FLU {
160171
ext.args = '--db insaflu --minid 70 --mincov 60'
161172
ext.when = { }

docs/output.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ results/
3131
├── pipeline_info
3232
├── qc_report
3333
├── reports
34-
└── SUMMARY_REPORT
34+
├── SUMMARY_REPORT
35+
└── vadr
3536
```
3637

3738
## Pipeline overview
@@ -92,6 +93,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
9293
* Assembly of influenza gene segments with (`IRMA`) using the built-in FLU module. Also, influenza typing and H/N subtype classifications are made.
9394
* QC of consensus assembly (`IRMA_Consensus_QC`).
9495
* Generate IRMA consensus QC report (`IRMA_Consensus_QC_Reportsheet`)
96+
* Annotation of IRMA consensus sequences with (`VADR`)
9597
* Influenza A type and H/N subtype classification as well as influenza B type and lineage classification using (`Abricate_Flu`). The database used in this task is [InsaFlu](https://genomemedicine.biomedcentral.com/articles/10.1186/s13073-018-0555-0).
9698
* Generate a summary report for influenza classification results (`IMRA_Abricate_Reportsheet`).
9799
* Gather corresponding Nextclade dataset using the Abricate_Flu classifcation results (`Nextclade_Variables`).

modules/local/vadr.nf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
process VADR {
2+
tag "$meta.id"
3+
label 'process_medium'
4+
5+
container 'quay.io/staphb/vadr:1.6.3'
6+
7+
input:
8+
tuple val(meta), path(assembly)
9+
10+
output:
11+
tuple val(meta), path("${meta.id}/") , optional:true, emit: vadr
12+
path "*.vadr.log" , emit: log
13+
14+
when:
15+
task.ext.when == null || task.ext.when
16+
17+
script:
18+
def args = task.ext.args ?: ''
19+
def args2 = task.ext.args2 ?: ""
20+
def prefix = task.ext.prefix ?: "${meta.id}"
21+
def vadr_log = "${meta.id}.vadr.log"
22+
23+
"""
24+
fasta-trim-terminal-ambigs.pl \\
25+
$args \\
26+
$assembly > ${meta.id}.vadr_trimmed.fasta
27+
28+
v-annotate.pl \\
29+
$args2 \\
30+
${meta.id}.vadr_trimmed.fasta \\
31+
$meta.id
32+
33+
# Soft link for traceability
34+
ln -s .command.log $vadr_log
35+
36+
cat <<-END_VERSIONS > versions.yml
37+
"${task.process}":
38+
vadr: \$(vadr --version 2>&1 | sed 's/^.*vadr //')
39+
END_VERSIONS
40+
"""
41+
}

nextflow.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ params {
5959
irma_module = "FLU"
6060
genome_length = 13500
6161
keep_ref_deletions = true
62+
skip_ncbi_sra_human_scrubber = false
63+
skip_vadr = false
6264
skip_kraken2 = false
6365
skip_nextclade = false
6466
adapters_fasta = 'https://raw.githubusercontent.com/BioInfoTools/BBMap/master/resources/adapters.fa'

nextflow_schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,16 @@
315315
"default": false,
316316
"description": "Skip Kraken2 option."
317317
},
318+
"skip_ncbi_sra_human_scrubber": {
319+
"type": "boolean",
320+
"default": false,
321+
"description": "Skip NCBI SRA human scrubber option."
322+
},
323+
"skip_vadr": {
324+
"type": "boolean",
325+
"default": false,
326+
"description": "Skip the VADR module option."
327+
},
318328
"skip_nextclade": {
319329
"type": "boolean",
320330
"default": false,

subworkflows/local/assembly_typing_clade_variables.nf

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
include { IRMA } from '../../modules/local/irma.nf'
88
include { IRMA_CONSENSUS_QC } from '../../modules/local/irma_consensus_qc.nf'
99
include { IRMA_CONSENSUS_QC_REPORTSHEET } from '../../modules/local/irma_consensus_qc_reportsheet.nf'
10+
include { VADR } from '../../modules/local/vadr.nf'
1011
include { ABRICATE_FLU } from '../../modules/local/abricate_flu.nf'
1112
include { IRMA_ABRICATE_REPORT } from '../../modules/local/irma_abricate_report'
1213
include { IRMA_ABRICATE_REPORTSHEET } from '../../modules/local/irma_abricate_reportsheet.nf'
@@ -18,7 +19,7 @@ include { NEXTCLADE_VARIABLES } from '../../modules/local/nextc
1819
============================================================================================================
1920
*/
2021

21-
def irma_module = 'FLU'
22+
def irma_module = ''
2223
if (params.irma_module) {
2324
irma_module = params.irma_module
2425
}
@@ -34,11 +35,10 @@ workflow ASSEMBLY_TYPING_CLADE_VARIABLES {
3435
clean_reads // file: /path/to/BBMAP_BBDUK/'*.clean*.fastq.gz'
3536

3637
main:
37-
ch_versions = Channel.empty()
38-
ch_assembly = Channel.empty()
39-
ch_HA = Channel.empty()
40-
ch_NA = Channel.empty()
41-
ch_dataset = Channel.empty()
38+
ch_versions = Channel.empty()
39+
ch_assembly = Channel.empty()
40+
ch_HA = Channel.empty()
41+
ch_NA = Channel.empty()
4242

4343
IRMA(clean_reads, irma_module)
4444
ch_assembly = IRMA.out.assembly
@@ -66,6 +66,10 @@ workflow ASSEMBLY_TYPING_CLADE_VARIABLES {
6666
IRMA_CONSENSUS_QC_REPORTSHEET(ch_irma_consensus_qc_results)
6767
irma_consensus_qc_tsv = IRMA_CONSENSUS_QC_REPORTSHEET.out.irma_consensus_qc_tsv
6868

69+
if ( !params.skip_vadr ) {
70+
VADR(IRMA.out.assembly)
71+
}
72+
6973
ABRICATE_FLU(IRMA.out.assembly)
7074
ch_versions = ch_versions.mix(ABRICATE_FLU.out.versions)
7175

@@ -104,12 +108,12 @@ workflow ASSEMBLY_TYPING_CLADE_VARIABLES {
104108
)
105109

106110
emit:
107-
HA = IRMA.out.HA
108-
NA = IRMA.out.NA
109-
typing_report_tsv = IRMA_ABRICATE_REPORTSHEET.out.typing_report_tsv
110-
irma_consensus_qc_tsv = IRMA_CONSENSUS_QC_REPORTSHEET.out.irma_consensus_qc_tsv
111-
assembly = ch_assembly
112-
dataset = ch_dataset
113-
versions = ch_versions
111+
HA = IRMA.out.HA
112+
NA = IRMA.out.NA
113+
typing_report_tsv = IRMA_ABRICATE_REPORTSHEET.out.typing_report_tsv
114+
irma_consensus_qc_tsv = IRMA_CONSENSUS_QC_REPORTSHEET.out.irma_consensus_qc_tsv
115+
assembly = ch_assembly
116+
dataset = ch_dataset
117+
versions = ch_versions
114118

115119
}

subworkflows/local/preprocessing_read_qc.nf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ workflow PREPROCESSING_READ_QC {
3232
ch_kraken2reportsheet = Channel.empty()
3333
ch_kraken2_reportsheet_tsv = Channel.empty()
3434

35-
NCBI_SRA_HUMAN_SCRUBBER(reads)
36-
ch_versions = ch_versions.mix(NCBI_SRA_HUMAN_SCRUBBER.out.versions)
35+
if ( !params.skip_ncbi_sra_human_scrubber ) {
36+
NCBI_SRA_HUMAN_SCRUBBER(reads)
37+
ch_versions = ch_versions.mix(NCBI_SRA_HUMAN_SCRUBBER.out.versions)
38+
}
3739

3840
SEQKIT_PAIR(reads)
3941
ch_versions = ch_versions.mix(SEQKIT_PAIR.out.versions)
@@ -51,7 +53,7 @@ workflow PREPROCESSING_READ_QC {
5153
ch_versions = ch_versions.mix(QC_REPORT.out.versions)
5254

5355
if ( !params.skip_kraken2 ) {
54-
KRAKEN2_KRAKEN2(reads, db, false, true)
56+
KRAKEN2_KRAKEN2(BBMAP_BBDUK.out.clean_reads, db, false, true)
5557
ch_versions = ch_versions.mix(KRAKEN2_KRAKEN2.out.versions)
5658

5759
ch_kraken2report_summary_input = KRAKEN2_KRAKEN2.out.txt

workflows/walkercreek.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ workflow WALKERCREEK {
206206
/*
207207
SUBWORKFLOW: ASSEMBLY_TYPING_CLADE_VARIABLES - assembly, flu typing/subtyping, and Nextclade variable determination based upon flu 'abricate_subtype'
208208
*/
209-
ASSEMBLY_TYPING_CLADE_VARIABLES(ch_all_reads)
209+
ASSEMBLY_TYPING_CLADE_VARIABLES(PREPROCESSING_READ_QC.out.clean_reads)
210210
ch_assembly = ASSEMBLY_TYPING_CLADE_VARIABLES.out.assembly
211211
ch_HA = ASSEMBLY_TYPING_CLADE_VARIABLES.out.HA
212212
ch_NA = ASSEMBLY_TYPING_CLADE_VARIABLES.out.NA
@@ -229,7 +229,7 @@ workflow WALKERCREEK {
229229
//
230230
// MODULE: Run FastQC
231231
//
232-
FASTQC (ch_all_reads)
232+
FASTQC (PREPROCESSING_READ_QC.out.clean_reads)
233233
ch_versions = ch_versions.mix(FASTQC.out.versions.first())
234234

235235
//

0 commit comments

Comments
 (0)