Merge branch 'master' into add_compression_to_bam2fq

This commit is contained in:
Lauri Mesilaakso 2022-05-03 14:30:54 +03:00 committed by GitHub
commit a65e76e3dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 374 additions and 0 deletions

View file

@ -0,0 +1,64 @@
process SHIGATYPER {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::shigatyper=2.0.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/shigatyper%3A2.0.1--pyhdfd78af_0':
'quay.io/biocontainers/shigatyper:2.0.1--pyhdfd78af_0' }"
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("${prefix}.tsv") , emit: tsv
tuple val(meta), path("${prefix}-hits.tsv"), optional: true, emit: hits
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
if (meta.is_ont) {
"""
shigatyper \\
$args \\
--SE $reads \\
--ont \\
--name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' )
END_VERSIONS
"""
} else if (meta.single_end) {
"""
shigatyper \\
$args \\
--SE $reads \\
--name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' )
END_VERSIONS
"""
} else {
"""
shigatyper \\
$args \\
--R1 ${reads[0]} \\
--R2 ${reads[1]} \\
--name $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
shigatyper: \$(echo \$(shigatyper --version 2>&1) | sed 's/^.*ShigaTyper //' )
END_VERSIONS
"""
}
}

View file

@ -0,0 +1,47 @@
name: "shigatyper"
description: Determine Shigella serotype from Illumina or Oxford Nanopore reads
keywords:
- fastq
- shigella
- serotype
tools:
- "shigatyper":
description: "Typing tool for Shigella spp. from WGS Illumina sequencing"
homepage: "https://github.com/CFSAN-Biostatistics/shigatyper"
documentation: "https://github.com/CFSAN-Biostatistics/shigatyper"
tool_dev_url: "https://github.com/CFSAN-Biostatistics/shigatyper"
doi: "10.1128/AEM.00165-19"
licence: "['Public Domain']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false, is_ont:false ]
- reads:
type: file
description: Illumina or Nanopore FASTQ file
pattern: "*.fastq.gz"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- tsv:
type: file
description: A TSV formatted file with ShigaTyper results
pattern: "*.tsv"
- hits:
type: file
description: A TSV formatted file with individual gene hits
pattern: "*-hits.tsv"
authors:
- "@rpetit3"

52
modules/slimfastq/main.nf Normal file
View file

@ -0,0 +1,52 @@
def VERSION = '2.04'
process SLIMFASTQ {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::slimfastq=2.04" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/slimfastq:2.04--h87f3376_2':
'quay.io/biocontainers/slimfastq:2.04--h87f3376_2' }"
input:
tuple val(meta), path(fastq)
output:
tuple val(meta), path("*.sfq"), emit: sfq
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
if (meta.single_end) {
"""
gzip -d -c '${fastq}' | slimfastq \\
$args \\
-f '${prefix}.sfq'
cat <<-END_VERSIONS > versions.yml
"${task.process}":
slimfastq: ${VERSION}
END_VERSIONS
"""
} else {
"""
gzip -d -c '${fastq[0]}' | slimfastq \\
$args \\
-f '${prefix}_1.sfq'
gzip -d -c '${fastq[1]}' | slimfastq \\
$args \\
-f '${prefix}_2.sfq'
cat <<-END_VERSIONS > versions.yml
"${task.process}":
slimfastq: ${VERSION}
END_VERSIONS
"""
}
}

View file

@ -0,0 +1,41 @@
name: "slimfastq"
description: Fast, efficient, lossless compression of FASTQ files.
keywords:
- FASTQ
- compression
- lossless
tools:
- "slimfastq":
description: "slimfastq efficiently compresses/decompresses FASTQ files"
homepage: "https://github.com/Infinidat/slimfastq"
tool_dev_url: "https://github.com/Infinidat/slimfastq"
licence: "['BSD-3-clause']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fastq:
type: file
description: Either a single-end FASTQ file or paired-end files.
pattern: "*.{fq.gz,fastq.gz}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- sfq:
type: file
description: Either one or two sequence files in slimfastq compressed format.
pattern: "*.{sfq}"
authors:
- "@Midnighter"

View file

@ -1719,6 +1719,10 @@ seqwish/induce:
- modules/seqwish/induce/**
- tests/modules/seqwish/induce/**
shigatyper:
- modules/shigatyper/**
- tests/modules/shigatyper/**
shovill:
- modules/shovill/**
- tests/modules/shovill/**
@ -1727,6 +1731,10 @@ sistr:
- modules/sistr/**
- tests/modules/sistr/**
slimfastq:
- modules/slimfastq/**
- tests/modules/slimfastq/**
snapaligner/index:
- modules/snapaligner/index/**
- tests/modules/snapaligner/index/**

View file

@ -0,0 +1,36 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SHIGATYPER } from '../../../modules/shigatyper/main.nf'
workflow test_shigatyper_pe {
input = [
[ id:'test', single_end:false, is_ont:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
SHIGATYPER ( input )
}
workflow test_shigatyper_se {
input = [
[ id:'test', single_end:true, is_ont:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
]
SHIGATYPER ( input )
}
workflow test_shigatyper_ont {
input = [
[ id:'test', single_end:true, is_ont:true ], // meta map
[ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ]
]
SHIGATYPER ( input )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,29 @@
- name: shigatyper test_shigatyper_pe
command: nextflow run tests/modules/shigatyper -entry test_shigatyper_pe -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config
tags:
- shigatyper
files:
- path: output/shigatyper/test.tsv
md5sum: 4f7d38c956993800546b9acb9881d717
- path: output/shigatyper/versions.yml
md5sum: d8ca45ed88dfba9bc570c01e4b49773b
- name: shigatyper test_shigatyper_se
command: nextflow run tests/modules/shigatyper -entry test_shigatyper_se -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config
tags:
- shigatyper
files:
- path: output/shigatyper/test.tsv
md5sum: 4f7d38c956993800546b9acb9881d717
- path: output/shigatyper/versions.yml
md5sum: 8bbf165da5a5df3b7771a33aad197eec
- name: shigatyper test_shigatyper_ont
command: nextflow run tests/modules/shigatyper -entry test_shigatyper_ont -c tests/config/nextflow.config -c tests/modules/shigatyper/nextflow.config
tags:
- shigatyper
files:
- path: output/shigatyper/test.tsv
md5sum: 4f7d38c956993800546b9acb9881d717
- path: output/shigatyper/versions.yml
md5sum: 0da333e1178e9e7e84a9116ad5a5ff71

View file

@ -0,0 +1,46 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SLIMFASTQ } from '../../../modules/slimfastq/main.nf'
workflow test_slimfastq_single_end {
input = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
SLIMFASTQ ( input )
}
workflow test_slimfastq_paired_end {
input = [
[ id:'test', single_end:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)]
]
SLIMFASTQ ( input )
}
workflow test_slimfastq_nanopore {
input = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true)
]
SLIMFASTQ ( input )
}
workflow test_slimfastq_pacbio {
input = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['homo_sapiens']['pacbio']['ccs_fq_gz'], checkIfExists: true)
]
SLIMFASTQ ( input )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,41 @@
- name: slimfastq test_slimfastq_single_end
command: nextflow run tests/modules/slimfastq -entry test_slimfastq_single_end -c tests/config/nextflow.config
tags:
- slimfastq
files:
- path: output/slimfastq/test.sfq
md5sum: 6a942eeca6c99ee9a9a0cedab5d246f1
- path: output/slimfastq/versions.yml
md5sum: f52351f5c9e6259af02745c8eae5c780
- name: slimfastq test_slimfastq_paired_end
command: nextflow run tests/modules/slimfastq -entry test_slimfastq_paired_end -c tests/config/nextflow.config
tags:
- slimfastq
files:
- path: output/slimfastq/test_1.sfq
md5sum: 6a942eeca6c99ee9a9a0cedab5d246f1
- path: output/slimfastq/test_2.sfq
md5sum: 0d2c60b52a39f7c2cb7843e848d90afd
- path: output/slimfastq/versions.yml
md5sum: 6239853705877651a4851c4cb6d62da4
- name: slimfastq test_slimfastq_nanopore
command: nextflow run tests/modules/slimfastq -entry test_slimfastq_nanopore -c tests/config/nextflow.config
tags:
- slimfastq
files:
- path: output/slimfastq/test.sfq
md5sum: e17f14d64d3a75356b03ff2f9e8881f7
- path: output/slimfastq/versions.yml
md5sum: 33153f1103482a2bd35cb2f4c337c5e8
- name: slimfastq test_slimfastq_pacbio
command: nextflow run tests/modules/slimfastq -entry test_slimfastq_pacbio -c tests/config/nextflow.config
tags:
- slimfastq
files:
- path: output/slimfastq/test.sfq
md5sum: 9e8389e47e6ddf8c25e92412dd628339
- path: output/slimfastq/versions.yml
md5sum: 1982789c3d5c7de37c0a9351e4ae63f7