Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions modules/nf-core/homer/annotatepeaks/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::bioconductor-deseq2=1.42.0
- bioconda::bioconductor-edger=4.0.16
- bioconda::homer=4.11
- bioconda::samtools=1.21
- conda-forge::r-essentials=4.3
- bioconda::bioconductor-deseq2=1.46.0
- bioconda::bioconductor-edger=4.4.0
- bioconda::homer=5.1
- bioconda::samtools=1.22.1
- conda-forge::r-essentials=4.4
- conda-forge::wget=1.21.4
11 changes: 7 additions & 4 deletions modules/nf-core/homer/annotatepeaks/main.nf
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
process HOMER_ANNOTATEPEAKS {
tag "${meta.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
// singularity build url: https://wave.seqera.io/view/builds/bd-9c603739ae7d4fd3_1
// docker build url: https://wave.seqera.io/view/builds/bd-08c7bb832e96c6bd_1
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/0f/0fe4a3875b78dce3c66b43fb96489769cc32e55e329e2525d2af09096af2252a/data'
: 'community.wave.seqera.io/library/bioconductor-deseq2_bioconductor-edger_homer_samtools_pruned:a8f4c58755bb281b'}"
? 'oras://community.wave.seqera.io/library/bioconductor-deseq2_bioconductor-edger_homer_samtools_pruned:9c603739ae7d4fd3'
: 'community.wave.seqera.io/library/bioconductor-deseq2_bioconductor-edger_homer_samtools_pruned:08c7bb832e96c6bd'}"

input:
tuple val(meta), path(peak)
Expand All @@ -22,7 +25,7 @@ process HOMER_ANNOTATEPEAKS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '4.11'
def VERSION = '5.1'
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
annotatePeaks.pl \\
Expand All @@ -41,7 +44,7 @@ process HOMER_ANNOTATEPEAKS {

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '4.11'
def VERSION = '5.1'
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}.annotatePeaks.txt
Expand Down
10 changes: 5 additions & 5 deletions modules/nf-core/homer/findpeaks/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::bioconductor-deseq2=1.42.0
- bioconda::bioconductor-edger=4.0.16
- bioconda::homer=4.11
- bioconda::samtools=1.21
- conda-forge::r-essentials=4.3
- bioconda::bioconductor-deseq2=1.46.0
- bioconda::bioconductor-edger=4.4.0
- bioconda::homer=5.1
- bioconda::samtools=1.22.1
- conda-forge::r-essentials=4.4
- conda-forge::wget=1.21.4
67 changes: 56 additions & 11 deletions modules/nf-core/homer/findpeaks/main.nf
Original file line number Diff line number Diff line change
@@ -1,34 +1,65 @@
process HOMER_FINDPEAKS {
tag "${meta.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
// singularity build url: https://wave.seqera.io/view/builds/bd-9c603739ae7d4fd3_1
// docker build url: https://wave.seqera.io/view/builds/bd-08c7bb832e96c6bd_1
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/0f/0fe4a3875b78dce3c66b43fb96489769cc32e55e329e2525d2af09096af2252a/data'
: 'community.wave.seqera.io/library/bioconductor-deseq2_bioconductor-edger_homer_samtools_pruned:a8f4c58755bb281b'}"
? 'oras://community.wave.seqera.io/library/bioconductor-deseq2_bioconductor-edger_homer_samtools_pruned:9c603739ae7d4fd3'
: 'community.wave.seqera.io/library/bioconductor-deseq2_bioconductor-edger_homer_samtools_pruned:08c7bb832e96c6bd'}"

input:
val(style)
tuple val(meta), path(tagDir)
tuple val(meta2), path(controlTagDir)
path uniqmap

output:
tuple val(meta), path("*.peaks.txt"), emit: txt
tuple val(meta), path("*.txt"), emit: txt
tuple val(meta), path("*.gtf"), optional: true, emit: gtf
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: uniqmap ? "${meta.id}-${uniqmap.baseName}" : "${meta.id}"
def prefix = task.ext.prefix ?: "${meta.id}"
def uniqmap_flag = uniqmap ? "-uniqmap ${uniqmap}" : ""
def VERSION = '4.11'
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
def control_flag = controlTagDir ? "-i ${controlTagDir}" : ""
def control_suffix = controlTagDir ? "_vs_${meta2.id}" : ""
def VERSION = '5.1'

// Validate style
def valid_styles = ['factor', 'histone', 'groseq', 'tss', 'dnase', 'super', 'mC']
if (!valid_styles.contains(style)) {
error "style must be one of: ${valid_styles.join(', ')}"
}

// Determine output suffix based on style
def output_suffix_map = [
'factor': 'peaks.txt',
'histone': 'regions.txt',
'groseq': 'transcripts.txt',
'tss': 'tss.txt',
'dnase': 'peaks.txt',
'super': 'superEnhancers.txt',
'mC': 'regions.txt'
]
def output_suffix = output_suffix_map[style]
def output_filename = "${prefix}${control_suffix}_${output_suffix}"

def groseq_gtf_arg = style == "groseq" ? "-gtf ${prefix}${control_suffix}_transcripts.gtf" : ""

"""
findPeaks \\
${tagDir} \\
-style ${style} \\
${control_flag} \\
${args} \\
-o ${prefix}.peaks.txt \\
${groseq_gtf_arg} \\
-o ${output_filename} \\
${uniqmap_flag}

cat <<-END_VERSIONS > versions.yml
Expand All @@ -39,11 +70,25 @@ process HOMER_FINDPEAKS {

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '4.11'
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def control_suffix = controlTagDir ? "_vs_${meta2.id}" : ""
def VERSION = '5.1'

def output_suffix_map = [
'factor': 'peaks.txt',
'histone': 'regions.txt',
'groseq': 'transcripts.txt',
'tss': 'tss.txt',
'dnase': 'peaks.txt',
'super': 'superEnhancers.txt',
'mC': 'regions.txt'
]
def output_suffix = output_suffix_map[style]
def output_filename = "${prefix}${control_suffix}_${output_suffix}"
def gtf_filename = "${prefix}${control_suffix}_transcripts.gtf"

"""
touch ${prefix}.peaks.txt
touch ${output_filename}
${style == 'groseq' ? "touch ${gtf_filename}" : ''}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
36 changes: 34 additions & 2 deletions modules/nf-core/homer/findpeaks/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ tools:
licence: ["GPL-3.0-or-later"]
identifier: biotools:homer
input:
- style:
type: string
description: |
One of factor, histone, groseq, tss, dnase, super or mC. See the homer
findPeak documentation for more information. The choice of style does
affect which parameters must be passed in through `ext.args`, and affects
the suffix of the output file (e.g. if style is factor, then the file output
to the txt channel will be *_peaks.txt. See output for more information.)
- - meta:
type: map
description: |
Expand All @@ -24,10 +32,19 @@ input:
type: directory
description: "The 'Tag Directory'"
pattern: "tagDir"
- - meta2:
type: map
description: |
Groovy map containing sample information for the control sample
e.g. [ id: "control", single_end: false ]
- controlTagDir:
type: directory
description: "The 'Tag Directory' for the control sample"
pattern: "controlTagDir"
- uniqmap:
type: directory
description: "(directory of binary files specifying uniquely mappable locations)
Download from http://biowhat.ucsd.edu/homer/groseq/"
Download from http://biowha t.ucsd.edu/homer/groseq/"
pattern: "uniqmap/"
output:
txt:
Expand All @@ -36,7 +53,21 @@ output:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.peaks.txt":
- "*.txt":
type: file
description: |
One of *_peaks.txt, *_regions, *_transcripts.txt,
*_tss.txt, *_superEnhancer.txt. Which depends on the `style`, e.g. for
style factor, the output txt file would be *_peaks.txt
pattern: "*.txt"
ontologies: []
gtf:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.gtf":
type: file
description: "Peaks in txt file"
pattern: "*.peaks.txt"
Expand All @@ -52,3 +83,4 @@ authors:
- "@edmundmiller"
maintainers:
- "@edmundmiller"
- "@cmatkhan"
20 changes: 13 additions & 7 deletions modules/nf-core/homer/findpeaks/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ nextflow_process {
when {
process {
"""
input[0] = HOMER_MAKETAGDIRECTORY.out.tagdir
input[1] = []
input[0] = "factor"
input[1] = HOMER_MAKETAGDIRECTORY.out.tagdir
input[2] = [[:], []]
input[3] = []
"""
}
}
Expand All @@ -71,8 +73,10 @@ nextflow_process {
when {
process {
"""
input[0] = HOMER_MAKETAGDIRECTORY.out.tagdir
input[1] = []
input[0] = "factor"
input[1] = HOMER_MAKETAGDIRECTORY.out.tagdir
input[2] = [[:], []]
input[3] = []
"""
}
}
Expand All @@ -92,8 +96,10 @@ nextflow_process {
when {
process {
"""
input[0] = HOMER_MAKETAGDIRECTORY.out.tagdir
input[1] = UNZIP.out.unzipped_archive.map { it[1] }
input[0] = "factor"
input[1] = HOMER_MAKETAGDIRECTORY.out.tagdir
input[2] = [[:], []]
input[3] = UNZIP.out.unzipped_archive.map { it[1] }
"""
}
}
Expand All @@ -111,4 +117,4 @@ nextflow_process {
)
}
}
}
}
Loading
Loading