mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Merge branch 'new-module-rtg/vcfeval' of github.com:nvnieuwk/modules into new-module-rtg/vcfeval
This commit is contained in:
commit
e5d091ad4b
18 changed files with 334 additions and 48 deletions
34
modules/meryl/histogram/main.nf
Normal file
34
modules/meryl/histogram/main.nf
Normal file
|
@ -0,0 +1,34 @@
|
|||
process MERYL_HISTOGRAM {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::meryl=1.3" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1':
|
||||
'quay.io/biocontainers/meryl:1.3--h87f3376_1' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(meryl_db)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.hist"), emit: hist
|
||||
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}"
|
||||
"""
|
||||
meryl histogram \\
|
||||
threads=$task.cpus \\
|
||||
$args \\
|
||||
$meryl_db > ${prefix}.hist
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
meryl: \$( meryl --version |& sed 's/meryl //' )
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
41
modules/meryl/histogram/meta.yml
Normal file
41
modules/meryl/histogram/meta.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: "meryl_histogram"
|
||||
description: A genomic k-mer counter (and sequence utility) with nice features.
|
||||
keywords:
|
||||
- k-mer
|
||||
- histogram
|
||||
tools:
|
||||
- "meryl":
|
||||
description: "A genomic k-mer counter (and sequence utility) with nice features. "
|
||||
homepage: "https://github.com/marbl/meryl"
|
||||
documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html"
|
||||
tool_dev_url: "https://github.com/marbl/meryl"
|
||||
doi: ""
|
||||
licence: "['GPL']"
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- meryl_dbs:
|
||||
type: directory
|
||||
description: Meryl k-mer database
|
||||
|
||||
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"
|
||||
- hist:
|
||||
type: file
|
||||
description: Histogram of k-mers
|
||||
pattern: "*.hist"
|
||||
|
||||
authors:
|
||||
- "@mahesh-panchal"
|
35
modules/meryl/unionsum/main.nf
Normal file
35
modules/meryl/unionsum/main.nf
Normal file
|
@ -0,0 +1,35 @@
|
|||
process MERYL_UNIONSUM {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::meryl=1.3" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1':
|
||||
'quay.io/biocontainers/meryl:1.3--h87f3376_1' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(meryl_dbs)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.unionsum.meryldb"), emit: meryl_db
|
||||
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}"
|
||||
"""
|
||||
meryl union-sum \\
|
||||
threads=$task.cpus \\
|
||||
$args \\
|
||||
output ${prefix}.unionsum.meryldb \\
|
||||
$meryl_dbs
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
meryl: \$( meryl --version |& sed 's/meryl //' )
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
41
modules/meryl/unionsum/meta.yml
Normal file
41
modules/meryl/unionsum/meta.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: "meryl_unionsum"
|
||||
description: A genomic k-mer counter (and sequence utility) with nice features.
|
||||
keywords:
|
||||
- k-mer
|
||||
- unionsum
|
||||
tools:
|
||||
- "meryl":
|
||||
description: "A genomic k-mer counter (and sequence utility) with nice features. "
|
||||
homepage: "https://github.com/marbl/meryl"
|
||||
documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html"
|
||||
tool_dev_url: "https://github.com/marbl/meryl"
|
||||
doi: ""
|
||||
licence: "['GPL']"
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- meryl_dbs:
|
||||
type: directory
|
||||
description: Meryl k-mer databases
|
||||
|
||||
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"
|
||||
- meryl_db:
|
||||
type: directory
|
||||
description: A Meryl k-mer database that is the union sum of the input databases
|
||||
pattern: "*.unionsum.meryldb"
|
||||
|
||||
authors:
|
||||
- "@mahesh-panchal"
|
|
@ -1,5 +1,4 @@
|
|||
//There is a -L option to only output alignments in interval, might be an option for exons/panel data?
|
||||
process SAMTOOLS_BAMTOCRAM {
|
||||
process SAMTOOLS_CONVERT {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
|
||||
|
@ -14,8 +13,8 @@ process SAMTOOLS_BAMTOCRAM {
|
|||
path fai
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.cram"), path("*.crai"), emit: cram_crai
|
||||
path "versions.yml" , emit: versions
|
||||
tuple val(meta), path("*.{cram,bam}"), path("*.{crai,bai}") , emit: alignment_index
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
@ -23,9 +22,17 @@ process SAMTOOLS_BAMTOCRAM {
|
|||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def output_extension = input.getExtension() == "bam" ? "cram" : "bam"
|
||||
|
||||
"""
|
||||
samtools view --threads ${task.cpus} --reference ${fasta} -C $args $input > ${prefix}.cram
|
||||
samtools index -@${task.cpus} ${prefix}.cram
|
||||
samtools view \\
|
||||
--threads ${task.cpus} \\
|
||||
--reference ${fasta} \\
|
||||
$args \\
|
||||
$input \\
|
||||
-o ${prefix}.${output_extension}
|
||||
|
||||
samtools index -@${task.cpus} ${prefix}.${output_extension}
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
|
@ -1,5 +1,5 @@
|
|||
name: samtools_bamtocram
|
||||
description: filter/convert and then index CRAM file
|
||||
name: samtools_convert
|
||||
description: convert and then index CRAM -> BAM or BAM -> CRAM file
|
||||
keywords:
|
||||
- view
|
||||
- index
|
||||
|
@ -23,12 +23,12 @@ input:
|
|||
e.g. [ id:'test', single_end:false ]
|
||||
- input:
|
||||
type: file
|
||||
description: BAM/SAM file
|
||||
pattern: "*.{bam,sam}"
|
||||
description: BAM/CRAM file
|
||||
pattern: "*.{bam,cram}"
|
||||
- index:
|
||||
type: file
|
||||
description: BAM/SAM index file
|
||||
pattern: "*.{bai,sai}"
|
||||
description: BAM/CRAM index file
|
||||
pattern: "*.{bai,crai}"
|
||||
- fasta:
|
||||
type: file
|
||||
description: Reference file to create the CRAM file
|
||||
|
@ -39,10 +39,10 @@ output:
|
|||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- cram_crai:
|
||||
- alignment_index:
|
||||
type: file
|
||||
description: filtered/converted CRAM file + index
|
||||
pattern: "*{.cram,.crai}"
|
||||
description: filtered/converted BAM/CRAM file + index
|
||||
pattern: "*{.bam/cram,.bai/crai}"
|
||||
- version:
|
||||
type: file
|
||||
description: File containing software version
|
|
@ -1218,6 +1218,14 @@ meryl/count:
|
|||
- modules/meryl/count/**
|
||||
- tests/modules/meryl/count/**
|
||||
|
||||
meryl/histogram:
|
||||
- modules/meryl/histogram/**
|
||||
- tests/modules/meryl/histogram/**
|
||||
|
||||
meryl/unionsum:
|
||||
- modules/meryl/unionsum/**
|
||||
- tests/modules/meryl/unionsum/**
|
||||
|
||||
metabat2/jgisummarizebamcontigdepths:
|
||||
- modules/metabat2/jgisummarizebamcontigdepths/**
|
||||
- tests/modules/metabat2/jgisummarizebamcontigdepths/**
|
||||
|
@ -1635,9 +1643,9 @@ samtools/bam2fq:
|
|||
- modules/samtools/bam2fq/**
|
||||
- tests/modules/samtools/bam2fq/**
|
||||
|
||||
samtools/bamtocram:
|
||||
- modules/samtools/bamtocram/**
|
||||
- tests/modules/samtools/bamtocram/**
|
||||
samtools/convert:
|
||||
- modules/samtools/convert/**
|
||||
- tests/modules/samtools/convert/**
|
||||
|
||||
samtools/collatefastq:
|
||||
- modules/samtools/collatefastq/**
|
||||
|
@ -1771,14 +1779,14 @@ slimfastq:
|
|||
- modules/slimfastq/**
|
||||
- tests/modules/slimfastq/**
|
||||
|
||||
snapaligner/index:
|
||||
- modules/snapaligner/index/**
|
||||
- tests/modules/snapaligner/index/**
|
||||
|
||||
snapaligner/align:
|
||||
- modules/snapaligner/align/**
|
||||
- tests/modules/snapaligner/align/**
|
||||
|
||||
snapaligner/index:
|
||||
- modules/snapaligner/index/**
|
||||
- tests/modules/snapaligner/index/**
|
||||
|
||||
snpdists:
|
||||
- modules/snpdists/**
|
||||
- tests/modules/snpdists/**
|
||||
|
|
17
tests/modules/meryl/histogram/main.nf
Normal file
17
tests/modules/meryl/histogram/main.nf
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { MERYL_COUNT } from '../../../../modules/meryl/count/main.nf'
|
||||
include { MERYL_HISTOGRAM } from '../../../../modules/meryl/histogram/main.nf'
|
||||
|
||||
workflow test_meryl_histogram {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
|
||||
]
|
||||
|
||||
MERYL_COUNT ( input )
|
||||
MERYL_HISTOGRAM ( MERYL_COUNT.out.meryl_db )
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
ext.args = 'k=21'
|
||||
|
||||
}
|
10
tests/modules/meryl/histogram/test.yml
Normal file
10
tests/modules/meryl/histogram/test.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
- name: meryl histogram test_meryl_histogram
|
||||
command: nextflow run tests/modules/meryl/histogram -entry test_meryl_histogram -c tests/config/nextflow.config
|
||||
tags:
|
||||
- meryl/histogram
|
||||
- meryl
|
||||
files:
|
||||
- path: output/meryl/test.hist
|
||||
md5sum: 4bfdc8b287ee0cfd9922bbfa8cd64650
|
||||
- path: output/meryl/versions.yml
|
||||
md5sum: 050038f1b1df79977a393cce1b4b2ddb
|
31
tests/modules/meryl/unionsum/main.nf
Normal file
31
tests/modules/meryl/unionsum/main.nf
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { MERYL_COUNT } from '../../../../modules/meryl/count/main.nf'
|
||||
include { MERYL_UNIONSUM } from '../../../../modules/meryl/unionsum/main.nf'
|
||||
|
||||
workflow test_meryl_unionsum_single_end {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end: true ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
|
||||
]
|
||||
|
||||
MERYL_COUNT ( input )
|
||||
MERYL_UNIONSUM ( MERYL_COUNT.out.meryl_db )
|
||||
}
|
||||
|
||||
workflow test_meryl_unionsum_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)
|
||||
]
|
||||
]
|
||||
|
||||
MERYL_COUNT ( input )
|
||||
MERYL_UNIONSUM ( MERYL_COUNT.out.meryl_db )
|
||||
}
|
6
tests/modules/meryl/unionsum/nextflow.config
Normal file
6
tests/modules/meryl/unionsum/nextflow.config
Normal file
|
@ -0,0 +1,6 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
ext.args = 'k=21'
|
||||
|
||||
}
|
17
tests/modules/meryl/unionsum/test.yml
Normal file
17
tests/modules/meryl/unionsum/test.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- name: meryl unionsum test_meryl_unionsum_single_end
|
||||
command: nextflow run tests/modules/meryl/unionsum -entry test_meryl_unionsum_single_end -c tests/config/nextflow.config
|
||||
tags:
|
||||
- meryl
|
||||
- meryl/unionsum
|
||||
files:
|
||||
- path: output/meryl/versions.yml
|
||||
md5sum: 7de859c6d3a29d72f6c9c976609d0913
|
||||
|
||||
- name: meryl unionsum test_meryl_unionsum_paired_end
|
||||
command: nextflow run tests/modules/meryl/unionsum -entry test_meryl_unionsum_paired_end -c tests/config/nextflow.config
|
||||
tags:
|
||||
- meryl
|
||||
- meryl/unionsum
|
||||
files:
|
||||
- path: output/meryl/versions.yml
|
||||
md5sum: a16decdec014ccb9bdab69a4a1d30818
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { SAMTOOLS_BAMTOCRAM } from '../../../../modules/samtools/bamtocram/main.nf'
|
||||
|
||||
workflow test_samtools_bamtocram {
|
||||
|
||||
input = [ [ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)]
|
||||
|
||||
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
|
||||
SAMTOOLS_BAMTOCRAM ( input, fasta, fai )
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
- name: samtools bamtocram test_samtools_bamtocram
|
||||
command: nextflow run ./tests/modules/samtools/bamtocram -entry test_samtools_bamtocram -c ./tests/config/nextflow.config -c ./tests/modules/samtools/bamtocram/nextflow.config
|
||||
tags:
|
||||
- samtools/bamtocram
|
||||
- samtools
|
||||
files:
|
||||
- path: output/samtools/test.cram
|
||||
- path: output/samtools/test.cram.crai
|
||||
- path: output/samtools/versions.yml
|
31
tests/modules/samtools/convert/main.nf
Normal file
31
tests/modules/samtools/convert/main.nf
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { SAMTOOLS_CONVERT as SAMTOOLS_BAMTOCRAM } from '../../../../modules/samtools/convert/main.nf'
|
||||
include { SAMTOOLS_CONVERT as SAMTOOLS_CRAMTOBAM } from '../../../../modules/samtools/convert/main.nf'
|
||||
|
||||
workflow test_samtools_convert_bamtocram {
|
||||
|
||||
input = [ [ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)]
|
||||
|
||||
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
|
||||
SAMTOOLS_BAMTOCRAM ( input, fasta, fai )
|
||||
}
|
||||
|
||||
workflow test_samtools_convert_cramtobam {
|
||||
|
||||
input = [ [ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true)
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
|
||||
SAMTOOLS_CRAMTOBAM ( input, fasta, fai )
|
||||
}
|
12
tests/modules/samtools/convert/nextflow.config
Normal file
12
tests/modules/samtools/convert/nextflow.config
Normal file
|
@ -0,0 +1,12 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
withName:SAMTOOLS_BAMTOCRAM{
|
||||
ext.args = "-C"
|
||||
}
|
||||
|
||||
withName:SAMTOOLS_CRAMTOBAM{
|
||||
ext.args = "-b"
|
||||
}
|
||||
}
|
21
tests/modules/samtools/convert/test.yml
Normal file
21
tests/modules/samtools/convert/test.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
- name: samtools convert test_samtools_convert_bamtocram
|
||||
command: nextflow run tests/modules/samtools/convert -entry test_samtools_convert_bamtocram -c tests/config/nextflow.config
|
||||
tags:
|
||||
- samtools
|
||||
- samtools/convert
|
||||
files:
|
||||
- path: output/samtools/test.cram
|
||||
- path: output/samtools/test.cram.crai
|
||||
- path: output/samtools/versions.yml
|
||||
|
||||
- name: samtools convert test_samtools_convert_cramtobam
|
||||
command: nextflow run tests/modules/samtools/convert -entry test_samtools_convert_cramtobam -c tests/config/nextflow.config
|
||||
tags:
|
||||
- samtools
|
||||
- samtools/convert
|
||||
files:
|
||||
- path: output/samtools/test.bam
|
||||
md5sum: c262b6dc15f9b480bdb47d6d018b4b56
|
||||
- path: output/samtools/test.bam.bai
|
||||
md5sum: 6e8f5034f728401bfa841c8e70c62463
|
||||
- path: output/samtools/versions.yml
|
Loading…
Reference in a new issue