mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-13 05:13:09 +00:00
feat(pints): Add initial caller module (#1983)
* feat(pints): Add initial caller module * docs(pints): Add initial documentation * chore: Add TODOs * test(pypints): Use docker image for singularity The image doesn't exist yet for some reason * test(pints): Remove unidirectional peaks hash * style(pints): Align emits
This commit is contained in:
parent
409a308ba4
commit
2f1555bf77
6 changed files with 152 additions and 0 deletions
43
modules/pints/caller/main.nf
Normal file
43
modules/pints/caller/main.nf
Normal file
|
@ -0,0 +1,43 @@
|
|||
process PINTS_CALLER {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::pypints=1.1.6" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/pypints:1.1.6--pyh5e36f6f_1' :
|
||||
'quay.io/biocontainers/pypints:1.1.6--pyh5e36f6f_1' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(bams)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*_divergent_peaks.bed") , emit: divergent_TREs
|
||||
tuple val(meta), path("*_bidirectional_peaks.bed") , emit: bidirectional_TREs
|
||||
tuple val(meta), path("*_unidirectional_peaks.bed"), emit: unidirectional_TREs
|
||||
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}"
|
||||
// TODO handle bigwigs
|
||||
// def input_type = ("${input[0]}".endsWith(".bam")) ? "--bam-file $input" :
|
||||
// ("$input".contains(".bw")) ? "--bw-pl ${input[0]} --bw-mn ${input[1]}" :
|
||||
// error "Please use bam or BigWig files"
|
||||
"""
|
||||
pints_caller \\
|
||||
--bam-file $bams \\
|
||||
--save-to . \\
|
||||
--file-prefix $prefix \\
|
||||
--thread $task.cpus \\
|
||||
$args
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
python: \$(python --version | sed 's/Python //g')
|
||||
pints: \$(pints_caller --version)
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
59
modules/pints/caller/meta.yml
Normal file
59
modules/pints/caller/meta.yml
Normal file
|
@ -0,0 +1,59 @@
|
|||
name: "pints_caller"
|
||||
description: Main caller script for peak calling
|
||||
keywords:
|
||||
- peak-calling
|
||||
- CoPRO
|
||||
- GRO-cap
|
||||
- PRO-cap
|
||||
- CAGE
|
||||
- NETCAGE
|
||||
- RAMPAGE
|
||||
- csRNA-seq
|
||||
- STRIPE-seq
|
||||
- PRO-seq
|
||||
- GRO-seq
|
||||
tools:
|
||||
- "pints":
|
||||
description: "Peak Identifier for Nascent Transcripts Starts (PINTS)"
|
||||
homepage: "https://pints.yulab.org/"
|
||||
documentation: "https://github.com/hyulab/PINTS/blob/main/README.md"
|
||||
tool_dev_url: "https://github.com/hyulab/PINTS"
|
||||
doi: "https://doi.org/10.1038/s41587-022-01211-7"
|
||||
licence: "['GPL']"
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- bams:
|
||||
type: file
|
||||
description: BAM/ file
|
||||
pattern: "*.{bam}"
|
||||
|
||||
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"
|
||||
- divergent_TREs:
|
||||
type: file
|
||||
description: Divergent TREs
|
||||
pattern: "*_divergent_peaks.bed"
|
||||
- bidirectional_TREs:
|
||||
type: file
|
||||
description: Divergent TREs and convergent TREs
|
||||
pattern: "*_bidirectional_peaks.bed"
|
||||
- unidirectional_TREs:
|
||||
type: file
|
||||
description: Unidirectional TREs, maybe lncRNAs transcribed from enhancers (e-lncRNAs)
|
||||
pattern: "*_unidirectional_peaks.bed"
|
||||
|
||||
authors:
|
||||
- "@Emiller88"
|
|
@ -1747,6 +1747,10 @@ picard/sortvcf:
|
|||
- modules/picard/sortvcf/**
|
||||
- tests/modules/picard/sortvcf/**
|
||||
|
||||
pints/caller:
|
||||
- modules/pints/caller/**
|
||||
- tests/modules/pints/caller/**
|
||||
|
||||
pirate:
|
||||
- modules/pirate/**
|
||||
- tests/modules/pirate/**
|
||||
|
|
21
tests/modules/pints/caller/main.nf
Normal file
21
tests/modules/pints/caller/main.nf
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { PINTS_CALLER } from '../../../../modules/pints/caller/main.nf'
|
||||
|
||||
workflow test_pints_caller {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false ], // meta map
|
||||
// FIXME Fails if it doesn't find any signals
|
||||
[file("https://raw.githubusercontent.com/Kraus-Lab/groHMM/master/inst/extdata/S0mR1.bam", checkIfExists: true),
|
||||
file("https://raw.githubusercontent.com/Kraus-Lab/groHMM/master/inst/extdata/S40mR1.bam", checkIfExists: true)]
|
||||
]
|
||||
|
||||
PINTS_CALLER ( input )
|
||||
}
|
||||
|
||||
// TODO Test single bam input
|
||||
// TODO Test single bigwig input
|
||||
// TODO Test multiple bigwig input
|
9
tests/modules/pints/caller/nextflow.config
Normal file
9
tests/modules/pints/caller/nextflow.config
Normal file
|
@ -0,0 +1,9 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
withName: PINTS_CALLER {
|
||||
ext.args = "--exp-type GROseq"
|
||||
ext.singularity_pull_docker_container = true
|
||||
}
|
||||
}
|
16
tests/modules/pints/caller/test.yml
Normal file
16
tests/modules/pints/caller/test.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
- name: "pints caller"
|
||||
command: nextflow run ./tests/modules/pints/caller -entry test_pints_caller -c ./tests/config/nextflow.config -c ./tests/modules/pints/caller/nextflow.config
|
||||
tags:
|
||||
- "pints"
|
||||
- "pints/caller"
|
||||
files:
|
||||
- path: output/pints/test_1_bidirectional_peaks.bed
|
||||
md5sum: 8c69305ab896bd772e450e938ddf45f0
|
||||
- path: output/pints/test_1_divergent_peaks.bed
|
||||
md5sum: 2078c643951071f5836d365e5dc7ba1c
|
||||
- path: output/pints/test_1_unidirectional_peaks.bed
|
||||
- path: output/pints/test_2_bidirectional_peaks.bed
|
||||
md5sum: c4efa0f297ba4cdb00659c5e6700ebe5
|
||||
- path: output/pints/test_2_divergent_peaks.bed
|
||||
md5sum: 213a2ba5d9930768d76bf2a7d8c3f7fb
|
||||
- path: output/pints/test_2_unidirectional_peaks.bed
|
Loading…
Reference in a new issue