mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-11 12:43:09 +00:00
Merge remote-tracking branch 'nf-core/master'
This commit is contained in:
commit
c0a32cbca2
231 changed files with 3148 additions and 84 deletions
|
@ -35,7 +35,7 @@ process BAMTOOLS_SPLIT {
|
|||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
bamtools: \$( bamtools --version | grep -e 'bamtools' | sed 's/^.*bamtools //' )
|
||||
${getSoftwareName(task.process)}: \$( bamtools --version | grep -e 'bamtools' | sed 's/^.*bamtools //' )
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
Bandage - a Bioinformatics Application for Navigating De novo Assembly Graphs Easily
|
||||
homepage: https://github.com/rrwick/Bandage
|
||||
documentation: https://github.com/rrwick/Bandage
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -13,7 +13,7 @@ tools:
|
|||
documentation: https://samtools.github.io/bcftools/howtos/index.html
|
||||
tool_dev_url: https://github.com/samtools/bcftools
|
||||
doi: "10.1093/gigascience/giab008"
|
||||
licence: ['GPL']
|
||||
licence: ['MIT', 'GPL-3.0-or-later']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,7 +11,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://samtools.github.io/bcftools/bcftools.html#reheader
|
||||
doi: 10.1093/gigascience/giab008
|
||||
licence: ['GPL']
|
||||
licence: ['MIT']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://samtools.github.io/bcftools/bcftools.html
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/complement.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/complement.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -9,6 +9,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/genomecov.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -9,6 +9,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- bed:
|
||||
type: file
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,7 +11,7 @@ tools:
|
|||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/makewindows.html
|
||||
tool_dev_url: None
|
||||
doi: "10.1093/bioinformatics/btq033"
|
||||
licence: ['GPL v2']
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -9,6 +9,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/merge.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/sort.html
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
description: |
|
||||
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
|
||||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/subtract.html
|
||||
licence: ['MIT']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -17,6 +17,7 @@ tools:
|
|||
homepage: https://github.com/FelixKrueger/Bismark
|
||||
documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs
|
||||
doi: 10.1093/bioinformatics/btr167
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -19,6 +19,7 @@ tools:
|
|||
homepage: https://github.com/FelixKrueger/Bismark
|
||||
documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs
|
||||
doi: 10.1093/bioinformatics/btr167
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -19,6 +19,7 @@ tools:
|
|||
homepage: https://github.com/FelixKrueger/Bismark
|
||||
documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs
|
||||
doi: 10.1093/bioinformatics/btr167
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -18,6 +18,7 @@ tools:
|
|||
homepage: https://github.com/FelixKrueger/Bismark
|
||||
documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs
|
||||
doi: 10.1093/bioinformatics/btr167
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -16,6 +16,7 @@ tools:
|
|||
homepage: https://github.com/FelixKrueger/Bismark
|
||||
documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs
|
||||
doi: 10.1093/bioinformatics/btr167
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -19,6 +19,7 @@ tools:
|
|||
homepage: https://github.com/FelixKrueger/Bismark
|
||||
documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs
|
||||
doi: 10.1093/bioinformatics/btr167
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- bam:
|
||||
type: file
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://blast.ncbi.nlm.nih.gov/Blast.cgi
|
||||
documentation: https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs
|
||||
doi: 10.1016/S0022-2836(05)80360-2
|
||||
licence: ['US-Government-Work']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
homepage: https://blast.ncbi.nlm.nih.gov/Blast.cgi
|
||||
documentation: https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs
|
||||
doi: 10.1016/S0022-2836(05)80360-2
|
||||
licence: ['US-Government-Work']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://bowtie-bio.sourceforge.net/index.shtml
|
||||
documentation: http://bowtie-bio.sourceforge.net/manual.shtml
|
||||
arxiv: arXiv:1303.3997
|
||||
licence: ['Artistic-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://bowtie-bio.sourceforge.net/index.shtml
|
||||
documentation: http://bowtie-bio.sourceforge.net/manual.shtml
|
||||
arxiv: arXiv:1303.3997
|
||||
licence: ['Artistic-2.0']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml
|
||||
documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml
|
||||
doi: 10.1038/nmeth.1923
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -14,6 +14,7 @@ tools:
|
|||
homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml
|
||||
documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml
|
||||
doi: 10.1038/nmeth.1923
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -17,7 +17,7 @@ tools:
|
|||
homepage: http://bio-bwa.sourceforge.net/
|
||||
documentation: http://bio-bwa.sourceforge.net/
|
||||
doi: "10.1093/bioinformatics/btp324"
|
||||
licence: ['GPL v3']
|
||||
licence: ['GPL-3.0-or-later']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: http://bio-bwa.sourceforge.net/
|
||||
documentation: http://www.htslib.org/doc/samtools.html
|
||||
arxiv: arXiv:1303.3997
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -16,6 +16,7 @@ tools:
|
|||
homepage: http://bio-bwa.sourceforge.net/
|
||||
documentation: http://www.htslib.org/doc/samtools.html
|
||||
arxiv: arXiv:1303.3997
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -18,7 +18,7 @@ tools:
|
|||
homepage: http://bio-bwa.sourceforge.net/
|
||||
documentation: http://bio-bwa.sourceforge.net/
|
||||
doi: "10.1093/bioinformatics/btp324"
|
||||
licence: ['GPL v3']
|
||||
licence: ['GPL-3.0-or-later']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -19,7 +19,7 @@ tools:
|
|||
homepage: http://bio-bwa.sourceforge.net/
|
||||
documentation: http://bio-bwa.sourceforge.net/
|
||||
doi: "10.1093/bioinformatics/btp324"
|
||||
licence: ['GPL v3']
|
||||
licence: ['GPL-3.0-or-later']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
a large reference genome, such as the human genome.
|
||||
homepage: https://github.com/bwa-mem2/bwa-mem2
|
||||
documentation: https://github.com/bwa-mem2/bwa-mem2#usage
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -16,6 +16,7 @@ tools:
|
|||
homepage: http://bio-bwa.sourceforge.net/
|
||||
documentation: http://www.htslib.org/doc/samtools.html
|
||||
arxiv: arXiv:1303.3997
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -19,6 +19,7 @@ tools:
|
|||
homepage: https://github.com/brentp/bwa-meth
|
||||
documentation: https://github.com/brentp/bwa-meth
|
||||
arxiv: arXiv:1401.1129
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -15,6 +15,7 @@ tools:
|
|||
homepage: https://github.com/brentp/bwa-meth
|
||||
documentation: https://github.com/brentp/bwa-meth
|
||||
arxiv: arXiv:1401.1129
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
|
@ -10,7 +10,7 @@ tools:
|
|||
homepage: None
|
||||
documentation: https://man7.org/linux/man-pages/man1/cat.1.html
|
||||
tool_dev_url: None
|
||||
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- files_in:
|
||||
type: file
|
||||
|
|
|
@ -8,6 +8,7 @@ tools:
|
|||
description: |
|
||||
The cat utility reads files sequentially, writing them to the standard output.
|
||||
documentation: https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html
|
||||
licence: ['GPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
78
modules/checkm/lineagewf/functions.nf
Normal file
78
modules/checkm/lineagewf/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
49
modules/checkm/lineagewf/main.nf
Normal file
49
modules/checkm/lineagewf/main.nf
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process CHECKM_LINEAGEWF {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::checkm-genome=1.1.3" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/checkm-genome:1.1.3--py_1"
|
||||
} else {
|
||||
container "quay.io/biocontainers/checkm-genome:1.1.3--py_1"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(fasta)
|
||||
val fasta_ext
|
||||
|
||||
output:
|
||||
tuple val(meta), path("${prefix}") , emit: checkm_output
|
||||
tuple val(meta), path("${prefix}.tsv"), emit: checkm_tsv
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
checkm \\
|
||||
lineage_wf \\
|
||||
-t $task.cpus \\
|
||||
-f ${prefix}.tsv \\
|
||||
--tab_table \\
|
||||
--pplacer_threads $task.cpus \\
|
||||
-x $fasta_ext \\
|
||||
$options.args \\
|
||||
. \\
|
||||
$prefix
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$( checkm 2>&1 | grep '...:::' | sed 's/.*CheckM v//;s/ .*//' )
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
58
modules/checkm/lineagewf/meta.yml
Normal file
58
modules/checkm/lineagewf/meta.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
name: checkm_lineagewf
|
||||
description: CheckM provides a set of tools for assessing the quality of genomes recovered from isolates, single cells, or metagenomes.
|
||||
keywords:
|
||||
- checkm
|
||||
- mag
|
||||
- metagenome
|
||||
- quality
|
||||
- isolates
|
||||
- microbes
|
||||
- single cells
|
||||
- completeness
|
||||
- contamination
|
||||
- bins
|
||||
- genome bins
|
||||
tools:
|
||||
- checkm:
|
||||
description: Assess the quality of microbial genomes recovered from isolates, single cells, and metagenomes.
|
||||
homepage: https://ecogenomics.github.io/CheckM/
|
||||
documentation: https://github.com/Ecogenomics/CheckM/wiki
|
||||
tool_dev_url: https://github.com/Ecogenomics/CheckM
|
||||
doi: "10.1101/gr.186072.114"
|
||||
licence: ['GPL v3']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- fasta:
|
||||
type: file
|
||||
description: One or a list of multiple FASTA files of each bin, with extension defined with the fasta_ext value
|
||||
pattern: "*.{$fasta_ext}"
|
||||
- fasta_ext:
|
||||
type: value
|
||||
description: The file-type extension suffix of the input FASTA files (e.g., fasta, fna, fa, fas)
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'sample', bin:'1' ]
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- checkm_output:
|
||||
type: directory
|
||||
description: CheckM output directory
|
||||
pattern: "*/"
|
||||
- checkm_tsv:
|
||||
type: file
|
||||
description: CheckM summary completeness statistics table
|
||||
pattern: "*.tsv"
|
||||
|
||||
authors:
|
||||
- "@jfy133"
|
|
@ -10,6 +10,7 @@ tools:
|
|||
CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data. It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent.
|
||||
homepage: https://cnvkit.readthedocs.io/en/stable/index.html
|
||||
documentation: https://cnvkit.readthedocs.io/en/stable/index.html
|
||||
licence: ['Apache-2.0']
|
||||
params:
|
||||
- outdir:
|
||||
type: string
|
||||
|
|
|
@ -10,7 +10,7 @@ tools:
|
|||
documentation: https://cooler.readthedocs.io/en/latest/index.html
|
||||
tool_dev_url: https://github.com/open2c/cooler
|
||||
doi: "10.1093/bioinformatics/btz540"
|
||||
licence: ['BSD-3-clause']
|
||||
licence: ['BSD-3-Clause']
|
||||
|
||||
input:
|
||||
- fasta:
|
||||
|
|
|
@ -9,7 +9,7 @@ tools:
|
|||
documentation: https://cooler.readthedocs.io/en/latest/index.html
|
||||
tool_dev_url: https://github.com/open2c/cooler
|
||||
doi: "10.1093/bioinformatics/btz540"
|
||||
licence: ['BSD-3-clause']
|
||||
licence: ['BSD-3-Clause']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -8,7 +8,7 @@ tools:
|
|||
description: Custom module used to dump software versions within the nf-core pipeline template
|
||||
homepage: https://github.com/nf-core/tools
|
||||
documentation: https://github.com/nf-core/tools
|
||||
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- versions:
|
||||
type: file
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
Cutadapt finds and removes adapter sequences, primers, poly-A tails and other types of unwanted sequence from your high-throughput sequencing reads.
|
||||
documentation: https://cutadapt.readthedocs.io/en/stable/index.html
|
||||
doi: DOI:10.14806/ej.17.1.200
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -13,7 +13,7 @@ tools:
|
|||
documentation: https://github.com/dellytools/delly/blob/master/README.md
|
||||
tool_dev_url: None
|
||||
doi: "DOI:10.1093/bioinformatics/bts378"
|
||||
licence: ["BSD-3-clause"]
|
||||
licence: ['BSD-3-Clause']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
or later.
|
||||
homepage: https://github.com/heuermh/dishevelled-bio
|
||||
documentation: https://github.com/heuermh/dishevelled-bio
|
||||
licence: ['LGPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
or later.
|
||||
homepage: https://github.com/heuermh/dishevelled-bio
|
||||
documentation: https://github.com/heuermh/dishevelled-bio
|
||||
licence: ['LGPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
or later.
|
||||
homepage: https://github.com/heuermh/dishevelled-bio
|
||||
documentation: https://github.com/heuermh/dishevelled-bio
|
||||
licence: ['LGPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
or later.
|
||||
homepage: https://github.com/heuermh/dishevelled-bio
|
||||
documentation: https://github.com/heuermh/dishevelled-bio
|
||||
licence: ['LGPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
or later.
|
||||
homepage: https://github.com/heuermh/dishevelled-bio
|
||||
documentation: https://github.com/heuermh/dishevelled-bio
|
||||
licence: ['LGPL-3.0-or-later']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -9,6 +9,7 @@ tools:
|
|||
or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions.
|
||||
homepage: https://www.ensembl.org/info/docs/tools/vep/index.html
|
||||
documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html
|
||||
licence: ['Apache-2.0']
|
||||
params:
|
||||
- use_cache:
|
||||
type: boolean
|
||||
|
|
|
@ -10,7 +10,7 @@ tools:
|
|||
documentation: https://github.com/Illumina/ExpansionHunter/blob/master/docs/01_Introduction.md
|
||||
tool_dev_url: None
|
||||
doi: "10.1093/bioinformatics/btz431"
|
||||
licence: ['Apache v2.0']
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
A tool designed to provide fast all-in-one preprocessing for FastQ files. This tool is developed in C++ with multithreading supported to afford high performance.
|
||||
documentation: https://github.com/OpenGene/fastp
|
||||
doi: https://doi.org/10.1093/bioinformatics/bty560
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -15,6 +15,7 @@ tools:
|
|||
overrepresented sequences.
|
||||
homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/
|
||||
documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/
|
||||
licence: ['GPL-2.0-only']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -11,6 +11,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
|
||||
input:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -16,6 +16,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,8 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
78
modules/gatk4/createsomaticpanelofnormals/functions.nf
Normal file
78
modules/gatk4/createsomaticpanelofnormals/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
47
modules/gatk4/createsomaticpanelofnormals/main.nf
Normal file
47
modules/gatk4/createsomaticpanelofnormals/main.nf
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GATK4_CREATESOMATICPANELOFNORMALS {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/gatk4:4.2.0.0--0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(genomicsdb)
|
||||
path fasta
|
||||
path fastaidx
|
||||
path dict
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.vcf.gz"), emit: vcf
|
||||
tuple val(meta), path("*.tbi") , emit: tbi
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
gatk \\
|
||||
CreateSomaticPanelOfNormals \\
|
||||
-R $fasta \\
|
||||
-V gendb://$genomicsdb \\
|
||||
-O ${prefix}.vcf.gz \\
|
||||
$options.args
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
55
modules/gatk4/createsomaticpanelofnormals/meta.yml
Normal file
55
modules/gatk4/createsomaticpanelofnormals/meta.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
name: gatk4_createsomaticpanelofnormals
|
||||
description: Create a panel of normals contraining germline and artifactual sites for use with mutect2.
|
||||
keywords:
|
||||
- gatk4
|
||||
- createsomaticpanelofnormals
|
||||
- panelofnormals
|
||||
tools:
|
||||
- gatk4:
|
||||
description: |
|
||||
Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools
|
||||
with a primary focus on variant discovery and genotyping. Its powerful processing engine
|
||||
and high-performance computing features make it capable of taking on projects of any size.
|
||||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test']
|
||||
- genoomicsdb:
|
||||
type: directory
|
||||
description: genomicsDB workspace that contains the samples to create the somatic panel of normals with.
|
||||
pattern: "*_genomicsDBworkspace"
|
||||
- fasta:
|
||||
type: file
|
||||
description: The reference fasta file
|
||||
pattern: "*.fasta"
|
||||
- fastaidx:
|
||||
type: file
|
||||
description: Index of reference fasta file
|
||||
pattern: "fasta.fai"
|
||||
- dict:
|
||||
type: file
|
||||
description: GATK sequence dictionary
|
||||
pattern: "*.dict"
|
||||
|
||||
output:
|
||||
- vcf:
|
||||
type: file
|
||||
description: panel of normal as compressed vcf file
|
||||
pattern: "*.vcf.gz"
|
||||
- tbi:
|
||||
type: file
|
||||
description: Index of vcf file
|
||||
pattern: "*vcf.gz.tbi"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
|
||||
authors:
|
||||
- "@GCJMackenzie"
|
|
@ -1,5 +1,5 @@
|
|||
name: gatk4_fastqtosam
|
||||
description: Converts FastQ file to BAM format
|
||||
description: Converts FastQ file to SAM/BAM format
|
||||
keywords:
|
||||
- bam
|
||||
- fastq
|
||||
|
@ -14,7 +14,7 @@ tools:
|
|||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
tool_dev_url: https://github.com/broadinstitute/gatk
|
||||
doi: "10.1158/1538-7445.AM2017-3590"
|
||||
licence: ['BSD-3-clause']
|
||||
licence: ['MIT']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
78
modules/gatk4/filtermutectcalls/functions.nf
Normal file
78
modules/gatk4/filtermutectcalls/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
65
modules/gatk4/filtermutectcalls/main.nf
Normal file
65
modules/gatk4/filtermutectcalls/main.nf
Normal file
|
@ -0,0 +1,65 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GATK4_FILTERMUTECTCALLS {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/gatk4:4.2.0.0--0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(vcf), path(tbi), path(stats), path(orientationbias), path(segmentation), path(contaminationfile), val(contaminationest)
|
||||
path fasta
|
||||
path fastaidx
|
||||
path dict
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.vcf.gz") , emit: vcf
|
||||
tuple val(meta), path("*.vcf.gz.tbi") , emit: tbi
|
||||
tuple val(meta), path("*.filteringStats.tsv"), emit: stats
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
|
||||
def orientationbias_options = ''
|
||||
if (orientationbias) {
|
||||
orientationbias_options = '--orientation-bias-artifact-priors ' + orientationbias.join(' --orientation-bias-artifact-priors ')
|
||||
}
|
||||
|
||||
def segmentation_options = ''
|
||||
if (segmentation) {
|
||||
segmentation_options = '--tumor-segmentation ' + segmentation.join(' --tumor-segmentation ')
|
||||
}
|
||||
|
||||
def contamination_options = contaminationest ? " --contamination-estimate ${contaminationest} " : ''
|
||||
if (contaminationfile) {
|
||||
contamination_options = '--contamination-table ' + contaminationfile.join(' --contamination-table ')
|
||||
}
|
||||
"""
|
||||
gatk FilterMutectCalls \\
|
||||
-R $fasta \\
|
||||
-V $vcf \\
|
||||
$orientationbias_options \\
|
||||
$segmentation_options \\
|
||||
$contamination_options \\
|
||||
-O ${prefix}.vcf.gz \\
|
||||
$options.args
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
84
modules/gatk4/filtermutectcalls/meta.yml
Normal file
84
modules/gatk4/filtermutectcalls/meta.yml
Normal file
|
@ -0,0 +1,84 @@
|
|||
name: gatk4_filtermutectcalls
|
||||
description: |
|
||||
Filters the raw output of mutect2, can optionally use outputs of calculatecontamination and learnreadorientationmodel to improve filtering.
|
||||
keywords:
|
||||
- filtermutectcalls
|
||||
- mutect2
|
||||
- gatk4
|
||||
- filtervcf
|
||||
tools:
|
||||
- gatk4:
|
||||
description: |
|
||||
Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools
|
||||
with a primary focus on variant discovery and genotyping. Its powerful processing engine
|
||||
and high-performance computing features make it capable of taking on projects of any size.
|
||||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test' ]
|
||||
- vcf:
|
||||
type: file
|
||||
description: compressed vcf file of mutect2calls
|
||||
pattern: "*.vcf.gz"
|
||||
- tbi:
|
||||
type: file
|
||||
description: Index of vcf file
|
||||
pattern: "*vcf.gz.tbi"
|
||||
- stats:
|
||||
type: file
|
||||
description: Stats file that pairs with output vcf file
|
||||
pattern: "*vcf.gz.stats"
|
||||
- orientationbias:
|
||||
type: list
|
||||
description: files containing artifact priors for input vcf. Optional input.
|
||||
pattern: "*.artifact-prior.tar.gz"
|
||||
- segmentation:
|
||||
type: list
|
||||
description: tables containing segmentation information for input vcf. Optional input.
|
||||
pattern: "*.segmentation.table"
|
||||
- contaminationfile:
|
||||
type: list
|
||||
description: table(s) containing contamination contamination data for input vcf. Optional input, takes priority over contaminationest.
|
||||
pattern: "*.contamination.table"
|
||||
- contaminationest:
|
||||
type: val
|
||||
description: estimation of contamination value as a double. Optional input, will only be used if contaminationfile is not specified.
|
||||
- fasta:
|
||||
type: file
|
||||
description: The reference fasta file
|
||||
pattern: "*.fasta"
|
||||
- fastaidx:
|
||||
type: file
|
||||
description: Index of reference fasta file
|
||||
pattern: "fasta.fai"
|
||||
- dict:
|
||||
type: file
|
||||
description: GATK sequence dictionary
|
||||
pattern: "*.dict"
|
||||
|
||||
output:
|
||||
- vcf:
|
||||
type: file
|
||||
description: file containing filtered mutect2 calls.
|
||||
pattern: "*.vcf.gz"
|
||||
- tbi:
|
||||
type: file
|
||||
description: tbi file that pairs with vcf.
|
||||
pattern: "*.vcf.gz.tbi"
|
||||
- stats:
|
||||
type: file
|
||||
description: file containing statistics of the filtermutectcalls run.
|
||||
pattern: "*.filteringStats.tsv"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
|
||||
authors:
|
||||
- "@GCJMackenzie"
|
|
@ -15,6 +15,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -13,6 +13,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -14,6 +14,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -15,6 +15,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -13,7 +13,7 @@ tools:
|
|||
documentation: https://gatk.broadinstitute.org/hc/en-us/articles/360037052812-MarkDuplicates-Picard-
|
||||
tool_dev_url: https://github.com/broadinstitute/gatk
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['BSD-3-clause']
|
||||
licence: ['MIT']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -14,6 +14,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
doi: 10.1158/1538-7445.AM2017-3590
|
||||
licence: ['Apache-2.0']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -9,7 +9,7 @@ tools:
|
|||
documentation: https://github.com/cpockrandt/genmap
|
||||
tool_dev_url: https://github.com/cpockrandt/genmap
|
||||
doi: "10.1093/bioinformatics/btaa222"
|
||||
licence: ['BSD']
|
||||
licence: ['BSD-3-Clause']
|
||||
|
||||
input:
|
||||
- fasta:
|
||||
|
|
|
@ -9,7 +9,7 @@ tools:
|
|||
documentation: https://github.com/cpockrandt/genmap
|
||||
tool_dev_url: https://github.com/cpockrandt/genmap
|
||||
doi: "10.1093/bioinformatics/btaa222"
|
||||
licence: ['BSD']
|
||||
licence: ['BSD-3-Clause']
|
||||
|
||||
input:
|
||||
- fasta:
|
||||
|
|
78
modules/genrich/functions.nf
Normal file
78
modules/genrich/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
69
modules/genrich/main.nf
Normal file
69
modules/genrich/main.nf
Normal file
|
@ -0,0 +1,69 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GENRICH {
|
||||
tag "$meta.id"
|
||||
label 'process_high'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::genrich=0.6.1" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/genrich:0.6.1--h5bf99c6_1"
|
||||
} else {
|
||||
container "quay.io/biocontainers/genrich:0.6.1--h5bf99c6_1"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(treatment_bam)
|
||||
path control_bam
|
||||
path blacklist_bed
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*narrowPeak") , emit: peaks
|
||||
tuple val(meta), path("*pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues
|
||||
tuple val(meta), path("*pileup.bedGraph") , optional:true, emit: bedgraph_pileup
|
||||
tuple val(meta), path("*intervals.bed") , optional:true, emit: bed_intervals
|
||||
tuple val(meta), path("*duplicates.txt") , optional:true, emit: duplicates
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
def control = params.control_bam ? "-c $control_bam" : ''
|
||||
def pvalues = params.pvalues ? "-f ${prefix}.pvalues.bedGraph" : ""
|
||||
def pileup = params.pileup ? "-k ${prefix}.pileup.bedGraph" : ""
|
||||
def bed = params.bed ? "-b ${prefix}.intervals.bed" : ""
|
||||
def blacklist = params.blacklist_bed ? "-E $blacklist_bed" : ""
|
||||
def duplicates = ""
|
||||
if (params.save_duplicates) {
|
||||
if (options.args.contains('-r')) {
|
||||
duplicates = "-R ${prefix}.duplicates.txt"
|
||||
} else {
|
||||
log.info '[Genrich] Duplicates can only be saved if they are filtered, defaulting to -r option (Remove PCR duplicates).'
|
||||
duplicates = "-r -R ${prefix}.duplicates.txt"
|
||||
}
|
||||
}
|
||||
"""
|
||||
Genrich \\
|
||||
-t $treatment_bam \\
|
||||
$options.args \\
|
||||
$control \\
|
||||
$blacklist \\
|
||||
-o ${prefix}.narrowPeak \\
|
||||
$pvalues \\
|
||||
$pileup \\
|
||||
$bed \\
|
||||
$duplicates \\
|
||||
$blacklist \\
|
||||
$control
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$(echo \$(Genrich --version 2>&1) | sed 's/^Genrich, version //; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
71
modules/genrich/meta.yml
Normal file
71
modules/genrich/meta.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
name: genrich
|
||||
description: Peak-calling for ChIP-seq and ATAC-seq enrichment experiments
|
||||
keywords:
|
||||
- peak-calling
|
||||
- ChIP-seq
|
||||
- ATAC-seq
|
||||
tools:
|
||||
- genrich:
|
||||
description: |
|
||||
Genrich is a peak-caller for genomic enrichment assays (e.g. ChIP-seq, ATAC-seq).
|
||||
It analyzes alignment files generated following the assay and produces a file
|
||||
detailing peaks of significant enrichment.
|
||||
homepage: https://github.com/jsh58/Genrich
|
||||
documentation: https://github.com/jsh58/Genrich#readme
|
||||
tool_dev_url: https://github.com/jsh58/Genrich
|
||||
doi: ""
|
||||
licence: ['MIT']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- treatment_bam:
|
||||
type: file
|
||||
description: Coordinate sorted BAM/SAM file from treatment sample
|
||||
pattern: "*.{bam,sam}"
|
||||
- control_bam:
|
||||
type: file
|
||||
description: Coordinate sorted BAM/SAM file from control sample
|
||||
pattern: "*.{bam,sam}"
|
||||
- blacklist_bed:
|
||||
type: file
|
||||
description: Bed file containing genomic intervals to exclude from the analysis
|
||||
pattern: "*.{bed}"
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- peaks:
|
||||
type: file
|
||||
description: Output file is in ENCODE narrowPeak format
|
||||
pattern: "*.{narrowPeak}"
|
||||
- bedgraph_pvalues:
|
||||
type: file
|
||||
description: bedGraph file containing p/q values
|
||||
pattern: "*.{pvalues.bedGraph}"
|
||||
- bedgraph_pileup:
|
||||
type: file
|
||||
description: bedGraph file containing pileups and p-values
|
||||
pattern: "*.{pileup.bedGraph}"
|
||||
- bed_intervals:
|
||||
type: file
|
||||
description: Bed file containing annotated intervals
|
||||
pattern: "*.{intervals.bed}"
|
||||
- duplicates:
|
||||
type: file
|
||||
description: Text output file containing intervals corresponding to PCR duplicates
|
||||
pattern: "*.{intervals.txt}"
|
||||
- version:
|
||||
type: file
|
||||
description: File containing software version
|
||||
pattern: "*.{version.txt}"
|
||||
|
||||
authors:
|
||||
- "@JoseEspinosa"
|
||||
|
|
@ -10,7 +10,7 @@ tools:
|
|||
documentation: https://github.com/dnanexus-rnd/GLnexus/wiki/Getting-Started
|
||||
tool_dev_url: None
|
||||
doi: https://doi.org/10.1101/343970
|
||||
licence: ['Apache License 2.0']
|
||||
licence: ['Apache-2.0']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
|
|
|
@ -12,6 +12,7 @@ tools:
|
|||
A versatile pairwise aligner for genomic and spliced nucleotide sequences.
|
||||
homepage: https://github.com/lbcb-sci/graphmap2
|
||||
documentation: https://github.com/lbcb-sci/graphmap2#graphmap2---a-highly-sensitive-and-accurate-mapper-for-long-error-prone-reads
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
|
|
|
@ -10,6 +10,7 @@ tools:
|
|||
A versatile pairwise aligner for genomic and spliced nucleotide sequences.
|
||||
homepage: https://github.com/lbcb-sci/graphmap2
|
||||
documentation: https://github.com/lbcb-sci/graphmap2#graphmap2---a-highly-sensitive-and-accurate-mapper-for-long-error-prone-reads
|
||||
licence: ['MIT']
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
|
|
78
modules/gstama/collapse/functions.nf
Normal file
78
modules/gstama/collapse/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
52
modules/gstama/collapse/main.nf
Normal file
52
modules/gstama/collapse/main.nf
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GSTAMA_COLLAPSE {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::gs-tama=1.0.2" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/gs-tama:1.0.2--hdfd78af_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/gs-tama:1.0.2--hdfd78af_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(bam)
|
||||
path fasta
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.bed") , emit: bed
|
||||
tuple val(meta), path("*_trans_read.bed") , emit: bed_trans_reads
|
||||
tuple val(meta), path("*_local_density_error.txt"), emit: local_density_error
|
||||
tuple val(meta), path("*_polya.txt") , emit: polya
|
||||
tuple val(meta), path("*_read.txt") , emit: read
|
||||
tuple val(meta), path("*_strand_check.txt") , emit: strand_check
|
||||
tuple val(meta), path("*_trans_report.txt") , emit: trans_report
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
tuple val(meta), path("*_varcov.txt") , emit: varcov , optional: true
|
||||
tuple val(meta), path("*_variants.txt") , emit: variants, optional: true
|
||||
|
||||
script:
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
tama_collapse.py \\
|
||||
-s $bam \\
|
||||
-f $fasta \\
|
||||
-p ${prefix} \\
|
||||
$options.args
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$( tama_collapse.py -version | grep 'tc_version_date_'|sed 's/tc_version_date_//g' )
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue