Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW MODULE: PURECLIP #3624

Merged
merged 14 commits into from
Jul 12, 2023
69 changes: 69 additions & 0 deletions modules/nf-core/pureclip/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
process PURECLIP {
tag "$meta.id"
label 'process_high'

conda "bioconda::pureclip=1.3.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/pureclip:1.3.1--0':
'biocontainers/pureclip:1.3.1--0' }"

input:
tuple val(meta), path(ipbam), path(controlbam)
tuple val(meta), path(ipbai), path(controlbai)
path genome_fasta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a look at some other modules, i thought the rule now was that all inputs like this now needed meta - tuple val(meta2), path(genome_fasta)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you point me to a module like that? havent seen it in any other modules ive looked at

val input_control

output:
tuple val(meta), path("${crosslinks_output_name}"), emit: crosslinks
tuple val(meta), path("${peaks_output_name}") , emit: peaks
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}"
crosslinks_output_name = "${prefix}_pureclip_crosslinks.bed"
peaks_output_name = "${prefix}_pureclip_peaks.bed"

if(input_control){
control_bam = "-ibam $controlbam"
control_bai = "-ibai $controlbai"
} else {
control_bam = ""
control_bai = ""
}

"""
pureclip \
-i $ipbam \
-bai $ipbai \
-g $genome_fasta \
-nt ${task.cpus} \
-o $crosslinks_output_name \
-or $peaks_output_name \
${control_bam} \
${control_bai} \
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
pureclip: \$(echo \$(pureclip --version 2>&1) | sed 's/^.*pureclip //; s/Using.*\$//; s/version: //; s/ Seq.*//' ))
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}_pureclip_crosslinks.bed
touch ${prefix}_pureclip_peaks.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
pureclip: \$(echo \$(pureclip --version 2>&1) | sed 's/^.*pureclip //; s/Using.*\$//; s/version: //; s/ Seq.*//' ))
END_VERSIONS
"""
}
77 changes: 77 additions & 0 deletions modules/nf-core/pureclip/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: "pureclip"
description: PureCLIP is a tool to detect protein-RNA interaction footprints from single-nucleotide CLIP-seq data, such as iCLIP and eCLIP.
keywords:
- iCLIP
- eCLIP
- CLIP
tools:
- "pureclip":
description: "PureCLIP is a tool to detect protein-RNA interaction footprints from single-nucleotide CLIP-seq data, such as iCLIP and eCLIP."
homepage: "https://github.com/skrakau/PureCLIP"
documentation: "https://pureclip.readthedocs.io/en/latest/GettingStarted/index.html"
tool_dev_url: "https://github.com/skrakau/PureCLIP"
doi: "10.1186/s13059-017-1364-2"
licence: "['GPL v3']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`

- ipbam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

- controlbam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

- ipbai:
type: file
description: BAM index
pattern: "*.{bai}"

- controlbai:
type: file
description: BAM index
pattern: "*.{bai}"

- input_control:
type: boolean
description: Whether to run PureCLIP with an input control

- genome_fasta:
type: file
description: FASTA file of reference genome
pattern: "*.{fa,fasta,fa.gz,fasta.gz}"

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"

- crosslinks:
type: file
description: Bed file of crosslinks
pattern: "*.{bed}"

- peaks:
type: file
description: Bed file of peaks
pattern: "*.{bed}"

authors:
- "@charlotteanne"
- "@marcjones"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2879,6 +2879,10 @@ proteus/readproteingroups:
- modules/nf-core/proteus/readproteingroups/**
- tests/modules/nf-core/proteus/readproteingroups/**

pureclip:
- modules/nf-core/pureclip/**
- tests/modules/nf-core/pureclip/**

purecn/coverage:
- modules/nf-core/purecn/coverage/**
- tests/modules/nf-core/purecn/coverage/**
Expand Down
43 changes: 43 additions & 0 deletions tests/modules/nf-core/pureclip/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { PURECLIP } from '../../../../modules/nf-core/pureclip/main.nf'

workflow test_pureclip_no_ctrl {
input_bam = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ],
[ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true) ]] //dummy file

input_bai = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ],
[ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], checkIfExists: true) ]] //dummy file

fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)

PURECLIP (
input_bam,
input_bai,
fasta,
false
)
}

workflow test_pureclip_input_ctrl {
input_bam = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ],
[ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true) ]]

input_bai = [ [ id:'test', single_end:false ], // meta map
[ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ],
[ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], checkIfExists: true) ]]

genome = [file( params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)]

PURECLIP (
input_bam,
input_bai,
genome,
true
)
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/pureclip/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
21 changes: 21 additions & 0 deletions tests/modules/nf-core/pureclip/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- name: pureclip test_pureclip_no_ctrl
command: nextflow run ./tests/modules/nf-core/pureclip -entry test_pureclip_no_ctrl -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pureclip/nextflow.config
tags:
- pureclip
files:
- path: output/pureclip/test_pureclip_crosslinks.bed
md5sum: c13c98e4d205025a3a824fbf36aaeef5
- path: output/pureclip/test_pureclip_peaks.bed
md5sum: 5fa8033fbe5901ac68a5b11e47aa22c6
- path: output/pureclip/versions.yml

- name: pureclip test_pureclip_input_ctrl
command: nextflow run ./tests/modules/nf-core/pureclip -entry test_pureclip_input_ctrl -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pureclip/nextflow.config
tags:
- pureclip
files:
- path: output/pureclip/test_pureclip_crosslinks.bed
md5sum: 511696bc8fab569c562f1cbc8ff01c45
- path: output/pureclip/test_pureclip_peaks.bed
md5sum: 927987b0ab82b08255caa4b5d143729b
- path: output/pureclip/versions.yml
Loading