1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-22 09:49:57 +00:00

Module update

This commit is contained in:
James Fellows Yates 2022-09-08 08:08:36 +02:00
parent 6f87c681fd
commit d11257b330
22 changed files with 354 additions and 207 deletions

View file

@ -3,104 +3,140 @@
"homePage": "https://github.com/nf-core/taxprofiler", "homePage": "https://github.com/nf-core/taxprofiler",
"repos": { "repos": {
"nf-core/modules": { "nf-core/modules": {
"git_url": "https://github.com/nf-core/modules.git",
"modules": {
"adapterremoval": { "adapterremoval": {
"branch": "master",
"git_sha": "879d42c5e28661fe0a5e744c9e2c515868f9e08a" "git_sha": "879d42c5e28661fe0a5e744c9e2c515868f9e08a"
}, },
"bbmap/bbduk": { "bbmap/bbduk": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
"git_sha": "848ee9a215d02d80be033bfa60881700f2bd914c"
}, },
"bowtie2/align": { "bowtie2/align": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
"git_sha": "848ee9a215d02d80be033bfa60881700f2bd914c"
}, },
"bowtie2/build": { "bowtie2/build": {
"branch": "master",
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
}, },
"cat/fastq": { "cat/fastq": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
"git_sha": "b034029b59b1198075da8019074bc02051a6100e"
}, },
"centrifuge/centrifuge": { "centrifuge/centrifuge": {
"branch": "master",
"git_sha": "d2726fcf75063960f06b36d2229a4c0966614108" "git_sha": "d2726fcf75063960f06b36d2229a4c0966614108"
}, },
"centrifuge/kreport": { "centrifuge/kreport": {
"branch": "master",
"git_sha": "734d0db6079a4aa43b6509b207e5d6feb35d4838" "git_sha": "734d0db6079a4aa43b6509b207e5d6feb35d4838"
}, },
"custom/dumpsoftwareversions": { "custom/dumpsoftwareversions": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
"git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247"
}, },
"diamond/blastx": { "diamond/blastx": {
"branch": "master",
"git_sha": "3531824af826c16cd252bc5aa82ae169b244ebaa" "git_sha": "3531824af826c16cd252bc5aa82ae169b244ebaa"
}, },
"fastp": { "fastp": {
"git_sha": "d0a1cbb703a130c19f6796c3fce24fbe7dfce789" "branch": "master",
"git_sha": "7e8ad566883449e7939062b5e2bcf53fc1e0002f"
}, },
"fastqc": { "fastqc": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
"git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe"
}, },
"filtlong": { "filtlong": {
"branch": "master",
"git_sha": "957cb9b83668075f4af101fc99502908cca487e3" "git_sha": "957cb9b83668075f4af101fc99502908cca487e3"
}, },
"gunzip": { "gunzip": {
"git_sha": "9aadd9a6d3f5964476582319b3a1c54a3e3fe7c9" "branch": "master",
"git_sha": "fa37e0662690c4ec4260dae282fbce08777503e6"
}, },
"kaiju/kaiju": { "kaiju/kaiju": {
"branch": "master",
"git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe" "git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe"
}, },
"kaiju/kaiju2krona": { "kaiju/kaiju2krona": {
"branch": "master",
"git_sha": "2f0b19240430de6807b1232e6d9d0e8084e8a28f" "git_sha": "2f0b19240430de6807b1232e6d9d0e8084e8a28f"
}, },
"kaiju/kaiju2table": { "kaiju/kaiju2table": {
"branch": "master",
"git_sha": "538dbac98ba9c8f799536cd5a617195501439457" "git_sha": "538dbac98ba9c8f799536cd5a617195501439457"
}, },
"kraken2/kraken2": { "kraken2/kraken2": {
"git_sha": "abe025677cdd805cc93032341ab19885473c1a07" "branch": "master",
"git_sha": "409a308ba46284d8ebb48c2c1befd6f6433db3f7"
}, },
"krakentools/kreport2krona": { "krakentools/kreport2krona": {
"git_sha": "8b2a473f586bed003e72d2b183acc43fc0ddc422" "branch": "master",
"git_sha": "233fa70811a03a4cecb2ece483b5c8396e2cee1d"
}, },
"krona/ktimporttaxonomy": { "krona/ktimporttaxonomy": {
"branch": "master",
"git_sha": "0e9fd9370ad1845870b8a9c63fcc47d999a1739e" "git_sha": "0e9fd9370ad1845870b8a9c63fcc47d999a1739e"
}, },
"krona/ktimporttext": { "krona/ktimporttext": {
"branch": "master",
"git_sha": "cdefbec66999c0b49d8bfeea9d6f9d19056635a2" "git_sha": "cdefbec66999c0b49d8bfeea9d6f9d19056635a2"
}, },
"malt/run": { "malt/run": {
"branch": "master",
"git_sha": "be8d7b3293cac26cc63e4dbfb364deb8ed6ec7e5" "git_sha": "be8d7b3293cac26cc63e4dbfb364deb8ed6ec7e5"
}, },
"megan/rma2info": { "megan/rma2info": {
"branch": "master",
"git_sha": "2d38566eca4cc15142b2ffa7c11837569b39aece" "git_sha": "2d38566eca4cc15142b2ffa7c11837569b39aece"
}, },
"metaphlan3": { "metaphlan3/metaphlan3": {
"git_sha": "ed4dd1a928ebf4308efb720de878045f7773f8e2" "branch": "master",
"git_sha": "940d7fe9d63962e0e2ba0987e2893fb0aff832e3"
}, },
"minimap2/align": { "minimap2/align": {
"branch": "master",
"git_sha": "1a5a9e7b4009dcf34e6867dd1a5a1d9a718b027b" "git_sha": "1a5a9e7b4009dcf34e6867dd1a5a1d9a718b027b"
}, },
"minimap2/index": { "minimap2/index": {
"branch": "master",
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
}, },
"motus/merge": { "motus/merge": {
"branch": "master",
"git_sha": "b02e648c221e1da17cb589eefe297e61ec9e9c49" "git_sha": "b02e648c221e1da17cb589eefe297e61ec9e9c49"
}, },
"motus/profile": { "motus/profile": {
"branch": "master",
"git_sha": "b6ed584443ad68ac41e6975994139454a4f23c18" "git_sha": "b6ed584443ad68ac41e6975994139454a4f23c18"
}, },
"multiqc": { "multiqc": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
"git_sha": "5138acca0985ca01c38a1c4fba917d83772b1106"
}, },
"porechop": { "porechop": {
"branch": "master",
"git_sha": "b78e19b9dae3671db2c7d4346fe04452c1debfab" "git_sha": "b78e19b9dae3671db2c7d4346fe04452c1debfab"
}, },
"prinseqplusplus": { "prinseqplusplus": {
"branch": "master",
"git_sha": "f1c5384c31e985591716afdd732cf8c2ae29d05b" "git_sha": "f1c5384c31e985591716afdd732cf8c2ae29d05b"
}, },
"samtools/bam2fq": { "samtools/bam2fq": {
"branch": "master",
"git_sha": "5510ea39fe638594bc26ac34cadf4a84bf27d159" "git_sha": "5510ea39fe638594bc26ac34cadf4a84bf27d159"
}, },
"samtools/view": { "samtools/view": {
"git_sha": "6b64f9cb6c3dd3577931cc3cd032d6fb730000ce" "branch": "master",
"git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247"
}, },
"untar": { "untar": {
"git_sha": "e080f4c8acf5760039ed12ec1f206170f3f9a918" "branch": "master",
"git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247"
}
} }
} }
} }

View file

@ -4,6 +4,7 @@ keywords:
- trimming - trimming
- adapter trimming - adapter trimming
- quality trimming - quality trimming
- fastq
tools: tools:
- bbmap: - bbmap:
description: BBMap is a short read aligner, as well as various other bioinformatic tools. description: BBMap is a short read aligner, as well as various other bioinformatic tools.

View file

@ -1,67 +1,62 @@
process BOWTIE2_ALIGN { process BOWTIE2_ALIGN {
tag "$meta.id" tag "$meta.id"
label 'process_high' label "process_high"
conda (params.enable_conda ? 'bioconda::bowtie2=2.4.4 bioconda::samtools=1.14 conda-forge::pigz=2.6' : null) conda (params.enable_conda ? "bioconda::bowtie2=2.4.4 bioconda::samtools=1.15.1 conda-forge::pigz=2.6" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == "singularity" && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:4d235f41348a00533f18e47c9669f1ecb327f629-0' : "https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:1744f68fe955578c63054b55309e05b41c37a80d-0" :
'quay.io/biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:4d235f41348a00533f18e47c9669f1ecb327f629-0' }" "quay.io/biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:1744f68fe955578c63054b55309e05b41c37a80d-0" }"
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
path index path index
val save_unaligned val save_unaligned
val sort_bam
output: output:
tuple val(meta), path('*.bam') , emit: bam tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path('*.log') , emit: log tuple val(meta), path("*.log") , emit: log
tuple val(meta), path('*fastq.gz'), emit: fastq, optional:true tuple val(meta), path("*fastq.gz"), emit: fastq, optional:true
path "versions.yml" , emit: versions path "versions.yml" , emit: versions
when: when:
task.ext.when == null || task.ext.when task.ext.when == null || task.ext.when
script: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ""
def args2 = task.ext.args2 ?: '' def args2 = task.ext.args2 ?: ""
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
if (meta.single_end) {
def unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : ''
"""
INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'`
bowtie2 \\
-x \$INDEX \\
-U $reads \\
--threads $task.cpus \\
$unaligned \\
$args \\
2> ${prefix}.bowtie2.log \\
| samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml def unaligned = ""
"${task.process}": def reads_args = ""
bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') if (meta.single_end) {
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : ""
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) reads_args = "-U ${reads}"
END_VERSIONS
"""
} else { } else {
def unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : ""
reads_args = "-1 ${reads[0]} -2 ${reads[1]}"
}
def samtools_command = sort_bam ? 'sort' : 'view'
""" """
INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'` INDEX=`find -L ./ -name "*.rev.1.bt2" | sed "s/.rev.1.bt2//"`
[ -z "\$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed "s/.rev.1.bt2l//"`
[ -z "\$INDEX" ] && echo "Bowtie2 index files not found" 1>&2 && exit 1
bowtie2 \\ bowtie2 \\
-x \$INDEX \\ -x \$INDEX \\
-1 ${reads[0]} \\ $reads_args \\
-2 ${reads[1]} \\
--threads $task.cpus \\ --threads $task.cpus \\
$unaligned \\ $unaligned \\
$args \\ $args \\
2> ${prefix}.bowtie2.log \\ 2> ${prefix}.bowtie2.log \\
| samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam - | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam -
if [ -f ${prefix}.unmapped.fastq.1.gz ]; then if [ -f ${prefix}.unmapped.fastq.1.gz ]; then
mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz
fi fi
if [ -f ${prefix}.unmapped.fastq.2.gz ]; then if [ -f ${prefix}.unmapped.fastq.2.gz ]; then
mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz
fi fi
@ -73,5 +68,4 @@ process BOWTIE2_ALIGN {
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS END_VERSIONS
""" """
}
} }

View file

@ -2,7 +2,9 @@ name: bowtie2_align
description: Align reads to a reference genome using bowtie2 description: Align reads to a reference genome using bowtie2
keywords: keywords:
- align - align
- map
- fasta - fasta
- fastq
- genome - genome
- reference - reference
tools: tools:
@ -29,6 +31,15 @@ input:
type: file type: file
description: Bowtie2 genome index files description: Bowtie2 genome index files
pattern: "*.ebwt" pattern: "*.ebwt"
- save_unaligned:
type: boolean
description: |
Save reads that do not map to the reference (true) or discard them (false)
(default: false)
- sort_bam:
type: boolean
description: use samtools sort (true) or samtools view (false)
pattern: "true or false"
output: output:
- bam: - bam:
type: file type: file

View file

@ -4,8 +4,8 @@ process CAT_FASTQ {
conda (params.enable_conda ? "conda-forge::sed=4.7" : null) conda (params.enable_conda ? "conda-forge::sed=4.7" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
'biocontainers/biocontainers:v1.2.0_cv1' }" 'ubuntu:20.04' }"
input: input:
tuple val(meta), path(reads, stageAs: "input*/*") tuple val(meta), path(reads, stageAs: "input*/*")
@ -48,4 +48,33 @@ process CAT_FASTQ {
""" """
} }
} }
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def readList = reads.collect{ it.toString() }
if (meta.single_end) {
if (readList.size > 1) {
"""
touch ${prefix}.merged.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
}
} else {
if (readList.size > 2) {
"""
touch ${prefix}_1.merged.fastq.gz
touch ${prefix}_2.merged.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
}
}
} }

View file

@ -1,11 +1,11 @@
process CUSTOM_DUMPSOFTWAREVERSIONS { process CUSTOM_DUMPSOFTWAREVERSIONS {
label 'process_low' label 'process_single'
// Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container
conda (params.enable_conda ? "bioconda::multiqc=1.11" : null) conda (params.enable_conda ? 'bioconda::multiqc=1.13a' : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0' : 'https://depot.galaxyproject.org/singularity/multiqc:1.13a--pyhdfd78af_1' :
'quay.io/biocontainers/multiqc:1.11--pyhdfd78af_0' }" 'quay.io/biocontainers/multiqc:1.13a--pyhdfd78af_1' }"
input: input:
path versions path versions

View file

@ -1,10 +1,9 @@
#!/usr/bin/env python #!/usr/bin/env python
import yaml
import platform import platform
from textwrap import dedent from textwrap import dedent
import yaml
def _make_versions_html(versions): def _make_versions_html(versions):
html = [ html = [
@ -59,8 +58,7 @@ versions_by_module = {}
for process, process_versions in versions_by_process.items(): for process, process_versions in versions_by_process.items():
module = process.split(":")[-1] module = process.split(":")[-1]
try: try:
if versions_by_module[module] != process_versions: assert versions_by_module[module] == process_versions, (
raise AssertionError(
"We assume that software versions are the same between all modules. " "We assume that software versions are the same between all modules. "
"If you see this error-message it means you discovered an edge-case " "If you see this error-message it means you discovered an edge-case "
"and should open an issue in nf-core/tools. " "and should open an issue in nf-core/tools. "

View file

@ -13,7 +13,7 @@ process FASTP {
val save_merged val save_merged
output: output:
tuple val(meta), path('*.trim.fastq.gz') , optional:true, emit: reads tuple val(meta), path('*.fastp.fastq.gz') , optional:true, emit: reads
tuple val(meta), path('*.json') , emit: json tuple val(meta), path('*.json') , emit: json
tuple val(meta), path('*.html') , emit: html tuple val(meta), path('*.html') , emit: html
tuple val(meta), path('*.log') , emit: log tuple val(meta), path('*.log') , emit: log
@ -28,19 +28,23 @@ process FASTP {
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
// Added soft-links to original fastqs for consistent naming in MultiQC // Added soft-links to original fastqs for consistent naming in MultiQC
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
// Use single ended for interleaved. Add --interleaved_in in config.
if (meta.single_end) { if (meta.single_end) {
def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : ''
""" """
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz [ ! -f ${prefix}.fastq.gz ] && ln -sf $reads ${prefix}.fastq.gz
fastp \\ cat ${prefix}.fastq.gz \\
| fastp \\
--stdin \\
--stdout \\
--in1 ${prefix}.fastq.gz \\ --in1 ${prefix}.fastq.gz \\
--out1 ${prefix}.trim.fastq.gz \\
--thread $task.cpus \\ --thread $task.cpus \\
--json ${prefix}.fastp.json \\ --json ${prefix}.fastp.json \\
--html ${prefix}.fastp.html \\ --html ${prefix}.fastp.html \\
$fail_fastq \\ $fail_fastq \\
$args \\ $args \\
2> ${prefix}.fastp.log 2> ${prefix}.fastp.log \\
| gzip -c > ${prefix}.fastp.fastq.gz
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":
fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g")
@ -50,13 +54,13 @@ process FASTP {
def fail_fastq = save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' def fail_fastq = save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : ''
def merge_fastq = save_merged ? "-m --merged_out ${prefix}.merged.fastq.gz" : '' def merge_fastq = save_merged ? "-m --merged_out ${prefix}.merged.fastq.gz" : ''
""" """
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -f ${prefix}_1.fastq.gz ] && ln -sf ${reads[0]} ${prefix}_1.fastq.gz
[ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz [ ! -f ${prefix}_2.fastq.gz ] && ln -sf ${reads[1]} ${prefix}_2.fastq.gz
fastp \\ fastp \\
--in1 ${prefix}_1.fastq.gz \\ --in1 ${prefix}_1.fastq.gz \\
--in2 ${prefix}_2.fastq.gz \\ --in2 ${prefix}_2.fastq.gz \\
--out1 ${prefix}_1.trim.fastq.gz \\ --out1 ${prefix}_1.fastp.fastq.gz \\
--out2 ${prefix}_2.trim.fastq.gz \\ --out2 ${prefix}_2.fastp.fastq.gz \\
--json ${prefix}.fastp.json \\ --json ${prefix}.fastp.json \\
--html ${prefix}.fastp.html \\ --html ${prefix}.fastp.html \\
$fail_fastq \\ $fail_fastq \\

View file

@ -15,7 +15,7 @@ input:
- meta: - meta:
type: map type: map
description: | description: |
Groovy Map containing sample information Groovy Map containing sample information. Use 'single_end: true' to specify single ended or interleaved FASTQs. Use 'single_end: false' for paired-end reads.
e.g. [ id:'test', single_end:false ] e.g. [ id:'test', single_end:false ]
- reads: - reads:
type: file type: file
@ -38,7 +38,7 @@ output:
- reads: - reads:
type: file type: file
description: The trimmed/modified/unmerged fastq reads description: The trimmed/modified/unmerged fastq reads
pattern: "*trim.fastq.gz" pattern: "*fastp.fastq.gz"
- json: - json:
type: file type: file
description: Results in JSON format description: Results in JSON format

View file

@ -44,4 +44,16 @@ process FASTQC {
END_VERSIONS END_VERSIONS
""" """
} }
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.html
touch ${prefix}.zip
cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" )
END_VERSIONS
"""
} }

View file

@ -31,4 +31,14 @@ process GUNZIP {
gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//')
END_VERSIONS END_VERSIONS
""" """
stub:
gunzip = archive.toString() - '.gz'
"""
touch $gunzip
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//')
END_VERSIONS
"""
} }

View file

@ -14,9 +14,9 @@ process KRAKEN2_KRAKEN2 {
val save_reads_assignment val save_reads_assignment
output: output:
tuple val(meta), path('*classified*') , optional:true, emit: classified_reads_fastq tuple val(meta), path('*.classified{.,_}*') , optional:true, emit: classified_reads_fastq
tuple val(meta), path('*unclassified*') , optional:true, emit: unclassified_reads_fastq tuple val(meta), path('*.unclassified{.,_}*') , optional:true, emit: unclassified_reads_fastq
tuple val(meta), path('*classifiedreads*'), optional:true, emit: classified_reads_assignment tuple val(meta), path('*classifiedreads.txt') , optional:true, emit: classified_reads_assignment
tuple val(meta), path('*report.txt') , emit: report tuple val(meta), path('*report.txt') , emit: report
path "versions.yml" , emit: versions path "versions.yml" , emit: versions
@ -29,9 +29,9 @@ process KRAKEN2_KRAKEN2 {
def paired = meta.single_end ? "" : "--paired" def paired = meta.single_end ? "" : "--paired"
def classified = meta.single_end ? "${prefix}.classified.fastq" : "${prefix}.classified#.fastq" def classified = meta.single_end ? "${prefix}.classified.fastq" : "${prefix}.classified#.fastq"
def unclassified = meta.single_end ? "${prefix}.unclassified.fastq" : "${prefix}.unclassified#.fastq" def unclassified = meta.single_end ? "${prefix}.unclassified.fastq" : "${prefix}.unclassified#.fastq"
def classified_command = save_output_fastqs ? "--classified-out ${classified}" : "" def classified_option = save_output_fastqs ? "--classified-out ${classified}" : ""
def unclassified_command = save_output_fastqs ? "--unclassified-out ${unclassified}" : "" def unclassified_option = save_output_fastqs ? "--unclassified-out ${unclassified}" : ""
def readclassification_command = save_reads_assignment ? "--output ${prefix}.kraken2.classifiedreads.txt" : "" def readclassification_option = save_reads_assignment ? "--output ${prefix}.kraken2.classifiedreads.txt" : ""
def compress_reads_command = save_output_fastqs ? "pigz -p $task.cpus *.fastq" : "" def compress_reads_command = save_output_fastqs ? "pigz -p $task.cpus *.fastq" : ""
""" """
@ -40,9 +40,9 @@ process KRAKEN2_KRAKEN2 {
--threads $task.cpus \\ --threads $task.cpus \\
--report ${prefix}.kraken2.report.txt \\ --report ${prefix}.kraken2.report.txt \\
--gzip-compressed \\ --gzip-compressed \\
$unclassified_command \\ $unclassified_option \\
$classified_command \\ $classified_option \\
$readclassification_command \\ $readclassification_option \\
$paired \\ $paired \\
$args \\ $args \\
$reads $reads

View file

@ -1,9 +1,8 @@
def VERSION = '1.2' // Version information not provided by tool on CLI
process KRAKENTOOLS_KREPORT2KRONA { process KRAKENTOOLS_KREPORT2KRONA {
tag "$meta.id" tag "$meta.id"
label 'process_low' label 'process_low'
// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda (params.enable_conda ? "bioconda::krakentools=1.2" : null) conda (params.enable_conda ? "bioconda::krakentools=1.2" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/krakentools:1.2--pyh5e36f6f_0': 'https://depot.galaxyproject.org/singularity/krakentools:1.2--pyh5e36f6f_0':
@ -22,6 +21,7 @@ process KRAKENTOOLS_KREPORT2KRONA {
script: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '1.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
""" """
kreport2krona.py \\ kreport2krona.py \\
-r ${kreport} \\ -r ${kreport} \\

View file

@ -28,15 +28,18 @@ process METAPHLAN3 {
def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt" def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt"
""" """
BT2_DB=`find -L "${metaphlan_db}" -name "*rev.1.bt2" -exec dirname {} \\;`
metaphlan \\ metaphlan \\
--nproc $task.cpus \\ --nproc $task.cpus \\
$input_type \\ $input_type \\
$input_data \\ $input_data \\
$args \\ $args \\
$bowtie2_out \\ $bowtie2_out \\
--bowtie2db ${metaphlan_db} \\ --bowtie2db \$BT2_DB \\
--biom ${prefix}.biom \\ --biom ${prefix}.biom \\
--output_file ${prefix}_profile.txt --output_file ${prefix}_profile.txt
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":
metaphlan3: \$(metaphlan --version 2>&1 | awk '{print \$3}') metaphlan3: \$(metaphlan --version 2>&1 | awk '{print \$3}')

View file

@ -24,6 +24,12 @@ input:
type: file type: file
description: Metaphlan 3.0 can classify the metagenome from a variety of input data types, including FASTQ files (single-end and paired-end), FASTA, bowtie2-produced SAM files (produced from alignments to the MetaPHlAn marker database) and intermediate bowtie2 alignment files (bowtie2out) description: Metaphlan 3.0 can classify the metagenome from a variety of input data types, including FASTQ files (single-end and paired-end), FASTA, bowtie2-produced SAM files (produced from alignments to the MetaPHlAn marker database) and intermediate bowtie2 alignment files (bowtie2out)
pattern: "*.{fastq.gz, fasta, fasta.gz, sam, bowtie2out.txt}" pattern: "*.{fastq.gz, fasta, fasta.gz, sam, bowtie2out.txt}"
- metaphlan_db:
type: file
description: |
Directory containing pre-downloaded and uncompressed MetaPhlAn3 database downloaded from: http://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/.
Note that you will also need to specify `--index` and the database version name (e.g. 'mpa_v31_CHOCOPhlAn_201901') in your module.conf ext.args for METAPHLAN3_METAPHLAN3!
pattern: "*/"
output: output:
- meta: - meta:

View file

@ -1,13 +1,14 @@
process MULTIQC { process MULTIQC {
label 'process_medium' label 'process_medium'
conda (params.enable_conda ? 'bioconda::multiqc=1.12' : null) conda (params.enable_conda ? 'bioconda::multiqc=1.13a' : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/multiqc:1.12--pyhdfd78af_0' : 'https://depot.galaxyproject.org/singularity/multiqc:1.13a--pyhdfd78af_1' :
'quay.io/biocontainers/multiqc:1.12--pyhdfd78af_0' }" 'quay.io/biocontainers/multiqc:1.13a--pyhdfd78af_1' }"
input: input:
path multiqc_files path multiqc_files, stageAs: "?/*"
tuple path(multiqc_config), path(multiqc_logo)
output: output:
path "*multiqc_report.html", emit: report path "*multiqc_report.html", emit: report
@ -20,8 +21,25 @@ process MULTIQC {
script: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
def config = multiqc_config ? "--config $multiqc_config" : ''
""" """
multiqc -f $args . multiqc \\
--force \\
$config \\
$args \\
.
cat <<-END_VERSIONS > versions.yml
"${task.process}":
multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
END_VERSIONS
"""
stub:
"""
touch multiqc_data
touch multiqc_plots
touch multiqc_report.html
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":

View file

@ -17,6 +17,14 @@ input:
type: file type: file
description: | description: |
List of reports / files recognised by MultiQC, for example the html and zip output of FastQC List of reports / files recognised by MultiQC, for example the html and zip output of FastQC
- multiqc_config:
type: file
description: Config yml for MultiQC
pattern: "*.{yml,yaml}"
- multiqc_logo:
type: file
description: Logo file for MultiQC
pattern: "*.{png}"
output: output:
- report: - report:
type: file type: file

View file

@ -1,6 +1,6 @@
process SAMTOOLS_VIEW { process SAMTOOLS_VIEW {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_low'
conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?

View file

@ -1,11 +1,11 @@
process UNTAR { process UNTAR {
tag "$archive" tag "$archive"
label 'process_low' label 'process_single'
conda (params.enable_conda ? "conda-forge::tar=1.32" : null) conda (params.enable_conda ? "conda-forge::sed=4.7" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
'biocontainers/biocontainers:v1.2.0_cv1' }" 'ubuntu:20.04' }"
input: input:
tuple val(meta), path(archive) tuple val(meta), path(archive)
@ -21,12 +21,29 @@ process UNTAR {
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: '' def args2 = task.ext.args2 ?: ''
untar = archive.toString() - '.tar.gz' untar = archive.toString() - '.tar.gz'
""" """
mkdir output
tar \\ tar \\
-C output --strip-components 1 \\
-xzvf \\ -xzvf \\
$args \\ $args \\
$archive \\ $archive \\
$args2 \\ $args2
mv output ${untar}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
END_VERSIONS
"""
stub:
untar = archive.toString() - '.tar.gz'
"""
touch $untar
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":

View file

@ -7,7 +7,7 @@ include { MEGAN_RMA2INFO as MEGAN_RMA2INFO_TSV } from '../../modules/nf-core/mo
include { KRAKEN2_KRAKEN2 } from '../../modules/nf-core/modules/kraken2/kraken2/main' include { KRAKEN2_KRAKEN2 } from '../../modules/nf-core/modules/kraken2/kraken2/main'
include { CENTRIFUGE_CENTRIFUGE } from '../../modules/nf-core/modules/centrifuge/centrifuge/main' include { CENTRIFUGE_CENTRIFUGE } from '../../modules/nf-core/modules/centrifuge/centrifuge/main'
include { CENTRIFUGE_KREPORT } from '../../modules/nf-core/modules/centrifuge/kreport/main' include { CENTRIFUGE_KREPORT } from '../../modules/nf-core/modules/centrifuge/kreport/main'
include { METAPHLAN3 } from '../../modules/nf-core/modules/metaphlan3/main' include { METAPHLAN3 } from '../../modules/nf-core/modules/metaphlan3/metaphlan3/main'
include { KAIJU_KAIJU } from '../../modules/nf-core/modules/kaiju/kaiju/main' include { KAIJU_KAIJU } from '../../modules/nf-core/modules/kaiju/kaiju/main'
include { KAIJU_KAIJU2TABLE } from '../../modules/nf-core/modules/kaiju/kaiju2table/main' include { KAIJU_KAIJU2TABLE } from '../../modules/nf-core/modules/kaiju/kaiju2table/main'
include { DIAMOND_BLASTX } from '../../modules/nf-core/modules/diamond/blastx/main' include { DIAMOND_BLASTX } from '../../modules/nf-core/modules/diamond/blastx/main'

View file

@ -22,7 +22,7 @@ workflow SHORTREAD_HOSTREMOVAL {
ch_bowtie2_index = index.first() ch_bowtie2_index = index.first()
} }
BOWTIE2_ALIGN ( reads, ch_bowtie2_index, true ) BOWTIE2_ALIGN ( reads, ch_bowtie2_index, true, false )
ch_versions = ch_versions.mix( BOWTIE2_ALIGN.out.versions.first() ) ch_versions = ch_versions.mix( BOWTIE2_ALIGN.out.versions.first() )
ch_multiqc_files = ch_multiqc_files.mix( BOWTIE2_ALIGN.out.log ) ch_multiqc_files = ch_multiqc_files.mix( BOWTIE2_ALIGN.out.log )

View file

@ -269,7 +269,7 @@ workflow TAXPROFILER {
// TODO create multiQC module for metaphlan // TODO create multiQC module for metaphlan
MULTIQC ( MULTIQC (
ch_multiqc_files.collect() ch_multiqc_files.collect(), [[], []]
) )
multiqc_report = MULTIQC.out.report.toList() multiqc_report = MULTIQC.out.report.toList()
ch_versions = ch_versions.mix(MULTIQC.out.versions) ch_versions = ch_versions.mix(MULTIQC.out.versions)