-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from CCBR/consensus-peaks
feat: add consensus peaks subworkflow
- Loading branch information
Showing
56 changed files
with
2,146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
process BEDOPS_BEDMAP { | ||
tag "${meta.id}.${refmeta.id}" | ||
label 'process_single' | ||
container 'nciccbr/ccbr_ubuntu_base_20.04:v6.1' | ||
|
||
input: | ||
tuple val(meta), path(mapbed), val(refmeta), path(refbed) | ||
|
||
output: | ||
tuple val(meta), path("*.mapped.bed"), emit: bed | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
""" | ||
bedmap \\ | ||
--delim '\t' \\ | ||
--echo-ref-name \\ | ||
--count \\ | ||
${refbed} \\ | ||
${mapbed} \\ | ||
> ${meta.id}.${refmeta.id}.mapped.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedops: \$(echo \$(bedops --version 2>&1 | grep version | sed 's/version: //')) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
""" | ||
touch ${meta.id}.${refmeta.id}.mapped.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedops: \$(echo \$(bedops --version 2>&1 | grep version | sed 's/version: //')) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
name: "bedops_bedmap" | ||
description: The bedmap program is used to retrieve and process signal or other features over regions of interest in BED files | ||
keywords: | ||
- bedops | ||
- bedmap | ||
- bed | ||
- intervals | ||
tools: | ||
- bedops: | ||
description: | | ||
fast, highly scalable and easily-parallelizable genome analysis toolkit | ||
documentation: https://bedops.readthedocs.io/ | ||
tool_dev_url: https://github.com/bedops/bedops | ||
licence: ["GPLv2"] | ||
doi: 10.1093/bioinformatics/bts277 | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- refbed: | ||
type: file | ||
description: BED file | ||
pattern: "*.bed" | ||
- mapbed: | ||
type: file | ||
description: BED file | ||
pattern: "*.bed" | ||
|
||
output: | ||
#Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- mapped_bed: | ||
type: file | ||
description: BED file | ||
pattern: "*.bed" | ||
|
||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@kelly-sovacool" | ||
maintainers: | ||
- "@kelly-sovacool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
process BEDTOOLS_MAP { | ||
tag { meta.id } | ||
label 'process_single' | ||
|
||
container 'nciccbr/ccbr_ubuntu_base_20.04:v6.1' | ||
|
||
input: | ||
tuple val(meta), path(intervals1), path(intervals2) | ||
tuple val(meta2), path(chrom_sizes) | ||
|
||
output: | ||
tuple val(meta), path("*.${extension}"), emit: map | ||
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}.mapped" | ||
extension = intervals1.getExtension() | ||
def sizes = chrom_sizes ? "-g ${chrom_sizes}" : '' | ||
if ("$intervals1" == "${prefix}.${extension}" || | ||
"$intervals2" == "${prefix}.${extension}") | ||
error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
""" | ||
bedtools \\ | ||
map \\ | ||
-a ${intervals1} \\ | ||
-b ${intervals2} \\ | ||
${args} \\ | ||
${sizes} \\ | ||
> ${prefix}.${extension} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}.mapped" | ||
extension = intervals1.getExtension() | ||
if ("${intervals1}" == "${prefix}.${extension}" || | ||
"${intervals2}" == "${prefix}.${extension}") | ||
error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
""" | ||
touch ${prefix}.${extension} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: bedtools_map | ||
description: Allows one to screen for overlaps between two sets of genomic features. Adapted from https://github.com/nf-core/modules/tree/fff2c3fc7cdcb81a2a37c3263b8ace9b353af407/modules/nf-core/bedtools | ||
keywords: | ||
- bed | ||
- vcf | ||
- gff | ||
- map | ||
- bedtools | ||
tools: | ||
- bedtools: | ||
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/map.html | ||
licence: ["MIT"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- intervals1: | ||
type: file | ||
description: BAM/BED/GFF/VCF | ||
pattern: "*.{bed|gff|vcf}" | ||
- intervals2: | ||
type: file | ||
description: BAM/BED/GFF/VCF | ||
pattern: "*.{bed|gff|vcf}" | ||
- meta2: | ||
type: map | ||
description: | | ||
Groovy Map containing reference chromosome sizes | ||
e.g. [ id:'test' ] | ||
- chrom_sizes: | ||
type: file | ||
description: Chromosome sizes file | ||
pattern: "*{.sizes,.txt}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- map: | ||
type: file | ||
description: File containing the description of overlaps found between the features in A and the features in B, with statistics | ||
pattern: "*.${extension}" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@kelly-sovacool" | ||
maintainers: | ||
- "@kelly-sovacool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
process BEDTOOLS_MERGE { | ||
tag { meta.id } | ||
label 'process_single' | ||
|
||
container 'nciccbr/ccbr_ubuntu_base_20.04:v6.1' | ||
|
||
input: | ||
tuple val(meta), path(bed) | ||
|
||
output: | ||
tuple val(meta), path('*.bed'), emit: bed | ||
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}.merged" | ||
if ("$bed" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
""" | ||
bedtools \\ | ||
merge \\ | ||
-i ${bed} \\ | ||
${args} \\ | ||
> ${prefix}.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}.merged" | ||
""" | ||
touch ${prefix}.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: bedtools_merge | ||
description: combines overlapping or “book-ended” features in an interval file into a single feature which spans all of the combined features. Adapted from https://github.com/nf-core/modules/tree/fff2c3fc7cdcb81a2a37c3263b8ace9b353af407/modules/nf-core/bedtools | ||
keywords: | ||
- bed | ||
- merge | ||
- bedtools | ||
- overlapped bed | ||
tools: | ||
- bedtools: | ||
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 | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- bed: | ||
type: file | ||
description: Input BED file | ||
pattern: "*.{bed}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- bed: | ||
type: file | ||
description: Overlapped bed file with combined features | ||
pattern: "*.{bed}" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@kelly-sovacool" | ||
maintainers: | ||
- "@kelly-sovacool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
process BEDTOOLS_SORT { | ||
tag { meta.id } | ||
label 'process_single' | ||
|
||
container 'nciccbr/ccbr_ubuntu_base_20.04:v6.1' | ||
|
||
input: | ||
tuple val(meta), path(intervals) | ||
path genome_file | ||
|
||
output: | ||
tuple val(meta), path("*.${extension}"), emit: sorted | ||
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}.sorted" | ||
def genome_cmd = genome_file ? "-g $genome_file" : "" | ||
extension = task.ext.suffix ?: intervals.extension | ||
if ("$intervals" == "${prefix}.${extension}") { | ||
error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
} | ||
""" | ||
bedtools \\ | ||
sort \\ | ||
-i ${intervals} \\ | ||
${genome_cmd} \\ | ||
${args} \\ | ||
> ${prefix}.${extension} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}.sorted" | ||
extension = task.ext.suffix ?: intervals.extension | ||
""" | ||
touch ${prefix}.${extension} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") | ||
END_VERSIONS | ||
""" | ||
} |
Oops, something went wrong.