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

add new module iCount-mini/metagene #3612

Merged
Merged
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
48 changes: 48 additions & 0 deletions modules/nf-core/icountmini/metagene/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process ICOUNTMINI_METAGENE {
tag "$meta.id"
label 'process_low'

conda "bioconda::icount-mini=3.0.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/icount-mini:3.0.0--pyh7cba7a3_0':
'biocontainers/icount-mini:3.0.0--pyh7cba7a3_0' }"

input:
tuple val(meta), path(bed)
path segmentation

output:
tuple val(meta), path("metagene_*/*plot_data.tsv"), emit: tsv
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}"

"""
mv $bed ${prefix}.bed

iCount-Mini metagene \\
${prefix}.bed \\
$segmentation \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
iCount-Mini: \$(iCount-Mini -v)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch metagene_${prefix}/${prefix}_plot_data.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
iCount-Mini: \$(iCount-Mini -v)
END_VERSIONS
"""
}
44 changes: 44 additions & 0 deletions modules/nf-core/icountmini/metagene/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: icountmini_metagene
description: Plot a metagene of cross-link events/sites around various transcriptomic landmarks.
keywords:
- iCLIP
- gtf
- genomics
tools:
- icount:
description: Computational pipeline for analysis of iCLIP data
homepage: https://icount.readthedocs.io/en/latest/
documentation: https://icount.readthedocs.io/en/latest/
licence: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bed:
type: file
description: BED file of crosslinks
- segmentation:
type: file
description: A iCount segmentation file
pattern: "*.{gtf}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- tsv:
type: file
description: Metagene table
pattern: "*.tsv"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@marc-jones"
- "@chris-cheshire"
- "@charlotteanne"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,10 @@ ichorcna/run:
- modules/nf-core/ichorcna/run/**
- tests/modules/nf-core/ichorcna/run/**

icountmini/metagene:
- modules/nf-core/icountmini/metagene/**
- tests/modules/nf-core/icountmini/metagene/**

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

nextflow.enable.dsl = 2

include { ICOUNTMINI_SEGMENT } from '../../../../../modules/nf-core/icountmini/segment/main.nf'
include { ICOUNTMINI_METAGENE} from '../../../../../modules/nf-core/icountmini/metagene/main.nf'

workflow test_icountmini_metagene {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_21_gencode_gtf'], checkIfExists: true)
]

ICOUNTMINI_SEGMENT (
input,
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
)

bed = [
[ id:'test' ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true)
]

ICOUNTMINI_METAGENE (
bed,
ICOUNTMINI_SEGMENT.out.gtf.map{ it[1] }
)
}

5 changes: 5 additions & 0 deletions tests/modules/nf-core/icountmini/metagene/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()}" }

}
9 changes: 9 additions & 0 deletions tests/modules/nf-core/icountmini/metagene/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: icountmini metagene test_icountmini_metagene
command: nextflow run ./tests/modules/nf-core/icountmini/metagene -entry test_icountmini_metagene -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/icountmini/metagene/nextflow.config
tags:
- icountmini
- icountmini/metagene
files:
- path: output/icountmini/metagene_test/test_plot_data.tsv
md5sum: 63032c9e159e81f617e30bcb1c3c8509
- path: output/icountmini/versions.yml