-
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.
- Loading branch information
1 parent
cbf2d59
commit 075450e
Showing
7 changed files
with
142 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
process BEDOPS_BEDMAP { | ||
tag { meta.id } | ||
label 'process_single' | ||
container 'nciccbr/ccbr_ubuntu_base_20.04:v6.1' | ||
|
||
input: | ||
tuple val(meta1), path(refbed) | ||
tuple val(meta2), path(mapbed) | ||
|
||
output: | ||
tuple val(meta2), 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} \\ | ||
> ${meta2.id}.mapped.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bedops: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
""" | ||
touch ${meta2.id}.mapped.bed versions.yml | ||
""" | ||
} |
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
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,26 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { CAT_CAT } from '../../../../../modules/CCBR/cat/cat/main.nf' | ||
include { BEDOPS_BEDMAP } from '../../../../../modules/CCBR/bedops/bedmap/main.nf' | ||
include { BEDTOOLS_SORT as SORT_CAT | ||
BEDTOOLS_SORT as SORT_PEAK } from '../../../../../modules/CCBR/bedtools/sort/main.nf' | ||
include { BEDTOOLS_MERGE } from '../../../../../modules/CCBR/bedtools/merge/main.nf' | ||
|
||
workflow test_bedops_bedmap { | ||
|
||
ch_peaks = [ | ||
[ id: 'test', group: 'macs_broad' ], // meta map | ||
[ file(params.test_data['macs_peaks_1'], checkIfExists: true), | ||
file(params.test_data['macs_peaks_2'], checkIfExists: true), | ||
] | ||
] | ||
|
||
ch_peaks.collect() | CAT_CAT | ||
CAT_CAT.out.file_out | SORT_CAT | ||
SORT_CAT.out.sorted | BEDTOOLS_MERGE | ||
|
||
ch_peaks | SORT_PEAK | ||
BEDOPS_BEDMAP( BEDTOOLS_MERGE.out.bed, SORT_PEAK.out.sorted ) | ||
} |
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,7 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
} | ||
|
||
includeConfig '../../../../config/test_data_CCBR.config' |
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,12 @@ | ||
## TODO nf-core: Please run the following command to build this file: | ||
# nf-core modules create-test-yml /bedmap | ||
- name: "bedops bedmap" | ||
command: nextflow run ./tests/modules/CCBR/bedops/bedmap -entry test_bedops_bedmap -c ./tests/config/nextflow.config | ||
tags: | ||
- "bedops" | ||
- "bedops/bedmap" | ||
files: | ||
- path: "output/bedops/test.bam" | ||
md5sum: e667c7caad0bc4b7ac383fd023c654fc | ||
- path: "output/bedops/versions.yml" | ||
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b |